summaryrefslogtreecommitdiff
path: root/Homework/cs5300/project-three/out/production/p3-parser/data/Expr.cfg
blob: 7493e3e0fcc3f91c9d53ac2b7731d5a4768da7da (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//
// DO NOT MODIFY THIS FILE.
//
// This file contains an expression grammar that uses tokens described in
// ExprLexer.tokens.

grammar Expr;

goal: expr;

expr: expr PLUS term
    | expr MINUS term
    | term
    ;

term : term MULTIPLY factor
     | term DIVIDE factor
     | factor
     ;

factor: OPAREN expr CPAREN
      | INT
      | FLOAT
      | IDENTIFIER
      ;