Permalink
Switch branches/tags
Find file
Fetching contributors…
Cannot retrieve contributors at this time
11 lines (10 sloc) 352 Bytes
@start = expr;
expr = term (plusTerm | minusTerm)*;
term = factor (timesFactor | divFactor)*;
plusTerm = '+' term;
minusTerm = '-' term;
factor = phrase exponentFactor | phrase;
timesFactor = '*' factor;
divFactor = '/' factor;
exponentFactor = '^' factor;
phrase = '(' expr ')' | Number;