0

Like if I have some tokens listed at the beginning of my parser like so

%{
open Ast
%}

%token SEMI LPAREN RPAREN LBRACE RBRACE COMMA PLUS MINUS TIMES DIVIDE ASSIGN
%token NOT EQ NEQ LT LEQ GT GEQ AND OR
%token RETURN IF ELSE FOR WHILE INT BOOL FLOAT VOID
%token <int> LITERAL
%token <bool> BLIT
%token <string> ID FLIT
%token EOF

Is there any type of precedence associated with this? Or is this just a listing of the tokens with no particular importance to order?

Chris
  • 26,361
  • 5
  • 21
  • 42
Shisui
  • 1,051
  • 1
  • 8
  • 23
  • It's just a list of tokens with no implied ordering. Many of us put them in alphabetical order for convenience. – rici Dec 12 '21 at 18:47
  • Precedence declarations: http://gallium.inria.fr/~fpottier/menhir/manual.html#sec10 – rici Dec 12 '21 at 19:10

0 Answers0