File: x.gram

package info (click to toggle)
python-pegen 0.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,980 kB
  • sloc: python: 15,064; makefile: 89
file content (16 lines) | stat: -rw-r--r-- 399 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
start[expr_ty]: expr NEWLINE? ENDMARKER
expr[expr_ty]: ( term '+' expr
             | (sign sign)+ term '-' expr
             | term
             )
sign: '+' | '-'
term[expr_ty]: ( factor '*' term
             | factor '/' term
             | factor
             )
factor[expr_ty]: ('(' expr ')'
               | atom
                )
atom[expr_ty]: ( NAME
               | NUMBER
               )