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.
62 lines
1.9 KiB
62 lines
1.9 KiB
compUnit
|
|
|-- funcDef
|
|
| |-- funcType
|
|
| | `-- Int: int
|
|
| |-- Ident: f
|
|
| |-- L_PAREN: (
|
|
| |-- funcFParams
|
|
| | `-- funcFParam
|
|
| | |-- bType
|
|
| | | `-- Int: int
|
|
| | `-- Ident: f
|
|
| |-- R_PAREN: )
|
|
| `-- block
|
|
| |-- L_BRACE: {
|
|
| |-- blockItem
|
|
| | `-- stmt
|
|
| | |-- Return: return
|
|
| | |-- exp
|
|
| | | `-- addExp
|
|
| | | `-- mulExp
|
|
| | | |-- mulExp
|
|
| | | | `-- unaryExp
|
|
| | | | `-- primaryExp
|
|
| | | | `-- lVal
|
|
| | | | `-- Ident: f
|
|
| | | |-- MulOp: *
|
|
| | | `-- unaryExp
|
|
| | | `-- primaryExp
|
|
| | | `-- number
|
|
| | | `-- IntConst: 2
|
|
| | `-- Semi: ;
|
|
| `-- R_BRACE: }
|
|
|-- funcDef
|
|
| |-- funcType
|
|
| | `-- Int: int
|
|
| |-- Ident: main
|
|
| |-- L_PAREN: (
|
|
| |-- R_PAREN: )
|
|
| `-- block
|
|
| |-- L_BRACE: {
|
|
| |-- blockItem
|
|
| | `-- stmt
|
|
| | |-- Return: return
|
|
| | |-- exp
|
|
| | | `-- addExp
|
|
| | | `-- mulExp
|
|
| | | `-- unaryExp
|
|
| | | |-- Ident: f
|
|
| | | |-- L_PAREN: (
|
|
| | | |-- funcRParams
|
|
| | | | `-- exp
|
|
| | | | `-- addExp
|
|
| | | | `-- mulExp
|
|
| | | | `-- unaryExp
|
|
| | | | `-- primaryExp
|
|
| | | | `-- number
|
|
| | | | `-- IntConst: 10
|
|
| | | `-- R_PAREN: )
|
|
| | `-- Semi: ;
|
|
| `-- R_BRACE: }
|
|
`-- EOF: <EOF>
|