ligo/src/passes/1-parser/reasonligo/ParToken.mly
Christian Rinderknecht f8d6396fcd Refactoring of the parsers
* [CameLIGO/ReasonLIGO] The AST node [EAnnot] (expressions
    annotated by a type) now records the region in the source
    code for the colon.

  * [CameLIGO/ReasonLIGO/PascaLIGO] I added the syntax
     %token <...> TOKEN "lexeme"

  * [ReasonLIGO] I changed the AST nodes [Mtz] and [Str] to
    [Mutez] and [String], respectively (in accordance with the
    PascaLIGO front-end). I changed token [DOTDOTDOT] to
    [ELLIPSIS].

  * [ReasonLIGO] I added what was missing to make a loca build
    with my Makefile.
2019-12-15 17:46:08 +01:00

76 lines
1.7 KiB
OCaml

%{
%}
(* Tokens (mirroring those defined in module LexToken) *)
(* Literals *)
%token <string Region.reg> Ident "<ident>"
%token <string Region.reg> Constr "<constr>"
%token <string Region.reg> String "<string>"
%token <(string * Z.t) Region.reg> Int "<int>"
%token <(string * Z.t) Region.reg> Nat "<nat>"
%token <(string * Z.t) Region.reg> Mutez "<mutez>"
(* Symbols *)
%token <Region.t> MINUS "-"
%token <Region.t> PLUS "+"
%token <Region.t> SLASH "/"
%token <Region.t> TIMES "*"
%token <Region.t> LPAR "("
%token <Region.t> RPAR ")"
%token <Region.t> LBRACKET "["
%token <Region.t> RBRACKET "]"
%token <Region.t> LBRACE "{"
%token <Region.t> RBRACE "}"
%token <Region.t> CAT "++"
%token <Region.t> DOT "."
%token <Region.t> ELLIPSIS "..."
%token <Region.t> COMMA ","
%token <Region.t> SEMI ";"
%token <Region.t> COLON ":"
%token <Region.t> VBAR "|"
%token <Region.t> WILD "_"
%token <Region.t> EQ "="
%token <Region.t> EQEQ "=="
%token <Region.t> NE "!="
%token <Region.t> LT "<"
%token <Region.t> GT ">"
%token <Region.t> LE "<="
%token <Region.t> GE ">="
%token <Region.t> ARROW "=>"
%token <Region.t> NOT "!"
%token <Region.t> BOOL_OR "||"
%token <Region.t> BOOL_AND "&&"
(* Keywords *)
%token <Region.t> Else "else"
%token <Region.t> False "false"
%token <Region.t> If "if"
%token <Region.t> Let "let"
%token <Region.t> Switch "switch"
%token <Region.t> Mod "mod"
%token <Region.t> Or "or"
%token <Region.t> True "true"
%token <Region.t> Type "type"
(* Data constructors *)
%token <Region.t> C_None "None"
%token <Region.t> C_Some "Some"
(* Virtual tokens *)
%token <Region.t> EOF
%%