summaryrefslogtreecommitdiff
path: root/src/runtime/c/pgf/linearizer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/c/pgf/linearizer.h')
-rw-r--r--src/runtime/c/pgf/linearizer.h49
1 files changed, 37 insertions, 12 deletions
diff --git a/src/runtime/c/pgf/linearizer.h b/src/runtime/c/pgf/linearizer.h
index 2c98299b2..6aeffb4e0 100644
--- a/src/runtime/c/pgf/linearizer.h
+++ b/src/runtime/c/pgf/linearizer.h
@@ -4,23 +4,48 @@
#include <gu/enum.h>
/// Linearization of abstract syntax trees.
-/// @file
-
-/** @}
- *
- * @name Enumerating concrete syntax trees
- *
- * Because of the \c variants construct in GF, there may be several
- * possible concrete syntax trees that correspond to a given abstract
- * syntax tree. These can be enumerated with #pgf_concretize.
- *
- * @{
- */
+//
+// PgfCncTree
+//
/// A concrete syntax tree
typedef GuVariant PgfCncTree;
+typedef enum {
+ PGF_CNC_TREE_APP,
+ PGF_CNC_TREE_CHUNKS,
+ PGF_CNC_TREE_LIT,
+} PgfCncTreeTag;
+
+typedef struct {
+ PgfCCat* ccat;
+ PgfCncFun* fun;
+ int fid;
+
+ size_t n_vars;
+ PgfPrintContext* context;
+
+ size_t n_args;
+ PgfCncTree args[];
+} PgfCncTreeApp;
+
+typedef struct {
+ size_t n_vars;
+ PgfPrintContext* context;
+
+ size_t n_args;
+ PgfCncTree args[];
+} PgfCncTreeChunks;
+
+typedef struct {
+ size_t n_vars;
+ PgfPrintContext* context;
+
+ int fid;
+ PgfLiteral lit;
+} PgfCncTreeLit;
+
/// An enumeration of #PgfCncTree trees.
typedef GuEnum PgfCncTreeEnum;