aboutsummaryrefslogtreecommitdiffstats
path: root/src/template-grammar.h
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2015-04-15 20:01:17 -0300
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2015-04-15 19:26:45 -0300
commitec86e13f144d4d8de6a93b8b04117ea5028893d1 (patch)
treee0413858979d9e517529ff528038ffbf2dc5e044 /src/template-grammar.h
parent0b694d89cefae8e8ca3422bbdbfbca4d5920ac4b (diff)
downloadblogc-ec86e13f144d4d8de6a93b8b04117ea5028893d1.tar.gz
blogc-ec86e13f144d4d8de6a93b8b04117ea5028893d1.tar.bz2
blogc-ec86e13f144d4d8de6a93b8b04117ea5028893d1.zip
added template grammar
Diffstat (limited to 'src/template-grammar.h')
-rw-r--r--src/template-grammar.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/template-grammar.h b/src/template-grammar.h
new file mode 100644
index 0000000..e95fa46
--- /dev/null
+++ b/src/template-grammar.h
@@ -0,0 +1,32 @@
+/*
+ * blogc: A blog compiler.
+ * Copyright (C) 2015 Rafael G. Martins <rafael@rafaelmartins.eng.br>
+ *
+ * This program can be distributed under the terms of the LGPL-2 License.
+ * See the file COPYING.
+ */
+
+#ifndef _TEMPLATE_GRAMMAR_H
+#define _TEMPLATE_GRAMMAR_H
+
+#include "utils/utils.h"
+
+typedef enum {
+ BLOGC_TEMPLATE_IF_STMT,
+ BLOGC_TEMPLATE_ELSE_STMT,
+ BLOGC_TEMPLATE_ENDIF_STMT,
+ BLOGC_TEMPLATE_BLOCK_STMT,
+ BLOGC_TEMPLATE_ENDBLOCK_STMT,
+ BLOGC_TEMPLATE_VARIABLE_STMT,
+ BLOGC_TEMPLATE_CONTENT_STMT,
+} blogc_template_stmt_type_t;
+
+typedef struct {
+ blogc_template_stmt_type_t type;
+ char *value;
+} blogc_template_stmt_t;
+
+b_slist_t* blogc_template_parse(const char *tmpl);
+void blogc_template_free_stmts(b_slist_t *stmts);
+
+#endif /* _TEMPLATE_GRAMMAR_H */