Added terminals to parser

master
Sanjar Ahmadov 4 years ago
parent 54e35e2b89
commit e844793c02

@ -142,9 +142,78 @@ action code {:
* semantic value of type <type> for these symbols that may be referenced * semantic value of type <type> for these symbols that may be referenced
* in actions ( {: ... :} ). * in actions ( {: ... :} ).
*/ */
terminal INDENT;
terminal DEDENT;
terminal String ID;
terminal String STRING;
/* Terminal Delimiters */
terminal NEWLINE; terminal NEWLINE;
terminal String PLUS; terminal String COLON;
terminal String COMMA;
/* Terminal Literals */
terminal Integer NUMBER; terminal Integer NUMBER;
terminal Boolean BOOL;
terminal String NONE;
/* Terminal Keywords */
terminal String IF;
terminal String ELSE;
terminal String ELIF;
terminal String WHILE;
terminal String CLASS;
terminal String DEF;
terminal String LAMBDA;
terminal String AS;
terminal String FOR;
terminal String GLOBAL;
terminal String IN;
terminal String NONLOCAL;
terminal String PASS;
terminal String RETURN;
terminal String ASSERT;
terminal String AWAIT;
terminal String BREAK;
terminal String CONTINUE;
terminal String DEL;
terminal String EXCEPT;
terminal String FINALLY;
terminal String FROM;
terminal String IMPORT;
terminal String RAISE;
terminal String TRY;
terminal String WITH;
terminal String YIELD;
/* Terminal Operators */
terminal String PLUS;
terminal String MINUS;
terminal String MUL;
terminal String DIV;
terminal String MOD;
terminal String GT;
terminal String LT;
terminal String EQUAL;
terminal String NEQ;
terminal String GEQ;
terminal String LEQ;
terminal String ASSIGN;
terminal String AND;
terminal String OR;
terminal String NOT;
terminal String DOT;
terminal String LPAR;
terminal String RPAR;
terminal String LBR;
terminal String RBR;
terminal String ARROW;
terminal String IS;
/* Returned by the lexer for erroneous tokens. Since it does not appear in /* Returned by the lexer for erroneous tokens. Since it does not appear in
* the grammar, it indicates a syntax error. */ * the grammar, it indicates a syntax error. */
terminal UNRECOGNIZED; terminal UNRECOGNIZED;

Loading…
Cancel
Save