]> git.mxchange.org Git - simgear.git/blobdiff - simgear/nasal/parse.h
cppbind: disable special handling of 'parents' for ghost.
[simgear.git] / simgear / nasal / parse.h
index e3db3e7a2bae037fe6d0af9dab5dc47cf3937f0c..1574ea305f3999f869355d4c066d58adf203e572 100644 (file)
@@ -7,7 +7,7 @@
 #include "data.h"
 #include "code.h"
 
-enum {
+enum tok {
     TOK_TOP=1, TOK_AND, TOK_OR, TOK_NOT, TOK_LPAR, TOK_RPAR, TOK_LBRA,
     TOK_RBRA, TOK_LCURL, TOK_RCURL, TOK_MUL, TOK_PLUS, TOK_MINUS, TOK_NEG,
     TOK_DIV, TOK_CAT, TOK_COLON, TOK_DOT, TOK_COMMA, TOK_SEMI,
@@ -23,13 +23,12 @@ enum {
 enum { PREC_BINARY=1, PREC_REVERSE, PREC_PREFIX, PREC_SUFFIX };
 
 struct Token {
-    int type;
+    enum tok type;
     int line;
     char* str;
     int strlen;
     int rule;
     double num;
-    struct Token* parent;
     struct Token* next;
     struct Token* prev;
     struct Token* children;
@@ -64,7 +63,7 @@ struct Parser {
     // Computed line number table for the lexer
     int* lines;
     int  nLines;
-    
+
     struct CodeGenerator* cg;
 };
 
@@ -81,6 +80,11 @@ struct CodeGenerator {
     int nLineIps; // number of pairs
     int nextLineIp;
 
+    int* argSyms;
+    int* optArgSyms;
+    int* optArgVals;
+    naRef restArgSym;
+
     // Stack of "loop" frames for break/continue statements
     struct {
         int breakIP;