calculator.c
branchcalculator-experiment
changeset 812 ac8e761569da
parent 811 307e3ab506fa
child 814 a2cf3f36ed1c
--- a/calculator.c	Mon Feb 08 02:42:12 2010 -0500
+++ b/calculator.c	Mon Feb 08 03:04:29 2010 -0500
@@ -53,17 +53,21 @@
 
 typedef enum Operator
 {
-    OP_DEREF_ARRAY,
-    OP_CALLFUNC,
-    OP_DEREF_STRUCT,
+    OP_START_RANGE_UNARY_OPERATORS,
     OP_POSTINCREMENT,
     OP_POSTDECREMENT,
-    OP_COMMA,
     OP_PREINCREMENT,
     OP_PREDECREMENT,
     OP_NEGATE,
     OP_COMPLEMENT,
     OP_NOT,
+    OP_END_RANGE_UNARY_OPERATORS,
+
+    OP_START_RANGE_BINARY_OPERATORS,
+    OP_DEREF_ARRAY,
+    OP_CALLFUNC,
+    OP_DEREF_STRUCT,
+    OP_COMMA,
     OP_MULTIPLY,
     OP_DIVIDE,
     OP_MODULO,
@@ -82,7 +86,6 @@
     OP_BINARYOR,
     OP_LOGICALAND,
     OP_LOGICALOR,
-    OP_CONDITIONAL,
     OP_ASSIGN,
     OP_MULASSIGN,
     OP_DIVASSIGN,
@@ -94,6 +97,18 @@
     OP_ANDASSIGN,
     OP_XORASSIGN,
     OP_ORASSIGN,
+    OP_END_RANGE_BINARY_OPERATORS,
+
+    OP_START_RANGE_TERNARY_OPERATORS,
+    OP_CONDITIONAL,
+    OP_END_RANGE_TERNARY_OPERATORS,
+
+    OP_START_RANGE_DATA,
+    OP_IDENTIFIER,
+    OP_INT_LITERAL,
+    OP_FLOAT_LITERAL,
+    OP_STRING_LITERAL,
+    OP_END_RANGE_DATA,
 } Operator;
 
 typedef struct Expression
@@ -128,25 +143,25 @@
 
 typedef struct ExpressionIdentifier
 {
-    Operator op;  // Always TOKEN_CALC_IDENTIFIER
+    Operator op;  // Always OP_IDENTIFIER
     const char *identifier;
 } ExpressionIdentifier;
 
 typedef struct ExpressionLiteralInt
 {
-    Operator op;  // Always TOKEN_CALC_INT_CONSTANT
+    Operator op;  // Always OP_INT_LITERAL
     int64 value;
 } ExpressionLiteralInt;
 
 typedef struct ExpressionLiteralFloat
 {
-    Operator op;  // Always TOKEN_CALC_FLOAT_CONSTANT
+    Operator op;  // Always OP_FLOAT_LITERAL
     double value;
 } ExpressionLiteralFloat;
 
 typedef struct ExpressionLiteralString
 {
-    Operator op;  // Always TOKEN_CALC_STRING_LITERAL
+    Operator op;  // Always OP_STRING_LITERAL
     const char *string;
 } ExpressionLiteralString;