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.
64 lines
2.2 KiB
64 lines
2.2 KiB
compUnit
|
|
|-- funcDef
|
|
| |-- funcType
|
|
| | `-- INT: int
|
|
| |-- Ident: main
|
|
| |-- LPAREN: (
|
|
| |-- RPAREN: )
|
|
| `-- block
|
|
| |-- LBRACE: {
|
|
| |-- blockItem
|
|
| | `-- decl
|
|
| | `-- varDecl
|
|
| | |-- bType
|
|
| | | `-- INT: int
|
|
| | |-- varDef
|
|
| | | |-- Ident: a
|
|
| | | |-- ASSIGN: =
|
|
| | | `-- initVal
|
|
| | | `-- exp
|
|
| | | `-- addExp
|
|
| | | `-- mulExp
|
|
| | | `-- unaryExp
|
|
| | | `-- primaryExp
|
|
| | | `-- number
|
|
| | | `-- IntConst: 1
|
|
| | `-- SEMI: ;
|
|
| |-- blockItem
|
|
| | `-- decl
|
|
| | `-- varDecl
|
|
| | |-- bType
|
|
| | | `-- INT: int
|
|
| | |-- varDef
|
|
| | | |-- Ident: b
|
|
| | | |-- ASSIGN: =
|
|
| | | `-- initVal
|
|
| | | `-- exp
|
|
| | | `-- addExp
|
|
| | | `-- mulExp
|
|
| | | `-- unaryExp
|
|
| | | `-- primaryExp
|
|
| | | `-- number
|
|
| | | `-- IntConst: 2
|
|
| | `-- SEMI: ;
|
|
| |-- blockItem
|
|
| | `-- stmt
|
|
| | |-- RETURN: return
|
|
| | |-- exp
|
|
| | | `-- addExp
|
|
| | | |-- addExp
|
|
| | | | `-- mulExp
|
|
| | | | `-- unaryExp
|
|
| | | | `-- primaryExp
|
|
| | | | `-- lVal
|
|
| | | | `-- Ident: a
|
|
| | | |-- ADD: +
|
|
| | | `-- mulExp
|
|
| | | `-- unaryExp
|
|
| | | `-- primaryExp
|
|
| | | `-- lVal
|
|
| | | `-- Ident: b
|
|
| | `-- SEMI: ;
|
|
| `-- RBRACE: }
|
|
`-- EOF: <EOF>
|