parse_ctxt.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /**
  2. * @file parse_ctxt.h
  3. *
  4. * Defines a context storing state while parsing, and all it's
  5. * associated functions. The parse context also stores configuration
  6. * variables controlling the parse behaviour of the lexer, parser, and
  7. * the doc_elts.
  8. */
  9. /*
  10. * This program is free software: you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License as
  12. * published by the Free Software Foundation, either vers* ion 3 of
  13. * the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful, but
  16. * WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program. If not, see
  22. * <http://www.gnu.org/licenses/>.
  23. */
  24. #ifndef PARSE_CTXT
  25. #define PARSE_CTXT
  26. struct gl_list_impl;
  27. typedef struct gl_list_impl * gl_list_t;
  28. typedef struct parse_ctxt
  29. {
  30. gl_list_t todo_states;
  31. size_t current_level;
  32. } parse_ctxt;
  33. /**
  34. * @brief Initialize a parse context.
  35. */
  36. void parse_ctxt_init (parse_ctxt *ctxt);
  37. /**
  38. * @brief Set any unset data to a default value.
  39. */
  40. void parse_ctxt_set_defaults (parse_ctxt *ctxt);
  41. #endif