diff options
author | Paweł Dybiec <pdybiec@stud.cs.uni.wroc.pl> | 2018-11-03 17:57:42 +0100 |
---|---|---|
committer | Paweł Dybiec <pdybiec@stud.cs.uni.wroc.pl> | 2018-11-03 17:57:42 +0100 |
commit | 3a758953f9f934b654a5ded9cfed220e5ae8e21a (patch) | |
tree | 8f89df98e77654d8781d0dd1e71189f277acc4c8 /source/mod_student | |
parent | Change local paths (diff) |
Add first tokens
Diffstat (limited to 'source/mod_student')
-rw-r--r-- | source/mod_student/lexer.mll | 7 | ||||
-rw-r--r-- | source/mod_student/parser.mly | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/source/mod_student/lexer.mll b/source/mod_student/lexer.mll index 4cd656c..f785e52 100644 --- a/source/mod_student/lexer.mll +++ b/source/mod_student/lexer.mll @@ -54,9 +54,12 @@ (* vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv * Miejsce na twoje reguły *) - + | "(" + { LPAREN } + | ")" + { RPAREN } | identifier as id - { failwith id } + { IDENTIFIER id } (* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ----------------------------------------------------------------------------- *) diff --git a/source/mod_student/parser.mly b/source/mod_student/parser.mly index 3eacf51..d2216a6 100644 --- a/source/mod_student/parser.mly +++ b/source/mod_student/parser.mly @@ -30,7 +30,14 @@ let mkTag = *) %token EOF +%token LPAREN +%token RPAREN +%token LBRACKET +%token RBRACKET +%token <int>INT %token <string>IDENTIFIER +%token <char>CHAR +%token <bool>BOOL (* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ----------------------------------------------------------------------------- *) |