aboutsummaryrefslogtreecommitdiff
path: root/lib/qparser/tokens.mly
diff options
context:
space:
mode:
authorChimrod <>2023-10-06 08:35:56 +0200
committerChimrod <>2023-10-06 08:35:56 +0200
commit97ab5c9a21166f0bffee482210d69877fd6809fa (patch)
treed1fa44000fa07631edc8924a90020f2cfe637263 /lib/qparser/tokens.mly
parent40f4dbe7844725e0ab07f03f25c35f55b4699b46 (diff)
Moved qparser and syntax in the library folder
Diffstat (limited to 'lib/qparser/tokens.mly')
-rw-r--r--lib/qparser/tokens.mly73
1 files changed, 73 insertions, 0 deletions
diff --git a/lib/qparser/tokens.mly b/lib/qparser/tokens.mly
new file mode 100644
index 0000000..9ac4b10
--- /dev/null
+++ b/lib/qparser/tokens.mly
@@ -0,0 +1,73 @@
+%token <string>LOCATION_START
+%token LOCATION_END
+
+%token PLUS
+%token MINUS
+%token INCR DECR
+%token MULT_EQUAL
+%token STAR
+%token DIV
+%token MOD
+
+%token AMPERSAND
+%token COMA
+%token EQUAL
+%token COLUMN
+%token L_BRACKET R_BRACKET
+%token L_PAREN R_PAREN
+%token LT GT
+%token EXCLAMATION
+%token AND OR
+
+%token EOF
+%token EOL
+
+%token <string>IDENT
+%token <string>LITERAL
+%token <string>INTEGER
+
+%token COMMENT
+
+%token ACT
+%token IF
+%token ELSE
+%token ELIF
+%token END
+%token LET
+%token SET
+%token OBJ
+%token LOC
+%token NO
+%token <string>KEYWORD
+%token <Qsp_syntax.T.function_>FUNCTION
+
+(*
+(b) if the token was declared left-associative, then the conflict is resolved
+in favor of reduction;
+
+(c) if the token was declared right-associative, then the conflict is resolved
+in favor of shifting.
+ *)
+
+(* Exclamation should have the lower priority because the comments shall never
+ take place of the statements
+ *)
+%right NO
+(* The priority for the variable should be lower than the equality priority
+ if I want to allow declare new variables *)
+%left p_variable
+%left OR
+%left AND
+%left EQUAL
+%left GT LT
+%left EXCLAMATION
+%left PLUS MINUS
+%left STAR DIV
+%left MOD
+%left FUNCTION
+%left L_PAREN
+%right R_PAREN
+%left COMA
+%left KEYWORD
+
+%%