forked from NUDT-compiler/nudt-compiler-cpp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.4 KiB
47 lines
1.4 KiB
compUnit
|
|
|-- decl
|
|
| `-- constDecl
|
|
| |-- Const: const
|
|
| |-- bType
|
|
| | `-- Int: int
|
|
| |-- constDef
|
|
| | |-- Ident: a
|
|
| | |-- Assign: =
|
|
| | `-- constInitVal
|
|
| | `-- constExp
|
|
| | `-- addExp
|
|
| | `-- mulExp
|
|
| | `-- unaryExp
|
|
| | `-- primaryExp
|
|
| | `-- number
|
|
| | `-- IntConst: 10
|
|
| `-- Semi: ;
|
|
|-- funcDef
|
|
| |-- funcType
|
|
| | `-- Int: int
|
|
| |-- Ident: main
|
|
| |-- L_PAREN: (
|
|
| |-- R_PAREN: )
|
|
| `-- block
|
|
| |-- L_BRACE: {
|
|
| |-- blockItem
|
|
| | `-- stmt
|
|
| | |-- Return: return
|
|
| | |-- exp
|
|
| | | `-- addExp
|
|
| | | |-- addExp
|
|
| | | | `-- mulExp
|
|
| | | | `-- unaryExp
|
|
| | | | `-- primaryExp
|
|
| | | | `-- lVal
|
|
| | | | `-- Ident: a
|
|
| | | |-- AddOp: +
|
|
| | | `-- mulExp
|
|
| | | `-- unaryExp
|
|
| | | `-- primaryExp
|
|
| | | `-- number
|
|
| | | `-- IntConst: 5
|
|
| | `-- Semi: ;
|
|
| `-- R_BRACE: }
|
|
`-- EOF: <EOF>
|