优化lab1脚本,增加语法树输出

zwz-compiler
the-little-apprentice 2 weeks ago
parent 472f059af7
commit e4fed12b92

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,651 @@
compUnit
|-- funcDef
| |-- funcType
| | `-- INT: int
| |-- Ident: main
| |-- LPAREN: (
| |-- RPAREN: )
| `-- block
| |-- LBRACE: {
| |-- blockItem
| | `-- decl
| | `-- constDecl
| | |-- CONST: const
| | |-- bType
| | | `-- INT: int
| | |-- constDef
| | | |-- Ident: a
| | | |-- LBRACK: [
| | | |-- constExp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 4
| | | |-- RBRACK: ]
| | | |-- LBRACK: [
| | | |-- constExp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 2
| | | |-- RBRACK: ]
| | | |-- ASSIGN: =
| | | `-- constInitVal
| | | |-- LBRACE: {
| | | |-- constInitVal
| | | | |-- LBRACE: {
| | | | |-- constInitVal
| | | | | `-- constExp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- number
| | | | | `-- IntConst: 1
| | | | |-- COMMA: ,
| | | | |-- constInitVal
| | | | | `-- constExp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- number
| | | | | `-- IntConst: 2
| | | | `-- RBRACE: }
| | | |-- COMMA: ,
| | | |-- constInitVal
| | | | |-- LBRACE: {
| | | | |-- constInitVal
| | | | | `-- constExp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- number
| | | | | `-- IntConst: 3
| | | | |-- COMMA: ,
| | | | |-- constInitVal
| | | | | `-- constExp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- number
| | | | | `-- IntConst: 4
| | | | `-- RBRACE: }
| | | |-- COMMA: ,
| | | |-- constInitVal
| | | | |-- LBRACE: {
| | | | `-- RBRACE: }
| | | |-- COMMA: ,
| | | |-- constInitVal
| | | | `-- constExp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 7
| | | `-- RBRACE: }
| | `-- SEMI: ;
| |-- blockItem
| | `-- decl
| | `-- constDecl
| | |-- CONST: const
| | |-- bType
| | | `-- INT: int
| | |-- constDef
| | | |-- Ident: N
| | | |-- ASSIGN: =
| | | `-- constInitVal
| | | `-- constExp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- IntConst: 3
| | `-- SEMI: ;
| |-- blockItem
| | `-- decl
| | `-- varDecl
| | |-- bType
| | | `-- INT: int
| | |-- varDef
| | | |-- Ident: b
| | | |-- LBRACK: [
| | | |-- constExp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 4
| | | |-- RBRACK: ]
| | | |-- LBRACK: [
| | | |-- constExp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 2
| | | |-- RBRACK: ]
| | | |-- ASSIGN: =
| | | `-- initVal
| | | |-- LBRACE: {
| | | `-- RBRACE: }
| | `-- SEMI: ;
| |-- blockItem
| | `-- decl
| | `-- varDecl
| | |-- bType
| | | `-- INT: int
| | |-- varDef
| | | |-- Ident: c
| | | |-- LBRACK: [
| | | |-- constExp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 4
| | | |-- RBRACK: ]
| | | |-- LBRACK: [
| | | |-- constExp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 2
| | | |-- RBRACK: ]
| | | |-- ASSIGN: =
| | | `-- initVal
| | | |-- LBRACE: {
| | | |-- initVal
| | | | `-- exp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 1
| | | |-- COMMA: ,
| | | |-- initVal
| | | | `-- exp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 2
| | | |-- COMMA: ,
| | | |-- initVal
| | | | `-- exp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 3
| | | |-- COMMA: ,
| | | |-- initVal
| | | | `-- exp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 4
| | | |-- COMMA: ,
| | | |-- initVal
| | | | `-- exp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 5
| | | |-- COMMA: ,
| | | |-- initVal
| | | | `-- exp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 6
| | | |-- COMMA: ,
| | | |-- initVal
| | | | `-- exp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 7
| | | |-- COMMA: ,
| | | |-- initVal
| | | | `-- exp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 8
| | | `-- RBRACE: }
| | `-- SEMI: ;
| |-- blockItem
| | `-- decl
| | `-- varDecl
| | |-- bType
| | | `-- INT: int
| | |-- varDef
| | | |-- Ident: d
| | | |-- LBRACK: [
| | | |-- constExp
| | | | `-- addExp
| | | | |-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: N
| | | | |-- ADD: +
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 1
| | | |-- RBRACK: ]
| | | |-- LBRACK: [
| | | |-- constExp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 2
| | | |-- RBRACK: ]
| | | |-- ASSIGN: =
| | | `-- initVal
| | | |-- LBRACE: {
| | | |-- initVal
| | | | `-- exp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 1
| | | |-- COMMA: ,
| | | |-- initVal
| | | | `-- exp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 2
| | | |-- COMMA: ,
| | | |-- initVal
| | | | |-- LBRACE: {
| | | | |-- initVal
| | | | | `-- exp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- number
| | | | | `-- IntConst: 3
| | | | `-- RBRACE: }
| | | |-- COMMA: ,
| | | |-- initVal
| | | | |-- LBRACE: {
| | | | |-- initVal
| | | | | `-- exp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- number
| | | | | `-- IntConst: 5
| | | | `-- RBRACE: }
| | | |-- COMMA: ,
| | | |-- initVal
| | | | `-- exp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- lVal
| | | | |-- Ident: a
| | | | |-- LBRACK: [
| | | | |-- exp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- number
| | | | | `-- IntConst: 3
| | | | |-- RBRACK: ]
| | | | |-- LBRACK: [
| | | | |-- exp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- number
| | | | | `-- IntConst: 0
| | | | `-- RBRACK: ]
| | | |-- COMMA: ,
| | | |-- initVal
| | | | `-- exp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 8
| | | `-- RBRACE: }
| | `-- SEMI: ;
| |-- blockItem
| | `-- decl
| | `-- varDecl
| | |-- bType
| | | `-- INT: int
| | |-- varDef
| | | |-- Ident: e
| | | |-- LBRACK: [
| | | |-- constExp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 4
| | | |-- RBRACK: ]
| | | |-- LBRACK: [
| | | |-- constExp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 2
| | | |-- RBRACK: ]
| | | |-- LBRACK: [
| | | |-- constExp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 1
| | | |-- RBRACK: ]
| | | |-- ASSIGN: =
| | | `-- initVal
| | | |-- LBRACE: {
| | | |-- initVal
| | | | |-- LBRACE: {
| | | | |-- initVal
| | | | | `-- exp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | |-- Ident: d
| | | | | |-- LBRACK: [
| | | | | |-- exp
| | | | | | `-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- number
| | | | | | `-- IntConst: 2
| | | | | |-- RBRACK: ]
| | | | | |-- LBRACK: [
| | | | | |-- exp
| | | | | | `-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- number
| | | | | | `-- IntConst: 1
| | | | | `-- RBRACK: ]
| | | | |-- COMMA: ,
| | | | |-- initVal
| | | | | |-- LBRACE: {
| | | | | |-- initVal
| | | | | | `-- exp
| | | | | | `-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | |-- Ident: c
| | | | | | |-- LBRACK: [
| | | | | | |-- exp
| | | | | | | `-- addExp
| | | | | | | `-- mulExp
| | | | | | | `-- unaryExp
| | | | | | | `-- primaryExp
| | | | | | | `-- number
| | | | | | | `-- IntConst: 2
| | | | | | |-- RBRACK: ]
| | | | | | |-- LBRACK: [
| | | | | | |-- exp
| | | | | | | `-- addExp
| | | | | | | `-- mulExp
| | | | | | | `-- unaryExp
| | | | | | | `-- primaryExp
| | | | | | | `-- number
| | | | | | | `-- IntConst: 1
| | | | | | `-- RBRACK: ]
| | | | | `-- RBRACE: }
| | | | `-- RBRACE: }
| | | |-- COMMA: ,
| | | |-- initVal
| | | | |-- LBRACE: {
| | | | |-- initVal
| | | | | `-- exp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- number
| | | | | `-- IntConst: 3
| | | | |-- COMMA: ,
| | | | |-- initVal
| | | | | `-- exp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- number
| | | | | `-- IntConst: 4
| | | | `-- RBRACE: }
| | | |-- COMMA: ,
| | | |-- initVal
| | | | |-- LBRACE: {
| | | | |-- initVal
| | | | | `-- exp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- number
| | | | | `-- IntConst: 5
| | | | |-- COMMA: ,
| | | | |-- initVal
| | | | | `-- exp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- number
| | | | | `-- IntConst: 6
| | | | `-- RBRACE: }
| | | |-- COMMA: ,
| | | |-- initVal
| | | | |-- LBRACE: {
| | | | |-- initVal
| | | | | `-- exp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- number
| | | | | `-- IntConst: 7
| | | | |-- COMMA: ,
| | | | |-- initVal
| | | | | `-- exp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- number
| | | | | `-- IntConst: 8
| | | | `-- RBRACE: }
| | | `-- RBRACE: }
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- RETURN: return
| | |-- exp
| | | `-- addExp
| | | |-- addExp
| | | | |-- addExp
| | | | | |-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | |-- Ident: e
| | | | | | |-- LBRACK: [
| | | | | | |-- exp
| | | | | | | `-- addExp
| | | | | | | `-- mulExp
| | | | | | | `-- unaryExp
| | | | | | | `-- primaryExp
| | | | | | | `-- number
| | | | | | | `-- IntConst: 3
| | | | | | |-- RBRACK: ]
| | | | | | |-- LBRACK: [
| | | | | | |-- exp
| | | | | | | `-- addExp
| | | | | | | `-- mulExp
| | | | | | | `-- unaryExp
| | | | | | | `-- primaryExp
| | | | | | | `-- number
| | | | | | | `-- IntConst: 1
| | | | | | |-- RBRACK: ]
| | | | | | |-- LBRACK: [
| | | | | | |-- exp
| | | | | | | `-- addExp
| | | | | | | `-- mulExp
| | | | | | | `-- unaryExp
| | | | | | | `-- primaryExp
| | | | | | | `-- number
| | | | | | | `-- IntConst: 0
| | | | | | `-- RBRACK: ]
| | | | | |-- ADD: +
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | |-- Ident: e
| | | | | |-- LBRACK: [
| | | | | |-- exp
| | | | | | `-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- number
| | | | | | `-- IntConst: 0
| | | | | |-- RBRACK: ]
| | | | | |-- LBRACK: [
| | | | | |-- exp
| | | | | | `-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- number
| | | | | | `-- IntConst: 0
| | | | | |-- RBRACK: ]
| | | | | |-- LBRACK: [
| | | | | |-- exp
| | | | | | `-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- number
| | | | | | `-- IntConst: 0
| | | | | `-- RBRACK: ]
| | | | |-- ADD: +
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- lVal
| | | | |-- Ident: e
| | | | |-- LBRACK: [
| | | | |-- exp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- number
| | | | | `-- IntConst: 0
| | | | |-- RBRACK: ]
| | | | |-- LBRACK: [
| | | | |-- exp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- number
| | | | | `-- IntConst: 1
| | | | |-- RBRACK: ]
| | | | |-- LBRACK: [
| | | | |-- exp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- number
| | | | | `-- IntConst: 0
| | | | `-- RBRACK: ]
| | | |-- ADD: +
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- lVal
| | | |-- Ident: d
| | | |-- LBRACK: [
| | | |-- exp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 3
| | | |-- RBRACK: ]
| | | |-- LBRACK: [
| | | |-- exp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 0
| | | `-- RBRACK: ]
| | `-- SEMI: ;
| `-- RBRACE: }
`-- EOF: <EOF>

@ -0,0 +1,116 @@
compUnit
|-- decl
| `-- varDecl
| |-- bType
| | `-- INT: int
| |-- varDef
| | `-- Ident: a
| `-- SEMI: ;
|-- funcDef
| |-- funcType
| | `-- INT: int
| |-- Ident: func
| |-- LPAREN: (
| |-- funcFParams
| | `-- funcFParam
| | |-- bType
| | | `-- INT: int
| | `-- Ident: p
| |-- RPAREN: )
| `-- block
| |-- LBRACE: {
| |-- blockItem
| | `-- stmt
| | |-- lVal
| | | `-- Ident: p
| | |-- ASSIGN: =
| | |-- exp
| | | `-- addExp
| | | |-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- lVal
| | | | `-- Ident: p
| | | |-- SUB: -
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- IntConst: 1
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- RETURN: return
| | |-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- lVal
| | | `-- Ident: p
| | `-- SEMI: ;
| `-- RBRACE: }
|-- funcDef
| |-- funcType
| | `-- INT: int
| |-- Ident: main
| |-- LPAREN: (
| |-- RPAREN: )
| `-- block
| |-- LBRACE: {
| |-- blockItem
| | `-- decl
| | `-- varDecl
| | |-- bType
| | | `-- INT: int
| | |-- varDef
| | | `-- Ident: b
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- lVal
| | | `-- Ident: a
| | |-- ASSIGN: =
| | |-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- IntConst: 10
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- lVal
| | | `-- Ident: b
| | |-- ASSIGN: =
| | |-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | |-- Ident: func
| | | |-- LPAREN: (
| | | |-- funcRParams
| | | | `-- exp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- lVal
| | | | `-- Ident: a
| | | `-- RPAREN: )
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- RETURN: return
| | |-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- lVal
| | | `-- Ident: b
| | `-- SEMI: ;
| `-- RBRACE: }
`-- EOF: <EOF>

@ -0,0 +1,69 @@
compUnit
|-- funcDef
| |-- funcType
| | `-- INT: int
| |-- Ident: main
| |-- LPAREN: (
| |-- RPAREN: )
| `-- block
| |-- LBRACE: {
| |-- blockItem
| | `-- decl
| | `-- varDecl
| | |-- bType
| | | `-- INT: int
| | |-- varDef
| | | `-- Ident: a
| | |-- COMMA: ,
| | |-- varDef
| | | `-- Ident: b
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- lVal
| | | `-- Ident: a
| | |-- ASSIGN: =
| | |-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- IntConst: 10
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- lVal
| | | `-- Ident: b
| | |-- ASSIGN: =
| | |-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | |-- unaryOp
| | | | `-- SUB: -
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- IntConst: 1
| | `-- 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>

@ -0,0 +1,67 @@
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
| |-- LPAREN: (
| |-- RPAREN: )
| `-- block
| |-- LBRACE: {
| |-- blockItem
| | `-- decl
| | `-- varDecl
| | |-- bType
| | | `-- INT: int
| | |-- varDef
| | | `-- Ident: b
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- lVal
| | | `-- Ident: b
| | |-- ASSIGN: =
| | |-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- IntConst: 2
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- RETURN: return
| | |-- exp
| | | `-- addExp
| | | |-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- lVal
| | | | `-- Ident: b
| | | |-- SUB: -
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- lVal
| | | `-- Ident: a
| | `-- SEMI: ;
| `-- RBRACE: }
`-- EOF: <EOF>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,699 @@
compUnit
|-- funcDef
| |-- funcType
| | `-- INT: int
| |-- Ident: main
| |-- LPAREN: (
| |-- RPAREN: )
| `-- block
| |-- LBRACE: {
| |-- blockItem
| | `-- stmt
| | |-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | |-- Ident: putch
| | | |-- LPAREN: (
| | | |-- funcRParams
| | | | `-- exp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 97
| | | `-- RPAREN: )
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | |-- Ident: putch
| | | |-- LPAREN: (
| | | |-- funcRParams
| | | | `-- exp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 10
| | | `-- RPAREN: )
| | `-- SEMI: ;
| |-- blockItem
| | `-- decl
| | `-- varDecl
| | |-- bType
| | | `-- INT: int
| | |-- varDef
| | | |-- Ident: a
| | | |-- ASSIGN: =
| | | `-- initVal
| | | `-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- IntConst: 1
| | |-- COMMA: ,
| | |-- varDef
| | | |-- Ident: putch
| | | |-- ASSIGN: =
| | | `-- initVal
| | | `-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- IntConst: 0
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | `-- block
| | |-- LBRACE: {
| | |-- blockItem
| | | `-- stmt
| | | |-- lVal
| | | | `-- Ident: a
| | | |-- ASSIGN: =
| | | |-- exp
| | | | `-- addExp
| | | | |-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: a
| | | | |-- ADD: +
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 2
| | | `-- SEMI: ;
| | |-- blockItem
| | | `-- decl
| | | `-- varDecl
| | | |-- bType
| | | | `-- INT: int
| | | |-- varDef
| | | | |-- Ident: b
| | | | |-- ASSIGN: =
| | | | `-- initVal
| | | | `-- exp
| | | | `-- addExp
| | | | |-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: a
| | | | |-- ADD: +
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 3
| | | `-- SEMI: ;
| | |-- blockItem
| | | `-- stmt
| | | |-- lVal
| | | | `-- Ident: b
| | | |-- ASSIGN: =
| | | |-- exp
| | | | `-- addExp
| | | | |-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: b
| | | | |-- ADD: +
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 4
| | | `-- SEMI: ;
| | |-- blockItem
| | | `-- stmt
| | | |-- lVal
| | | | `-- Ident: putch
| | | |-- ASSIGN: =
| | | |-- exp
| | | | `-- addExp
| | | | |-- addExp
| | | | | |-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: putch
| | | | | |-- ADD: +
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: a
| | | | |-- ADD: +
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- lVal
| | | | `-- Ident: b
| | | `-- SEMI: ;
| | |-- blockItem
| | | `-- stmt
| | | `-- block
| | | |-- LBRACE: {
| | | |-- blockItem
| | | | `-- stmt
| | | | |-- lVal
| | | | | `-- Ident: b
| | | | |-- ASSIGN: =
| | | | |-- exp
| | | | | `-- addExp
| | | | | |-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: b
| | | | | |-- ADD: +
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- number
| | | | | `-- IntConst: 5
| | | | `-- SEMI: ;
| | | |-- blockItem
| | | | `-- decl
| | | | `-- varDecl
| | | | |-- bType
| | | | | `-- INT: int
| | | | |-- varDef
| | | | | |-- Ident: main
| | | | | |-- ASSIGN: =
| | | | | `-- initVal
| | | | | `-- exp
| | | | | `-- addExp
| | | | | |-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: b
| | | | | |-- ADD: +
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- number
| | | | | `-- IntConst: 6
| | | | `-- SEMI: ;
| | | |-- blockItem
| | | | `-- stmt
| | | | |-- lVal
| | | | | `-- Ident: a
| | | | |-- ASSIGN: =
| | | | |-- exp
| | | | | `-- addExp
| | | | | |-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: a
| | | | | |-- ADD: +
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: main
| | | | `-- SEMI: ;
| | | |-- blockItem
| | | | `-- stmt
| | | | |-- lVal
| | | | | `-- Ident: putch
| | | | |-- ASSIGN: =
| | | | |-- exp
| | | | | `-- addExp
| | | | | |-- addExp
| | | | | | |-- addExp
| | | | | | | |-- addExp
| | | | | | | | `-- mulExp
| | | | | | | | `-- unaryExp
| | | | | | | | `-- primaryExp
| | | | | | | | `-- lVal
| | | | | | | | `-- Ident: putch
| | | | | | | |-- ADD: +
| | | | | | | `-- mulExp
| | | | | | | `-- unaryExp
| | | | | | | `-- primaryExp
| | | | | | | `-- lVal
| | | | | | | `-- Ident: a
| | | | | | |-- ADD: +
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: b
| | | | | |-- ADD: +
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: main
| | | | `-- SEMI: ;
| | | |-- blockItem
| | | | `-- stmt
| | | | `-- block
| | | | |-- LBRACE: {
| | | | |-- blockItem
| | | | | `-- stmt
| | | | | |-- lVal
| | | | | | `-- Ident: b
| | | | | |-- ASSIGN: =
| | | | | |-- exp
| | | | | | `-- addExp
| | | | | | |-- addExp
| | | | | | | `-- mulExp
| | | | | | | `-- unaryExp
| | | | | | | `-- primaryExp
| | | | | | | `-- lVal
| | | | | | | `-- Ident: b
| | | | | | |-- ADD: +
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: a
| | | | | `-- SEMI: ;
| | | | |-- blockItem
| | | | | `-- decl
| | | | | `-- varDecl
| | | | | |-- bType
| | | | | | `-- INT: int
| | | | | |-- varDef
| | | | | | |-- Ident: a
| | | | | | |-- ASSIGN: =
| | | | | | `-- initVal
| | | | | | `-- exp
| | | | | | `-- addExp
| | | | | | |-- addExp
| | | | | | | `-- mulExp
| | | | | | | `-- unaryExp
| | | | | | | `-- primaryExp
| | | | | | | `-- lVal
| | | | | | | `-- Ident: main
| | | | | | |-- ADD: +
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- number
| | | | | | `-- IntConst: 7
| | | | | `-- SEMI: ;
| | | | |-- blockItem
| | | | | `-- stmt
| | | | | |-- lVal
| | | | | | `-- Ident: a
| | | | | |-- ASSIGN: =
| | | | | |-- exp
| | | | | | `-- addExp
| | | | | | |-- addExp
| | | | | | | `-- mulExp
| | | | | | | `-- unaryExp
| | | | | | | `-- primaryExp
| | | | | | | `-- lVal
| | | | | | | `-- Ident: a
| | | | | | |-- ADD: +
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- number
| | | | | | `-- IntConst: 8
| | | | | `-- SEMI: ;
| | | | |-- blockItem
| | | | | `-- stmt
| | | | | |-- lVal
| | | | | | `-- Ident: putch
| | | | | |-- ASSIGN: =
| | | | | |-- exp
| | | | | | `-- addExp
| | | | | | |-- addExp
| | | | | | | |-- addExp
| | | | | | | | |-- addExp
| | | | | | | | | `-- mulExp
| | | | | | | | | `-- unaryExp
| | | | | | | | | `-- primaryExp
| | | | | | | | | `-- lVal
| | | | | | | | | `-- Ident: putch
| | | | | | | | |-- ADD: +
| | | | | | | | `-- mulExp
| | | | | | | | `-- unaryExp
| | | | | | | | `-- primaryExp
| | | | | | | | `-- lVal
| | | | | | | | `-- Ident: a
| | | | | | | |-- ADD: +
| | | | | | | `-- mulExp
| | | | | | | `-- unaryExp
| | | | | | | `-- primaryExp
| | | | | | | `-- lVal
| | | | | | | `-- Ident: b
| | | | | | |-- ADD: +
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: main
| | | | | `-- SEMI: ;
| | | | |-- blockItem
| | | | | `-- stmt
| | | | | `-- block
| | | | | |-- LBRACE: {
| | | | | |-- blockItem
| | | | | | `-- stmt
| | | | | | |-- lVal
| | | | | | | `-- Ident: b
| | | | | | |-- ASSIGN: =
| | | | | | |-- exp
| | | | | | | `-- addExp
| | | | | | | |-- addExp
| | | | | | | | `-- mulExp
| | | | | | | | `-- unaryExp
| | | | | | | | `-- primaryExp
| | | | | | | | `-- lVal
| | | | | | | | `-- Ident: b
| | | | | | | |-- ADD: +
| | | | | | | `-- mulExp
| | | | | | | `-- unaryExp
| | | | | | | `-- primaryExp
| | | | | | | `-- lVal
| | | | | | | `-- Ident: a
| | | | | | `-- SEMI: ;
| | | | | |-- blockItem
| | | | | | `-- decl
| | | | | | `-- varDecl
| | | | | | |-- bType
| | | | | | | `-- INT: int
| | | | | | |-- varDef
| | | | | | | |-- Ident: b
| | | | | | | |-- ASSIGN: =
| | | | | | | `-- initVal
| | | | | | | `-- exp
| | | | | | | `-- addExp
| | | | | | | |-- addExp
| | | | | | | | `-- mulExp
| | | | | | | | `-- unaryExp
| | | | | | | | `-- primaryExp
| | | | | | | | `-- lVal
| | | | | | | | `-- Ident: main
| | | | | | | |-- ADD: +
| | | | | | | `-- mulExp
| | | | | | | `-- unaryExp
| | | | | | | `-- primaryExp
| | | | | | | `-- number
| | | | | | | `-- IntConst: 9
| | | | | | `-- SEMI: ;
| | | | | |-- blockItem
| | | | | | `-- stmt
| | | | | | |-- lVal
| | | | | | | `-- Ident: a
| | | | | | |-- ASSIGN: =
| | | | | | |-- exp
| | | | | | | `-- addExp
| | | | | | | |-- addExp
| | | | | | | | `-- mulExp
| | | | | | | | `-- unaryExp
| | | | | | | | `-- primaryExp
| | | | | | | | `-- lVal
| | | | | | | | `-- Ident: a
| | | | | | | |-- ADD: +
| | | | | | | `-- mulExp
| | | | | | | `-- unaryExp
| | | | | | | `-- primaryExp
| | | | | | | `-- number
| | | | | | | `-- IntConst: 10
| | | | | | `-- SEMI: ;
| | | | | |-- blockItem
| | | | | | `-- decl
| | | | | | `-- constDecl
| | | | | | |-- CONST: const
| | | | | | |-- bType
| | | | | | | `-- INT: int
| | | | | | |-- constDef
| | | | | | | |-- Ident: a
| | | | | | | |-- ASSIGN: =
| | | | | | | `-- constInitVal
| | | | | | | `-- constExp
| | | | | | | `-- addExp
| | | | | | | `-- mulExp
| | | | | | | `-- unaryExp
| | | | | | | `-- primaryExp
| | | | | | | `-- number
| | | | | | | `-- IntConst: 11
| | | | | | `-- SEMI: ;
| | | | | |-- blockItem
| | | | | | `-- stmt
| | | | | | |-- lVal
| | | | | | | `-- Ident: b
| | | | | | |-- ASSIGN: =
| | | | | | |-- exp
| | | | | | | `-- addExp
| | | | | | | |-- addExp
| | | | | | | | `-- mulExp
| | | | | | | | `-- unaryExp
| | | | | | | | `-- primaryExp
| | | | | | | | `-- lVal
| | | | | | | | `-- Ident: b
| | | | | | | |-- ADD: +
| | | | | | | `-- mulExp
| | | | | | | `-- unaryExp
| | | | | | | `-- primaryExp
| | | | | | | `-- number
| | | | | | | `-- IntConst: 12
| | | | | | `-- SEMI: ;
| | | | | |-- blockItem
| | | | | | `-- stmt
| | | | | | |-- lVal
| | | | | | | `-- Ident: putch
| | | | | | |-- ASSIGN: =
| | | | | | |-- exp
| | | | | | | `-- addExp
| | | | | | | |-- addExp
| | | | | | | | |-- addExp
| | | | | | | | | |-- addExp
| | | | | | | | | | `-- mulExp
| | | | | | | | | | `-- unaryExp
| | | | | | | | | | `-- primaryExp
| | | | | | | | | | `-- lVal
| | | | | | | | | | `-- Ident: putch
| | | | | | | | | |-- ADD: +
| | | | | | | | | `-- mulExp
| | | | | | | | | `-- unaryExp
| | | | | | | | | `-- primaryExp
| | | | | | | | | `-- lVal
| | | | | | | | | `-- Ident: a
| | | | | | | | |-- ADD: +
| | | | | | | | `-- mulExp
| | | | | | | | `-- unaryExp
| | | | | | | | `-- primaryExp
| | | | | | | | `-- lVal
| | | | | | | | `-- Ident: b
| | | | | | | |-- ADD: +
| | | | | | | `-- mulExp
| | | | | | | `-- unaryExp
| | | | | | | `-- primaryExp
| | | | | | | `-- lVal
| | | | | | | `-- Ident: main
| | | | | | `-- SEMI: ;
| | | | | |-- blockItem
| | | | | | `-- stmt
| | | | | | `-- block
| | | | | | |-- LBRACE: {
| | | | | | |-- blockItem
| | | | | | | `-- stmt
| | | | | | | |-- lVal
| | | | | | | | `-- Ident: main
| | | | | | | |-- ASSIGN: =
| | | | | | | |-- exp
| | | | | | | | `-- addExp
| | | | | | | | |-- addExp
| | | | | | | | | `-- mulExp
| | | | | | | | | `-- unaryExp
| | | | | | | | | `-- primaryExp
| | | | | | | | | `-- lVal
| | | | | | | | | `-- Ident: main
| | | | | | | | |-- ADD: +
| | | | | | | | `-- mulExp
| | | | | | | | `-- unaryExp
| | | | | | | | `-- primaryExp
| | | | | | | | `-- lVal
| | | | | | | | `-- Ident: b
| | | | | | | `-- SEMI: ;
| | | | | | |-- blockItem
| | | | | | | `-- decl
| | | | | | | `-- varDecl
| | | | | | | |-- bType
| | | | | | | | `-- INT: int
| | | | | | | |-- varDef
| | | | | | | | |-- Ident: main
| | | | | | | | |-- ASSIGN: =
| | | | | | | | `-- initVal
| | | | | | | | `-- exp
| | | | | | | | `-- addExp
| | | | | | | | |-- addExp
| | | | | | | | | `-- mulExp
| | | | | | | | | `-- unaryExp
| | | | | | | | | `-- primaryExp
| | | | | | | | | `-- lVal
| | | | | | | | | `-- Ident: b
| | | | | | | | |-- ADD: +
| | | | | | | | `-- mulExp
| | | | | | | | `-- unaryExp
| | | | | | | | `-- primaryExp
| | | | | | | | `-- number
| | | | | | | | `-- IntConst: 13
| | | | | | | `-- SEMI: ;
| | | | | | |-- blockItem
| | | | | | | `-- stmt
| | | | | | | |-- lVal
| | | | | | | | `-- Ident: main
| | | | | | | |-- ASSIGN: =
| | | | | | | |-- exp
| | | | | | | | `-- addExp
| | | | | | | | |-- addExp
| | | | | | | | | `-- mulExp
| | | | | | | | | `-- unaryExp
| | | | | | | | | `-- primaryExp
| | | | | | | | | `-- lVal
| | | | | | | | | `-- Ident: main
| | | | | | | | |-- ADD: +
| | | | | | | | `-- mulExp
| | | | | | | | `-- unaryExp
| | | | | | | | `-- primaryExp
| | | | | | | | `-- lVal
| | | | | | | | `-- Ident: a
| | | | | | | `-- SEMI: ;
| | | | | | |-- blockItem
| | | | | | | `-- stmt
| | | | | | | |-- lVal
| | | | | | | | `-- Ident: putch
| | | | | | | |-- ASSIGN: =
| | | | | | | |-- exp
| | | | | | | | `-- addExp
| | | | | | | | |-- addExp
| | | | | | | | | |-- addExp
| | | | | | | | | | |-- addExp
| | | | | | | | | | | `-- mulExp
| | | | | | | | | | | `-- unaryExp
| | | | | | | | | | | `-- primaryExp
| | | | | | | | | | | `-- lVal
| | | | | | | | | | | `-- Ident: putch
| | | | | | | | | | |-- ADD: +
| | | | | | | | | | `-- mulExp
| | | | | | | | | | `-- unaryExp
| | | | | | | | | | `-- primaryExp
| | | | | | | | | | `-- lVal
| | | | | | | | | | `-- Ident: a
| | | | | | | | | |-- ADD: +
| | | | | | | | | `-- mulExp
| | | | | | | | | `-- unaryExp
| | | | | | | | | `-- primaryExp
| | | | | | | | | `-- lVal
| | | | | | | | | `-- Ident: b
| | | | | | | | |-- ADD: +
| | | | | | | | `-- mulExp
| | | | | | | | `-- unaryExp
| | | | | | | | `-- primaryExp
| | | | | | | | `-- lVal
| | | | | | | | `-- Ident: main
| | | | | | | `-- SEMI: ;
| | | | | | `-- RBRACE: }
| | | | | |-- blockItem
| | | | | | `-- stmt
| | | | | | |-- lVal
| | | | | | | `-- Ident: putch
| | | | | | |-- ASSIGN: =
| | | | | | |-- exp
| | | | | | | `-- addExp
| | | | | | | |-- addExp
| | | | | | | | `-- mulExp
| | | | | | | | `-- unaryExp
| | | | | | | | `-- primaryExp
| | | | | | | | `-- lVal
| | | | | | | | `-- Ident: putch
| | | | | | | |-- SUB: -
| | | | | | | `-- mulExp
| | | | | | | `-- unaryExp
| | | | | | | `-- primaryExp
| | | | | | | `-- lVal
| | | | | | | `-- Ident: main
| | | | | | `-- SEMI: ;
| | | | | `-- RBRACE: }
| | | | |-- blockItem
| | | | | `-- stmt
| | | | | |-- lVal
| | | | | | `-- Ident: putch
| | | | | |-- ASSIGN: =
| | | | | |-- exp
| | | | | | `-- addExp
| | | | | | |-- addExp
| | | | | | | `-- mulExp
| | | | | | | `-- unaryExp
| | | | | | | `-- primaryExp
| | | | | | | `-- lVal
| | | | | | | `-- Ident: putch
| | | | | | |-- SUB: -
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: b
| | | | | `-- SEMI: ;
| | | | `-- RBRACE: }
| | | |-- blockItem
| | | | `-- stmt
| | | | |-- lVal
| | | | | `-- Ident: putch
| | | | |-- ASSIGN: =
| | | | |-- exp
| | | | | `-- addExp
| | | | | |-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: putch
| | | | | |-- SUB: -
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: a
| | | | `-- SEMI: ;
| | | `-- RBRACE: }
| | `-- RBRACE: }
| |-- blockItem
| | `-- stmt
| | |-- RETURN: return
| | |-- exp
| | | `-- addExp
| | | `-- mulExp
| | | |-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- lVal
| | | | `-- Ident: putch
| | | |-- MOD: %
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- IntConst: 77
| | `-- SEMI: ;
| `-- RBRACE: }
`-- EOF: <EOF>

@ -0,0 +1,165 @@
compUnit
|-- funcDef
| |-- funcType
| | `-- INT: int
| |-- Ident: main
| |-- LPAREN: (
| |-- RPAREN: )
| `-- block
| |-- LBRACE: {
| |-- blockItem
| | `-- decl
| | `-- varDecl
| | |-- bType
| | | `-- INT: int
| | |-- varDef
| | | `-- Ident: i
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- lVal
| | | `-- Ident: i
| | |-- ASSIGN: =
| | |-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- IntConst: 0
| | `-- SEMI: ;
| |-- blockItem
| | `-- decl
| | `-- varDecl
| | |-- bType
| | | `-- INT: int
| | |-- varDef
| | | `-- Ident: sum
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- lVal
| | | `-- Ident: sum
| | |-- ASSIGN: =
| | |-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- IntConst: 0
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- WHILE: while
| | |-- LPAREN: (
| | |-- cond
| | | `-- lOrExp
| | | `-- lAndExp
| | | `-- eqExp
| | | `-- relExp
| | | |-- relExp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- lVal
| | | | `-- Ident: i
| | | |-- LT: <
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- IntConst: 100
| | |-- RPAREN: )
| | `-- stmt
| | `-- block
| | |-- LBRACE: {
| | |-- blockItem
| | | `-- stmt
| | | |-- IF: if
| | | |-- LPAREN: (
| | | |-- cond
| | | | `-- lOrExp
| | | | `-- lAndExp
| | | | `-- eqExp
| | | | |-- eqExp
| | | | | `-- relExp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: i
| | | | |-- EQ: ==
| | | | `-- relExp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 50
| | | |-- RPAREN: )
| | | `-- stmt
| | | `-- block
| | | |-- LBRACE: {
| | | |-- blockItem
| | | | `-- stmt
| | | | |-- BREAK: break
| | | | `-- SEMI: ;
| | | `-- RBRACE: }
| | |-- blockItem
| | | `-- stmt
| | | |-- lVal
| | | | `-- Ident: sum
| | | |-- ASSIGN: =
| | | |-- exp
| | | | `-- addExp
| | | | |-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: sum
| | | | |-- ADD: +
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- lVal
| | | | `-- Ident: i
| | | `-- SEMI: ;
| | |-- blockItem
| | | `-- stmt
| | | |-- lVal
| | | | `-- Ident: i
| | | |-- ASSIGN: =
| | | |-- exp
| | | | `-- addExp
| | | | |-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: i
| | | | |-- ADD: +
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 1
| | | `-- SEMI: ;
| | `-- RBRACE: }
| |-- blockItem
| | `-- stmt
| | |-- RETURN: return
| | |-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- lVal
| | | `-- Ident: sum
| | `-- SEMI: ;
| `-- RBRACE: }
`-- EOF: <EOF>

@ -0,0 +1,125 @@
compUnit
|-- funcDef
| |-- funcType
| | `-- INT: int
| |-- Ident: main
| |-- LPAREN: (
| |-- RPAREN: )
| `-- block
| |-- LBRACE: {
| |-- blockItem
| | `-- decl
| | `-- varDecl
| | |-- bType
| | | `-- INT: int
| | |-- varDef
| | | `-- Ident: a
| | |-- COMMA: ,
| | |-- varDef
| | | `-- Ident: b
| | |-- COMMA: ,
| | |-- varDef
| | | `-- Ident: c
| | |-- COMMA: ,
| | |-- varDef
| | | `-- Ident: d
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- lVal
| | | `-- Ident: a
| | |-- ASSIGN: =
| | |-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- IntConst: 10
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- lVal
| | | `-- Ident: b
| | |-- ASSIGN: =
| | |-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- IntConst: 4
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- lVal
| | | `-- Ident: c
| | |-- ASSIGN: =
| | |-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- IntConst: 2
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- lVal
| | | `-- Ident: d
| | |-- ASSIGN: =
| | |-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- IntConst: 2
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- RETURN: return
| | |-- exp
| | | `-- addExp
| | | `-- mulExp
| | | |-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | |-- LPAREN: (
| | | | |-- exp
| | | | | `-- addExp
| | | | | |-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: c
| | | | | |-- ADD: +
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: a
| | | | `-- RPAREN: )
| | | |-- MUL: *
| | | `-- unaryExp
| | | `-- primaryExp
| | | |-- LPAREN: (
| | | |-- exp
| | | | `-- addExp
| | | | |-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: b
| | | | |-- SUB: -
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- lVal
| | | | `-- Ident: d
| | | `-- RPAREN: )
| | `-- SEMI: ;
| `-- RBRACE: }
`-- EOF: <EOF>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,779 @@
compUnit
|-- decl
| `-- varDecl
| |-- bType
| | `-- INT: int
| |-- varDef
| | |-- Ident: COUNT
| | |-- ASSIGN: =
| | `-- initVal
| | `-- exp
| | `-- addExp
| | `-- mulExp
| | `-- unaryExp
| | `-- primaryExp
| | `-- number
| | `-- IntConst: 500000
| `-- SEMI: ;
|-- funcDef
| |-- funcType
| | `-- FLOAT: float
| |-- Ident: loop
| |-- LPAREN: (
| |-- funcFParams
| | |-- funcFParam
| | | |-- bType
| | | | `-- FLOAT: float
| | | |-- Ident: x
| | | |-- LBRACK: [
| | | `-- RBRACK: ]
| | |-- COMMA: ,
| | |-- funcFParam
| | | |-- bType
| | | | `-- FLOAT: float
| | | |-- Ident: y
| | | |-- LBRACK: [
| | | `-- RBRACK: ]
| | |-- COMMA: ,
| | `-- funcFParam
| | |-- bType
| | | `-- INT: int
| | `-- Ident: length
| |-- RPAREN: )
| `-- block
| |-- LBRACE: {
| |-- blockItem
| | `-- decl
| | `-- varDecl
| | |-- bType
| | | `-- INT: int
| | |-- varDef
| | | |-- Ident: i
| | | |-- ASSIGN: =
| | | `-- initVal
| | | `-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- IntConst: 0
| | `-- SEMI: ;
| |-- blockItem
| | `-- decl
| | `-- varDecl
| | |-- bType
| | | `-- FLOAT: float
| | |-- varDef
| | | |-- Ident: accumulator
| | | |-- ASSIGN: =
| | | `-- initVal
| | | `-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- FloatConst: 0.0
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- WHILE: while
| | |-- LPAREN: (
| | |-- cond
| | | `-- lOrExp
| | | `-- lAndExp
| | | `-- eqExp
| | | `-- relExp
| | | |-- relExp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- lVal
| | | | `-- Ident: i
| | | |-- LT: <
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- lVal
| | | `-- Ident: length
| | |-- RPAREN: )
| | `-- stmt
| | `-- block
| | |-- LBRACE: {
| | |-- blockItem
| | | `-- stmt
| | | |-- lVal
| | | | `-- Ident: accumulator
| | | |-- ASSIGN: =
| | | |-- exp
| | | | `-- addExp
| | | | |-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: accumulator
| | | | |-- ADD: +
| | | | `-- mulExp
| | | | |-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | |-- Ident: x
| | | | | |-- LBRACK: [
| | | | | |-- exp
| | | | | | `-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: i
| | | | | `-- RBRACK: ]
| | | | |-- MUL: *
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- lVal
| | | | |-- Ident: y
| | | | |-- LBRACK: [
| | | | |-- exp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: i
| | | | `-- RBRACK: ]
| | | `-- SEMI: ;
| | |-- blockItem
| | | `-- stmt
| | | |-- lVal
| | | | `-- Ident: i
| | | |-- ASSIGN: =
| | | |-- exp
| | | | `-- addExp
| | | | |-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: i
| | | | |-- ADD: +
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 1
| | | `-- SEMI: ;
| | `-- RBRACE: }
| |-- blockItem
| | `-- stmt
| | |-- RETURN: return
| | |-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- lVal
| | | `-- Ident: accumulator
| | `-- SEMI: ;
| `-- RBRACE: }
|-- funcDef
| |-- funcType
| | `-- INT: int
| |-- Ident: main
| |-- LPAREN: (
| |-- RPAREN: )
| `-- block
| |-- LBRACE: {
| |-- blockItem
| | `-- decl
| | `-- varDecl
| | |-- bType
| | | `-- INT: int
| | |-- varDef
| | | |-- Ident: i
| | | |-- ASSIGN: =
| | | `-- initVal
| | | `-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- IntConst: 0
| | |-- COMMA: ,
| | |-- varDef
| | | |-- Ident: j
| | | |-- ASSIGN: =
| | | `-- initVal
| | | `-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- IntConst: 0
| | `-- SEMI: ;
| |-- blockItem
| | `-- decl
| | `-- varDecl
| | |-- bType
| | | `-- INT: int
| | |-- varDef
| | | |-- Ident: len
| | | |-- ASSIGN: =
| | | `-- initVal
| | | `-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | |-- Ident: getint
| | | |-- LPAREN: (
| | | `-- RPAREN: )
| | `-- SEMI: ;
| |-- blockItem
| | `-- decl
| | `-- varDecl
| | |-- bType
| | | `-- FLOAT: float
| | |-- varDef
| | | |-- Ident: x
| | | |-- LBRACK: [
| | | |-- constExp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 4096
| | | `-- RBRACK: ]
| | `-- SEMI: ;
| |-- blockItem
| | `-- decl
| | `-- varDecl
| | |-- bType
| | | `-- FLOAT: float
| | |-- varDef
| | | |-- Ident: y
| | | |-- LBRACK: [
| | | |-- constExp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 4096
| | | `-- RBRACK: ]
| | `-- SEMI: ;
| |-- blockItem
| | `-- decl
| | `-- varDecl
| | |-- bType
| | | `-- FLOAT: float
| | |-- varDef
| | | |-- Ident: total
| | | |-- ASSIGN: =
| | | `-- initVal
| | | `-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- FloatConst: 0.0
| | `-- SEMI: ;
| |-- blockItem
| | `-- decl
| | `-- varDecl
| | |-- bType
| | | `-- FLOAT: float
| | |-- varDef
| | | |-- Ident: a
| | | |-- ASSIGN: =
| | | `-- initVal
| | | `-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- FloatConst: 0.0
| | `-- SEMI: ;
| |-- blockItem
| | `-- decl
| | `-- varDecl
| | |-- bType
| | | `-- FLOAT: float
| | |-- varDef
| | | |-- Ident: b
| | | |-- ASSIGN: =
| | | `-- initVal
| | | `-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- FloatConst: 1.0
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | |-- Ident: starttime
| | | |-- LPAREN: (
| | | `-- RPAREN: )
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- WHILE: while
| | |-- LPAREN: (
| | |-- cond
| | | `-- lOrExp
| | | `-- lAndExp
| | | `-- eqExp
| | | `-- relExp
| | | |-- relExp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- lVal
| | | | `-- Ident: i
| | | |-- LT: <
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- lVal
| | | `-- Ident: COUNT
| | |-- RPAREN: )
| | `-- stmt
| | `-- block
| | |-- LBRACE: {
| | |-- blockItem
| | | `-- stmt
| | | |-- IF: if
| | | |-- LPAREN: (
| | | |-- cond
| | | | `-- lOrExp
| | | | `-- lAndExp
| | | | `-- eqExp
| | | | `-- relExp
| | | | `-- addExp
| | | | `-- mulExp
| | | | |-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: i
| | | | |-- MOD: %
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 10
| | | |-- RPAREN: )
| | | |-- stmt
| | | | `-- block
| | | | |-- LBRACE: {
| | | | |-- blockItem
| | | | | `-- stmt
| | | | | |-- lVal
| | | | | | `-- Ident: a
| | | | | |-- ASSIGN: =
| | | | | |-- exp
| | | | | | `-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- number
| | | | | | `-- FloatConst: 0.0
| | | | | `-- SEMI: ;
| | | | |-- blockItem
| | | | | `-- stmt
| | | | | |-- lVal
| | | | | | `-- Ident: b
| | | | | |-- ASSIGN: =
| | | | | |-- exp
| | | | | | `-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- number
| | | | | | `-- FloatConst: 1.0
| | | | | `-- SEMI: ;
| | | | `-- RBRACE: }
| | | |-- ELSE: else
| | | `-- stmt
| | | `-- block
| | | |-- LBRACE: {
| | | |-- blockItem
| | | | `-- stmt
| | | | |-- lVal
| | | | | `-- Ident: a
| | | | |-- ASSIGN: =
| | | | |-- exp
| | | | | `-- addExp
| | | | | |-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: a
| | | | | |-- ADD: +
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- number
| | | | | `-- FloatConst: 0.1
| | | | `-- SEMI: ;
| | | |-- blockItem
| | | | `-- stmt
| | | | |-- lVal
| | | | | `-- Ident: b
| | | | |-- ASSIGN: =
| | | | |-- exp
| | | | | `-- addExp
| | | | | |-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: b
| | | | | |-- ADD: +
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- number
| | | | | `-- FloatConst: 0.2
| | | | `-- SEMI: ;
| | | `-- RBRACE: }
| | |-- blockItem
| | | `-- stmt
| | | |-- WHILE: while
| | | |-- LPAREN: (
| | | |-- cond
| | | | `-- lOrExp
| | | | `-- lAndExp
| | | | `-- eqExp
| | | | `-- relExp
| | | | |-- relExp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: j
| | | | |-- LT: <
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- lVal
| | | | `-- Ident: len
| | | |-- RPAREN: )
| | | `-- stmt
| | | `-- block
| | | |-- LBRACE: {
| | | |-- blockItem
| | | | `-- stmt
| | | | |-- lVal
| | | | | |-- Ident: x
| | | | | |-- LBRACK: [
| | | | | |-- exp
| | | | | | `-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: j
| | | | | `-- RBRACK: ]
| | | | |-- ASSIGN: =
| | | | |-- exp
| | | | | `-- addExp
| | | | | |-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: a
| | | | | |-- ADD: +
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: j
| | | | `-- SEMI: ;
| | | |-- blockItem
| | | | `-- stmt
| | | | |-- lVal
| | | | | |-- Ident: y
| | | | | |-- LBRACK: [
| | | | | |-- exp
| | | | | | `-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: j
| | | | | `-- RBRACK: ]
| | | | |-- ASSIGN: =
| | | | |-- exp
| | | | | `-- addExp
| | | | | |-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: b
| | | | | |-- ADD: +
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: j
| | | | `-- SEMI: ;
| | | |-- blockItem
| | | | `-- stmt
| | | | |-- lVal
| | | | | `-- Ident: j
| | | | |-- ASSIGN: =
| | | | |-- exp
| | | | | `-- addExp
| | | | | |-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: j
| | | | | |-- ADD: +
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- number
| | | | | `-- IntConst: 1
| | | | `-- SEMI: ;
| | | `-- RBRACE: }
| | |-- blockItem
| | | `-- stmt
| | | |-- lVal
| | | | `-- Ident: total
| | | |-- ASSIGN: =
| | | |-- exp
| | | | `-- addExp
| | | | |-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: total
| | | | |-- ADD: +
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | |-- Ident: loop
| | | | |-- LPAREN: (
| | | | |-- funcRParams
| | | | | |-- exp
| | | | | | `-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: x
| | | | | |-- COMMA: ,
| | | | | |-- exp
| | | | | | `-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: y
| | | | | |-- COMMA: ,
| | | | | `-- exp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: len
| | | | `-- RPAREN: )
| | | `-- SEMI: ;
| | |-- blockItem
| | | `-- stmt
| | | |-- lVal
| | | | `-- Ident: i
| | | |-- ASSIGN: =
| | | |-- exp
| | | | `-- addExp
| | | | |-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: i
| | | | |-- ADD: +
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 1
| | | `-- SEMI: ;
| | `-- RBRACE: }
| |-- blockItem
| | `-- stmt
| | |-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | |-- Ident: stoptime
| | | |-- LPAREN: (
| | | `-- RPAREN: )
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- IF: if
| | |-- LPAREN: (
| | |-- cond
| | | `-- lOrExp
| | | |-- lOrExp
| | | | `-- lAndExp
| | | | `-- eqExp
| | | | `-- relExp
| | | | |-- relExp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | |-- LPAREN: (
| | | | | |-- exp
| | | | | | `-- addExp
| | | | | | |-- addExp
| | | | | | | `-- mulExp
| | | | | | | `-- unaryExp
| | | | | | | `-- primaryExp
| | | | | | | `-- lVal
| | | | | | | `-- Ident: total
| | | | | | |-- SUB: -
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- number
| | | | | | `-- FloatConst: 11442437121638400.000000
| | | | | `-- RPAREN: )
| | | | |-- LE: <=
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- FloatConst: 0.000001
| | | |-- OR: ||
| | | `-- lAndExp
| | | `-- eqExp
| | | `-- relExp
| | | |-- relExp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | |-- LPAREN: (
| | | | |-- exp
| | | | | `-- addExp
| | | | | |-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: total
| | | | | |-- SUB: -
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- number
| | | | | `-- FloatConst: 11442437121638400.000000
| | | | `-- RPAREN: )
| | | |-- GE: >=
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | |-- unaryOp
| | | | `-- SUB: -
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- FloatConst: 0.000001
| | |-- RPAREN: )
| | |-- stmt
| | | `-- block
| | | |-- LBRACE: {
| | | |-- blockItem
| | | | `-- stmt
| | | | |-- exp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | |-- Ident: putint
| | | | | |-- LPAREN: (
| | | | | |-- funcRParams
| | | | | | `-- exp
| | | | | | `-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- number
| | | | | | `-- IntConst: 0
| | | | | `-- RPAREN: )
| | | | `-- SEMI: ;
| | | |-- blockItem
| | | | `-- stmt
| | | | |-- RETURN: return
| | | | |-- exp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- number
| | | | | `-- IntConst: 0
| | | | `-- SEMI: ;
| | | `-- RBRACE: }
| | |-- ELSE: else
| | `-- stmt
| | `-- block
| | |-- LBRACE: {
| | |-- blockItem
| | | `-- stmt
| | | |-- exp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | |-- Ident: putint
| | | | |-- LPAREN: (
| | | | |-- funcRParams
| | | | | `-- exp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- number
| | | | | `-- IntConst: 1
| | | | `-- RPAREN: )
| | | `-- SEMI: ;
| | |-- blockItem
| | | `-- stmt
| | | |-- RETURN: return
| | | |-- exp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 1
| | | `-- SEMI: ;
| | `-- RBRACE: }
| `-- RBRACE: }
`-- EOF: <EOF>

@ -0,0 +1,63 @@
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>

@ -0,0 +1,890 @@
compUnit
|-- decl
| `-- varDecl
| |-- bType
| | `-- INT: int
| |-- varDef
| | |-- Ident: matrix
| | |-- LBRACK: [
| | |-- constExp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- IntConst: 20000000
| | `-- RBRACK: ]
| `-- SEMI: ;
|-- decl
| `-- varDecl
| |-- bType
| | `-- INT: int
| |-- varDef
| | |-- Ident: a
| | |-- LBRACK: [
| | |-- constExp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- IntConst: 100000
| | `-- RBRACK: ]
| `-- SEMI: ;
|-- funcDef
| |-- funcType
| | `-- INT: int
| |-- Ident: transpose
| |-- LPAREN: (
| |-- funcFParams
| | |-- funcFParam
| | | |-- bType
| | | | `-- INT: int
| | | `-- Ident: n
| | |-- COMMA: ,
| | |-- funcFParam
| | | |-- bType
| | | | `-- INT: int
| | | |-- Ident: matrix
| | | |-- LBRACK: [
| | | `-- RBRACK: ]
| | |-- COMMA: ,
| | `-- funcFParam
| | |-- bType
| | | `-- INT: int
| | `-- Ident: rowsize
| |-- RPAREN: )
| `-- block
| |-- LBRACE: {
| |-- blockItem
| | `-- decl
| | `-- varDecl
| | |-- bType
| | | `-- INT: int
| | |-- varDef
| | | |-- Ident: colsize
| | | |-- ASSIGN: =
| | | `-- initVal
| | | `-- exp
| | | `-- addExp
| | | `-- mulExp
| | | |-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- lVal
| | | | `-- Ident: n
| | | |-- DIV: /
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- lVal
| | | `-- Ident: rowsize
| | `-- SEMI: ;
| |-- blockItem
| | `-- decl
| | `-- varDecl
| | |-- bType
| | | `-- INT: int
| | |-- varDef
| | | |-- Ident: i
| | | |-- ASSIGN: =
| | | `-- initVal
| | | `-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- IntConst: 0
| | `-- SEMI: ;
| |-- blockItem
| | `-- decl
| | `-- varDecl
| | |-- bType
| | | `-- INT: int
| | |-- varDef
| | | |-- Ident: j
| | | |-- ASSIGN: =
| | | `-- initVal
| | | `-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- IntConst: 0
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- WHILE: while
| | |-- LPAREN: (
| | |-- cond
| | | `-- lOrExp
| | | `-- lAndExp
| | | `-- eqExp
| | | `-- relExp
| | | |-- relExp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- lVal
| | | | `-- Ident: i
| | | |-- LT: <
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- lVal
| | | `-- Ident: colsize
| | |-- RPAREN: )
| | `-- stmt
| | `-- block
| | |-- LBRACE: {
| | |-- blockItem
| | | `-- stmt
| | | |-- lVal
| | | | `-- Ident: j
| | | |-- ASSIGN: =
| | | |-- exp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 0
| | | `-- SEMI: ;
| | |-- blockItem
| | | `-- stmt
| | | |-- WHILE: while
| | | |-- LPAREN: (
| | | |-- cond
| | | | `-- lOrExp
| | | | `-- lAndExp
| | | | `-- eqExp
| | | | `-- relExp
| | | | |-- relExp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: j
| | | | |-- LT: <
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- lVal
| | | | `-- Ident: rowsize
| | | |-- RPAREN: )
| | | `-- stmt
| | | `-- block
| | | |-- LBRACE: {
| | | |-- blockItem
| | | | `-- stmt
| | | | |-- IF: if
| | | | |-- LPAREN: (
| | | | |-- cond
| | | | | `-- lOrExp
| | | | | `-- lAndExp
| | | | | `-- eqExp
| | | | | `-- relExp
| | | | | |-- relExp
| | | | | | `-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: i
| | | | | |-- LT: <
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: j
| | | | |-- RPAREN: )
| | | | `-- stmt
| | | | `-- block
| | | | |-- LBRACE: {
| | | | |-- blockItem
| | | | | `-- stmt
| | | | | |-- lVal
| | | | | | `-- Ident: j
| | | | | |-- ASSIGN: =
| | | | | |-- exp
| | | | | | `-- addExp
| | | | | | |-- addExp
| | | | | | | `-- mulExp
| | | | | | | `-- unaryExp
| | | | | | | `-- primaryExp
| | | | | | | `-- lVal
| | | | | | | `-- Ident: j
| | | | | | |-- ADD: +
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- number
| | | | | | `-- IntConst: 1
| | | | | `-- SEMI: ;
| | | | |-- blockItem
| | | | | `-- stmt
| | | | | |-- CONTINUE: continue
| | | | | `-- SEMI: ;
| | | | `-- RBRACE: }
| | | |-- blockItem
| | | | `-- decl
| | | | `-- varDecl
| | | | |-- bType
| | | | | `-- INT: int
| | | | |-- varDef
| | | | | |-- Ident: curr
| | | | | |-- ASSIGN: =
| | | | | `-- initVal
| | | | | `-- exp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | |-- Ident: matrix
| | | | | |-- LBRACK: [
| | | | | |-- exp
| | | | | | `-- addExp
| | | | | | |-- addExp
| | | | | | | `-- mulExp
| | | | | | | |-- mulExp
| | | | | | | | `-- unaryExp
| | | | | | | | `-- primaryExp
| | | | | | | | `-- lVal
| | | | | | | | `-- Ident: i
| | | | | | | |-- MUL: *
| | | | | | | `-- unaryExp
| | | | | | | `-- primaryExp
| | | | | | | `-- lVal
| | | | | | | `-- Ident: rowsize
| | | | | | |-- ADD: +
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: j
| | | | | `-- RBRACK: ]
| | | | `-- SEMI: ;
| | | |-- blockItem
| | | | `-- stmt
| | | | |-- lVal
| | | | | |-- Ident: matrix
| | | | | |-- LBRACK: [
| | | | | |-- exp
| | | | | | `-- addExp
| | | | | | |-- addExp
| | | | | | | `-- mulExp
| | | | | | | |-- mulExp
| | | | | | | | `-- unaryExp
| | | | | | | | `-- primaryExp
| | | | | | | | `-- lVal
| | | | | | | | `-- Ident: j
| | | | | | | |-- MUL: *
| | | | | | | `-- unaryExp
| | | | | | | `-- primaryExp
| | | | | | | `-- lVal
| | | | | | | `-- Ident: colsize
| | | | | | |-- ADD: +
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: i
| | | | | `-- RBRACK: ]
| | | | |-- ASSIGN: =
| | | | |-- exp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | |-- Ident: matrix
| | | | | |-- LBRACK: [
| | | | | |-- exp
| | | | | | `-- addExp
| | | | | | |-- addExp
| | | | | | | `-- mulExp
| | | | | | | |-- mulExp
| | | | | | | | `-- unaryExp
| | | | | | | | `-- primaryExp
| | | | | | | | `-- lVal
| | | | | | | | `-- Ident: i
| | | | | | | |-- MUL: *
| | | | | | | `-- unaryExp
| | | | | | | `-- primaryExp
| | | | | | | `-- lVal
| | | | | | | `-- Ident: rowsize
| | | | | | |-- ADD: +
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: j
| | | | | `-- RBRACK: ]
| | | | `-- SEMI: ;
| | | |-- blockItem
| | | | `-- stmt
| | | | |-- lVal
| | | | | |-- Ident: matrix
| | | | | |-- LBRACK: [
| | | | | |-- exp
| | | | | | `-- addExp
| | | | | | |-- addExp
| | | | | | | `-- mulExp
| | | | | | | |-- mulExp
| | | | | | | | `-- unaryExp
| | | | | | | | `-- primaryExp
| | | | | | | | `-- lVal
| | | | | | | | `-- Ident: i
| | | | | | | |-- MUL: *
| | | | | | | `-- unaryExp
| | | | | | | `-- primaryExp
| | | | | | | `-- lVal
| | | | | | | `-- Ident: rowsize
| | | | | | |-- ADD: +
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: j
| | | | | `-- RBRACK: ]
| | | | |-- ASSIGN: =
| | | | |-- exp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: curr
| | | | `-- SEMI: ;
| | | |-- blockItem
| | | | `-- stmt
| | | | |-- lVal
| | | | | `-- Ident: j
| | | | |-- ASSIGN: =
| | | | |-- exp
| | | | | `-- addExp
| | | | | |-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: j
| | | | | |-- ADD: +
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- number
| | | | | `-- IntConst: 1
| | | | `-- SEMI: ;
| | | `-- RBRACE: }
| | |-- blockItem
| | | `-- stmt
| | | |-- lVal
| | | | `-- Ident: i
| | | |-- ASSIGN: =
| | | |-- exp
| | | | `-- addExp
| | | | |-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: i
| | | | |-- ADD: +
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 1
| | | `-- SEMI: ;
| | `-- RBRACE: }
| |-- blockItem
| | `-- stmt
| | |-- RETURN: return
| | |-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | |-- unaryOp
| | | | `-- SUB: -
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- IntConst: 1
| | `-- SEMI: ;
| `-- RBRACE: }
|-- funcDef
| |-- funcType
| | `-- INT: int
| |-- Ident: main
| |-- LPAREN: (
| |-- RPAREN: )
| `-- block
| |-- LBRACE: {
| |-- blockItem
| | `-- decl
| | `-- varDecl
| | |-- bType
| | | `-- INT: int
| | |-- varDef
| | | |-- Ident: n
| | | |-- ASSIGN: =
| | | `-- initVal
| | | `-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | |-- Ident: getint
| | | |-- LPAREN: (
| | | `-- RPAREN: )
| | `-- SEMI: ;
| |-- blockItem
| | `-- decl
| | `-- varDecl
| | |-- bType
| | | `-- INT: int
| | |-- varDef
| | | |-- Ident: len
| | | |-- ASSIGN: =
| | | `-- initVal
| | | `-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | |-- Ident: getarray
| | | |-- LPAREN: (
| | | |-- funcRParams
| | | | `-- exp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- lVal
| | | | `-- Ident: a
| | | `-- RPAREN: )
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | |-- Ident: starttime
| | | |-- LPAREN: (
| | | `-- RPAREN: )
| | `-- SEMI: ;
| |-- blockItem
| | `-- decl
| | `-- varDecl
| | |-- bType
| | | `-- INT: int
| | |-- varDef
| | | |-- Ident: i
| | | |-- ASSIGN: =
| | | `-- initVal
| | | `-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- IntConst: 0
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- WHILE: while
| | |-- LPAREN: (
| | |-- cond
| | | `-- lOrExp
| | | `-- lAndExp
| | | `-- eqExp
| | | `-- relExp
| | | |-- relExp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- lVal
| | | | `-- Ident: i
| | | |-- LT: <
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- lVal
| | | `-- Ident: n
| | |-- RPAREN: )
| | `-- stmt
| | `-- block
| | |-- LBRACE: {
| | |-- blockItem
| | | `-- stmt
| | | |-- lVal
| | | | |-- Ident: matrix
| | | | |-- LBRACK: [
| | | | |-- exp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: i
| | | | `-- RBRACK: ]
| | | |-- ASSIGN: =
| | | |-- exp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- lVal
| | | | `-- Ident: i
| | | `-- SEMI: ;
| | |-- blockItem
| | | `-- stmt
| | | |-- lVal
| | | | `-- Ident: i
| | | |-- ASSIGN: =
| | | |-- exp
| | | | `-- addExp
| | | | |-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: i
| | | | |-- ADD: +
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 1
| | | `-- SEMI: ;
| | `-- RBRACE: }
| |-- blockItem
| | `-- stmt
| | |-- lVal
| | | `-- Ident: i
| | |-- ASSIGN: =
| | |-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- IntConst: 0
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- WHILE: while
| | |-- LPAREN: (
| | |-- cond
| | | `-- lOrExp
| | | `-- lAndExp
| | | `-- eqExp
| | | `-- relExp
| | | |-- relExp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- lVal
| | | | `-- Ident: i
| | | |-- LT: <
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- lVal
| | | `-- Ident: len
| | |-- RPAREN: )
| | `-- stmt
| | `-- block
| | |-- LBRACE: {
| | |-- blockItem
| | | `-- stmt
| | | |-- exp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | |-- Ident: transpose
| | | | |-- LPAREN: (
| | | | |-- funcRParams
| | | | | |-- exp
| | | | | | `-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: n
| | | | | |-- COMMA: ,
| | | | | |-- exp
| | | | | | `-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: matrix
| | | | | |-- COMMA: ,
| | | | | `-- exp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | |-- Ident: a
| | | | | |-- LBRACK: [
| | | | | |-- exp
| | | | | | `-- addExp
| | | | | | `-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: i
| | | | | `-- RBRACK: ]
| | | | `-- RPAREN: )
| | | `-- SEMI: ;
| | |-- blockItem
| | | `-- stmt
| | | |-- lVal
| | | | `-- Ident: i
| | | |-- ASSIGN: =
| | | |-- exp
| | | | `-- addExp
| | | | |-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: i
| | | | |-- ADD: +
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 1
| | | `-- SEMI: ;
| | `-- RBRACE: }
| |-- blockItem
| | `-- decl
| | `-- varDecl
| | |-- bType
| | | `-- INT: int
| | |-- varDef
| | | |-- Ident: ans
| | | |-- ASSIGN: =
| | | `-- initVal
| | | `-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- IntConst: 0
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- lVal
| | | `-- Ident: i
| | |-- ASSIGN: =
| | |-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- IntConst: 0
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- WHILE: while
| | |-- LPAREN: (
| | |-- cond
| | | `-- lOrExp
| | | `-- lAndExp
| | | `-- eqExp
| | | `-- relExp
| | | |-- relExp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- lVal
| | | | `-- Ident: i
| | | |-- LT: <
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- lVal
| | | `-- Ident: len
| | |-- RPAREN: )
| | `-- stmt
| | `-- block
| | |-- LBRACE: {
| | |-- blockItem
| | | `-- stmt
| | | |-- lVal
| | | | `-- Ident: ans
| | | |-- ASSIGN: =
| | | |-- exp
| | | | `-- addExp
| | | | |-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: ans
| | | | |-- ADD: +
| | | | `-- mulExp
| | | | |-- mulExp
| | | | | |-- mulExp
| | | | | | `-- unaryExp
| | | | | | `-- primaryExp
| | | | | | `-- lVal
| | | | | | `-- Ident: i
| | | | | |-- MUL: *
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: i
| | | | |-- MUL: *
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- lVal
| | | | |-- Ident: matrix
| | | | |-- LBRACK: [
| | | | |-- exp
| | | | | `-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: i
| | | | `-- RBRACK: ]
| | | `-- SEMI: ;
| | |-- blockItem
| | | `-- stmt
| | | |-- lVal
| | | | `-- Ident: i
| | | |-- ASSIGN: =
| | | |-- exp
| | | | `-- addExp
| | | | |-- addExp
| | | | | `-- mulExp
| | | | | `-- unaryExp
| | | | | `-- primaryExp
| | | | | `-- lVal
| | | | | `-- Ident: i
| | | | |-- ADD: +
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 1
| | | `-- SEMI: ;
| | `-- RBRACE: }
| |-- blockItem
| | `-- stmt
| | |-- IF: if
| | |-- LPAREN: (
| | |-- cond
| | | `-- lOrExp
| | | `-- lAndExp
| | | `-- eqExp
| | | `-- relExp
| | | |-- relExp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- lVal
| | | | `-- Ident: ans
| | | |-- LT: <
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- IntConst: 0
| | |-- RPAREN: )
| | `-- stmt
| | |-- lVal
| | | `-- Ident: ans
| | |-- ASSIGN: =
| | |-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | |-- unaryOp
| | | | `-- SUB: -
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- lVal
| | | `-- Ident: ans
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | |-- Ident: stoptime
| | | |-- LPAREN: (
| | | `-- RPAREN: )
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | |-- Ident: putint
| | | |-- LPAREN: (
| | | |-- funcRParams
| | | | `-- exp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- lVal
| | | | `-- Ident: ans
| | | `-- RPAREN: )
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | |-- Ident: putch
| | | |-- LPAREN: (
| | | |-- funcRParams
| | | | `-- exp
| | | | `-- addExp
| | | | `-- mulExp
| | | | `-- unaryExp
| | | | `-- primaryExp
| | | | `-- number
| | | | `-- IntConst: 10
| | | `-- RPAREN: )
| | `-- SEMI: ;
| |-- blockItem
| | `-- stmt
| | |-- RETURN: return
| | |-- exp
| | | `-- addExp
| | | `-- mulExp
| | | `-- unaryExp
| | | `-- primaryExp
| | | `-- number
| | | `-- IntConst: 0
| | `-- SEMI: ;
| `-- RBRACE: }
`-- EOF: <EOF>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -108,10 +108,9 @@ for TEST_DIR in "${TEST_DIRS[@]}"; do
((FAIL++)) || true
fi
else
# 只检查返回码,不输出语法树
if "$COMPILER" --emit-parse-tree "$sy_file" > /dev/null 2>&1; then
echo -e " ${GREEN}PASS${NC} $rel"
((PASS++)) || true
if "$COMPILER" --emit-parse-tree "$sy_file" > "./output/lab1/$(basename "$sy_file" .sy).tree" 2>&1; then
echo -e " ${GREEN}PASS${NC} $rel"
((PASS++)) || true
else
echo -e " ${RED}FAIL${NC} $rel"
FAIL_LIST+=("$rel")

@ -1,4 +1,4 @@
// Generated from //wsl.localhost/Ubuntu/home/hw/nudt-compiler-cpp/src/antlr4/SysY.g4 by ANTLR 4.13.1
// Generated from /root/sysy2026/nudt-compiler-cpp/src/antlr4/SysY.g4 by ANTLR 4.13.1
import org.antlr.v4.runtime.ParserRuleContext;
import org.antlr.v4.runtime.tree.ErrorNode;
@ -40,13 +40,61 @@ public class SysYBaseListener implements SysYListener {
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterBtype(SysYParser.BtypeContext ctx) { }
@Override public void enterConstDecl(SysYParser.ConstDeclContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitBtype(SysYParser.BtypeContext ctx) { }
@Override public void exitConstDecl(SysYParser.ConstDeclContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterBType(SysYParser.BTypeContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitBType(SysYParser.BTypeContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterConstDef(SysYParser.ConstDefContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitConstDef(SysYParser.ConstDefContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterConstInitVal(SysYParser.ConstInitValContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitConstInitVal(SysYParser.ConstInitValContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterVarDecl(SysYParser.VarDeclContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitVarDecl(SysYParser.VarDeclContext ctx) { }
/**
* {@inheritDoc}
*
@ -64,13 +112,13 @@ public class SysYBaseListener implements SysYListener {
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterInitValue(SysYParser.InitValueContext ctx) { }
@Override public void enterInitVal(SysYParser.InitValContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitInitValue(SysYParser.InitValueContext ctx) { }
@Override public void exitInitVal(SysYParser.InitValContext ctx) { }
/**
* {@inheritDoc}
*
@ -100,13 +148,37 @@ public class SysYBaseListener implements SysYListener {
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterBlockStmt(SysYParser.BlockStmtContext ctx) { }
@Override public void enterFuncFParams(SysYParser.FuncFParamsContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitBlockStmt(SysYParser.BlockStmtContext ctx) { }
@Override public void exitFuncFParams(SysYParser.FuncFParamsContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterFuncFParam(SysYParser.FuncFParamContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitFuncFParam(SysYParser.FuncFParamContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterBlock(SysYParser.BlockContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitBlock(SysYParser.BlockContext ctx) { }
/**
* {@inheritDoc}
*
@ -124,97 +196,145 @@ public class SysYBaseListener implements SysYListener {
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterStmt(SysYParser.StmtContext ctx) { }
@Override public void enterAssignStmt(SysYParser.AssignStmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitStmt(SysYParser.StmtContext ctx) { }
@Override public void exitAssignStmt(SysYParser.AssignStmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterReturnStmt(SysYParser.ReturnStmtContext ctx) { }
@Override public void enterExpStmt(SysYParser.ExpStmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitReturnStmt(SysYParser.ReturnStmtContext ctx) { }
@Override public void exitExpStmt(SysYParser.ExpStmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterBlockStmt(SysYParser.BlockStmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitBlockStmt(SysYParser.BlockStmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterIfStmt(SysYParser.IfStmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitIfStmt(SysYParser.IfStmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterWhileStmt(SysYParser.WhileStmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitWhileStmt(SysYParser.WhileStmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterBreakStmt(SysYParser.BreakStmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterVarExp(SysYParser.VarExpContext ctx) { }
@Override public void exitBreakStmt(SysYParser.BreakStmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitVarExp(SysYParser.VarExpContext ctx) { }
@Override public void enterContinueStmt(SysYParser.ContinueStmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterNumberExp(SysYParser.NumberExpContext ctx) { }
@Override public void exitContinueStmt(SysYParser.ContinueStmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitNumberExp(SysYParser.NumberExpContext ctx) { }
@Override public void enterReturnStmt(SysYParser.ReturnStmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitReturnStmt(SysYParser.ReturnStmtContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterParenExp(SysYParser.ParenExpContext ctx) { }
@Override public void enterExp(SysYParser.ExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitParenExp(SysYParser.ParenExpContext ctx) { }
@Override public void exitExp(SysYParser.ExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterAdditiveExp(SysYParser.AdditiveExpContext ctx) { }
@Override public void enterCond(SysYParser.CondContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitAdditiveExp(SysYParser.AdditiveExpContext ctx) { }
@Override public void exitCond(SysYParser.CondContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterVar(SysYParser.VarContext ctx) { }
@Override public void enterLVal(SysYParser.LValContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitVar(SysYParser.VarContext ctx) { }
@Override public void exitLVal(SysYParser.LValContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterLValue(SysYParser.LValueContext ctx) { }
@Override public void enterPrimaryExp(SysYParser.PrimaryExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitLValue(SysYParser.LValueContext ctx) { }
@Override public void exitPrimaryExp(SysYParser.PrimaryExpContext ctx) { }
/**
* {@inheritDoc}
*
@ -227,6 +347,222 @@ public class SysYBaseListener implements SysYListener {
* <p>The default implementation does nothing.</p>
*/
@Override public void exitNumber(SysYParser.NumberContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterPrimaryUnaryExp(SysYParser.PrimaryUnaryExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitPrimaryUnaryExp(SysYParser.PrimaryUnaryExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterCallUnaryExp(SysYParser.CallUnaryExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitCallUnaryExp(SysYParser.CallUnaryExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterOpUnaryExp(SysYParser.OpUnaryExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitOpUnaryExp(SysYParser.OpUnaryExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterUnaryOp(SysYParser.UnaryOpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitUnaryOp(SysYParser.UnaryOpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterFuncRParams(SysYParser.FuncRParamsContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitFuncRParams(SysYParser.FuncRParamsContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterBinaryMulExp(SysYParser.BinaryMulExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitBinaryMulExp(SysYParser.BinaryMulExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterUnaryMulExp(SysYParser.UnaryMulExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitUnaryMulExp(SysYParser.UnaryMulExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterBinaryAddExp(SysYParser.BinaryAddExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitBinaryAddExp(SysYParser.BinaryAddExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterMulAddExp(SysYParser.MulAddExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitMulAddExp(SysYParser.MulAddExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterAddRelExp(SysYParser.AddRelExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitAddRelExp(SysYParser.AddRelExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterBinaryRelExp(SysYParser.BinaryRelExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitBinaryRelExp(SysYParser.BinaryRelExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterBinaryEqExp(SysYParser.BinaryEqExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitBinaryEqExp(SysYParser.BinaryEqExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterRelEqExp(SysYParser.RelEqExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitRelEqExp(SysYParser.RelEqExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterEqLAndExp(SysYParser.EqLAndExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitEqLAndExp(SysYParser.EqLAndExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterBinaryLAndExp(SysYParser.BinaryLAndExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitBinaryLAndExp(SysYParser.BinaryLAndExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterAndLOrExp(SysYParser.AndLOrExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitAndLOrExp(SysYParser.AndLOrExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterBinaryLOrExp(SysYParser.BinaryLOrExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitBinaryLOrExp(SysYParser.BinaryLOrExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterConstExp(SysYParser.ConstExpContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitConstExp(SysYParser.ConstExpContext ctx) { }
/**
* {@inheritDoc}

@ -1,4 +1,4 @@
// Generated from //wsl.localhost/Ubuntu/home/hw/nudt-compiler-cpp/src/antlr4/SysY.g4 by ANTLR 4.13.1
// Generated from /root/sysy2026/nudt-compiler-cpp/src/antlr4/SysY.g4 by ANTLR 4.13.1
import org.antlr.v4.runtime.Lexer;
import org.antlr.v4.runtime.CharStream;
import org.antlr.v4.runtime.Token;

@ -1,4 +1,4 @@
// Generated from //wsl.localhost/Ubuntu/home/hw/nudt-compiler-cpp/src/antlr4/SysY.g4 by ANTLR 4.13.1
// Generated from /root/sysy2026/nudt-compiler-cpp/src/antlr4/SysY.g4 by ANTLR 4.13.1
import org.antlr.v4.runtime.tree.ParseTreeListener;
/**
@ -27,15 +27,55 @@ public interface SysYListener extends ParseTreeListener {
*/
void exitDecl(SysYParser.DeclContext ctx);
/**
* Enter a parse tree produced by {@link SysYParser#btype}.
* Enter a parse tree produced by {@link SysYParser#constDecl}.
* @param ctx the parse tree
*/
void enterBtype(SysYParser.BtypeContext ctx);
void enterConstDecl(SysYParser.ConstDeclContext ctx);
/**
* Exit a parse tree produced by {@link SysYParser#btype}.
* Exit a parse tree produced by {@link SysYParser#constDecl}.
* @param ctx the parse tree
*/
void exitBtype(SysYParser.BtypeContext ctx);
void exitConstDecl(SysYParser.ConstDeclContext ctx);
/**
* Enter a parse tree produced by {@link SysYParser#bType}.
* @param ctx the parse tree
*/
void enterBType(SysYParser.BTypeContext ctx);
/**
* Exit a parse tree produced by {@link SysYParser#bType}.
* @param ctx the parse tree
*/
void exitBType(SysYParser.BTypeContext ctx);
/**
* Enter a parse tree produced by {@link SysYParser#constDef}.
* @param ctx the parse tree
*/
void enterConstDef(SysYParser.ConstDefContext ctx);
/**
* Exit a parse tree produced by {@link SysYParser#constDef}.
* @param ctx the parse tree
*/
void exitConstDef(SysYParser.ConstDefContext ctx);
/**
* Enter a parse tree produced by {@link SysYParser#constInitVal}.
* @param ctx the parse tree
*/
void enterConstInitVal(SysYParser.ConstInitValContext ctx);
/**
* Exit a parse tree produced by {@link SysYParser#constInitVal}.
* @param ctx the parse tree
*/
void exitConstInitVal(SysYParser.ConstInitValContext ctx);
/**
* Enter a parse tree produced by {@link SysYParser#varDecl}.
* @param ctx the parse tree
*/
void enterVarDecl(SysYParser.VarDeclContext ctx);
/**
* Exit a parse tree produced by {@link SysYParser#varDecl}.
* @param ctx the parse tree
*/
void exitVarDecl(SysYParser.VarDeclContext ctx);
/**
* Enter a parse tree produced by {@link SysYParser#varDef}.
* @param ctx the parse tree
@ -47,15 +87,15 @@ public interface SysYListener extends ParseTreeListener {
*/
void exitVarDef(SysYParser.VarDefContext ctx);
/**
* Enter a parse tree produced by {@link SysYParser#initValue}.
* Enter a parse tree produced by {@link SysYParser#initVal}.
* @param ctx the parse tree
*/
void enterInitValue(SysYParser.InitValueContext ctx);
void enterInitVal(SysYParser.InitValContext ctx);
/**
* Exit a parse tree produced by {@link SysYParser#initValue}.
* Exit a parse tree produced by {@link SysYParser#initVal}.
* @param ctx the parse tree
*/
void exitInitValue(SysYParser.InitValueContext ctx);
void exitInitVal(SysYParser.InitValContext ctx);
/**
* Enter a parse tree produced by {@link SysYParser#funcDef}.
* @param ctx the parse tree
@ -77,15 +117,35 @@ public interface SysYListener extends ParseTreeListener {
*/
void exitFuncType(SysYParser.FuncTypeContext ctx);
/**
* Enter a parse tree produced by {@link SysYParser#blockStmt}.
* Enter a parse tree produced by {@link SysYParser#funcFParams}.
* @param ctx the parse tree
*/
void enterBlockStmt(SysYParser.BlockStmtContext ctx);
void enterFuncFParams(SysYParser.FuncFParamsContext ctx);
/**
* Exit a parse tree produced by {@link SysYParser#blockStmt}.
* Exit a parse tree produced by {@link SysYParser#funcFParams}.
* @param ctx the parse tree
*/
void exitBlockStmt(SysYParser.BlockStmtContext ctx);
void exitFuncFParams(SysYParser.FuncFParamsContext ctx);
/**
* Enter a parse tree produced by {@link SysYParser#funcFParam}.
* @param ctx the parse tree
*/
void enterFuncFParam(SysYParser.FuncFParamContext ctx);
/**
* Exit a parse tree produced by {@link SysYParser#funcFParam}.
* @param ctx the parse tree
*/
void exitFuncFParam(SysYParser.FuncFParamContext ctx);
/**
* Enter a parse tree produced by {@link SysYParser#block}.
* @param ctx the parse tree
*/
void enterBlock(SysYParser.BlockContext ctx);
/**
* Exit a parse tree produced by {@link SysYParser#block}.
* @param ctx the parse tree
*/
void exitBlock(SysYParser.BlockContext ctx);
/**
* Enter a parse tree produced by {@link SysYParser#blockItem}.
* @param ctx the parse tree
@ -97,93 +157,141 @@ public interface SysYListener extends ParseTreeListener {
*/
void exitBlockItem(SysYParser.BlockItemContext ctx);
/**
* Enter a parse tree produced by {@link SysYParser#stmt}.
* Enter a parse tree produced by the {@code assignStmt}
* labeled alternative in {@link SysYParser#stmt}.
* @param ctx the parse tree
*/
void enterStmt(SysYParser.StmtContext ctx);
void enterAssignStmt(SysYParser.AssignStmtContext ctx);
/**
* Exit a parse tree produced by {@link SysYParser#stmt}.
* Exit a parse tree produced by the {@code assignStmt}
* labeled alternative in {@link SysYParser#stmt}.
* @param ctx the parse tree
*/
void exitStmt(SysYParser.StmtContext ctx);
void exitAssignStmt(SysYParser.AssignStmtContext ctx);
/**
* Enter a parse tree produced by {@link SysYParser#returnStmt}.
* Enter a parse tree produced by the {@code expStmt}
* labeled alternative in {@link SysYParser#stmt}.
* @param ctx the parse tree
*/
void enterReturnStmt(SysYParser.ReturnStmtContext ctx);
void enterExpStmt(SysYParser.ExpStmtContext ctx);
/**
* Exit a parse tree produced by {@link SysYParser#returnStmt}.
* Exit a parse tree produced by the {@code expStmt}
* labeled alternative in {@link SysYParser#stmt}.
* @param ctx the parse tree
*/
void exitReturnStmt(SysYParser.ReturnStmtContext ctx);
void exitExpStmt(SysYParser.ExpStmtContext ctx);
/**
* Enter a parse tree produced by the {@code blockStmt}
* labeled alternative in {@link SysYParser#stmt}.
* @param ctx the parse tree
*/
void enterBlockStmt(SysYParser.BlockStmtContext ctx);
/**
* Enter a parse tree produced by the {@code varExp}
* labeled alternative in {@link SysYParser#exp}.
* Exit a parse tree produced by the {@code blockStmt}
* labeled alternative in {@link SysYParser#stmt}.
* @param ctx the parse tree
*/
void enterVarExp(SysYParser.VarExpContext ctx);
void exitBlockStmt(SysYParser.BlockStmtContext ctx);
/**
* Enter a parse tree produced by the {@code ifStmt}
* labeled alternative in {@link SysYParser#stmt}.
* @param ctx the parse tree
*/
void enterIfStmt(SysYParser.IfStmtContext ctx);
/**
* Exit a parse tree produced by the {@code ifStmt}
* labeled alternative in {@link SysYParser#stmt}.
* @param ctx the parse tree
*/
void exitIfStmt(SysYParser.IfStmtContext ctx);
/**
* Enter a parse tree produced by the {@code whileStmt}
* labeled alternative in {@link SysYParser#stmt}.
* @param ctx the parse tree
*/
void enterWhileStmt(SysYParser.WhileStmtContext ctx);
/**
* Exit a parse tree produced by the {@code whileStmt}
* labeled alternative in {@link SysYParser#stmt}.
* @param ctx the parse tree
*/
void exitWhileStmt(SysYParser.WhileStmtContext ctx);
/**
* Enter a parse tree produced by the {@code breakStmt}
* labeled alternative in {@link SysYParser#stmt}.
* @param ctx the parse tree
*/
void enterBreakStmt(SysYParser.BreakStmtContext ctx);
/**
* Exit a parse tree produced by the {@code breakStmt}
* labeled alternative in {@link SysYParser#stmt}.
* @param ctx the parse tree
*/
void exitBreakStmt(SysYParser.BreakStmtContext ctx);
/**
* Enter a parse tree produced by the {@code continueStmt}
* labeled alternative in {@link SysYParser#stmt}.
* @param ctx the parse tree
*/
void enterContinueStmt(SysYParser.ContinueStmtContext ctx);
/**
* Exit a parse tree produced by the {@code varExp}
* labeled alternative in {@link SysYParser#exp}.
* Exit a parse tree produced by the {@code continueStmt}
* labeled alternative in {@link SysYParser#stmt}.
* @param ctx the parse tree
*/
void exitVarExp(SysYParser.VarExpContext ctx);
void exitContinueStmt(SysYParser.ContinueStmtContext ctx);
/**
* Enter a parse tree produced by the {@code numberExp}
* labeled alternative in {@link SysYParser#exp}.
* Enter a parse tree produced by the {@code returnStmt}
* labeled alternative in {@link SysYParser#stmt}.
* @param ctx the parse tree
*/
void enterNumberExp(SysYParser.NumberExpContext ctx);
void enterReturnStmt(SysYParser.ReturnStmtContext ctx);
/**
* Exit a parse tree produced by the {@code numberExp}
* labeled alternative in {@link SysYParser#exp}.
* Exit a parse tree produced by the {@code returnStmt}
* labeled alternative in {@link SysYParser#stmt}.
* @param ctx the parse tree
*/
void exitNumberExp(SysYParser.NumberExpContext ctx);
void exitReturnStmt(SysYParser.ReturnStmtContext ctx);
/**
* Enter a parse tree produced by the {@code parenExp}
* labeled alternative in {@link SysYParser#exp}.
* Enter a parse tree produced by {@link SysYParser#exp}.
* @param ctx the parse tree
*/
void enterParenExp(SysYParser.ParenExpContext ctx);
void enterExp(SysYParser.ExpContext ctx);
/**
* Exit a parse tree produced by the {@code parenExp}
* labeled alternative in {@link SysYParser#exp}.
* Exit a parse tree produced by {@link SysYParser#exp}.
* @param ctx the parse tree
*/
void exitParenExp(SysYParser.ParenExpContext ctx);
void exitExp(SysYParser.ExpContext ctx);
/**
* Enter a parse tree produced by the {@code additiveExp}
* labeled alternative in {@link SysYParser#exp}.
* Enter a parse tree produced by {@link SysYParser#cond}.
* @param ctx the parse tree
*/
void enterAdditiveExp(SysYParser.AdditiveExpContext ctx);
void enterCond(SysYParser.CondContext ctx);
/**
* Exit a parse tree produced by the {@code additiveExp}
* labeled alternative in {@link SysYParser#exp}.
* Exit a parse tree produced by {@link SysYParser#cond}.
* @param ctx the parse tree
*/
void exitAdditiveExp(SysYParser.AdditiveExpContext ctx);
void exitCond(SysYParser.CondContext ctx);
/**
* Enter a parse tree produced by {@link SysYParser#var}.
* Enter a parse tree produced by {@link SysYParser#lVal}.
* @param ctx the parse tree
*/
void enterVar(SysYParser.VarContext ctx);
void enterLVal(SysYParser.LValContext ctx);
/**
* Exit a parse tree produced by {@link SysYParser#var}.
* Exit a parse tree produced by {@link SysYParser#lVal}.
* @param ctx the parse tree
*/
void exitVar(SysYParser.VarContext ctx);
void exitLVal(SysYParser.LValContext ctx);
/**
* Enter a parse tree produced by {@link SysYParser#lValue}.
* Enter a parse tree produced by {@link SysYParser#primaryExp}.
* @param ctx the parse tree
*/
void enterLValue(SysYParser.LValueContext ctx);
void enterPrimaryExp(SysYParser.PrimaryExpContext ctx);
/**
* Exit a parse tree produced by {@link SysYParser#lValue}.
* Exit a parse tree produced by {@link SysYParser#primaryExp}.
* @param ctx the parse tree
*/
void exitLValue(SysYParser.LValueContext ctx);
void exitPrimaryExp(SysYParser.PrimaryExpContext ctx);
/**
* Enter a parse tree produced by {@link SysYParser#number}.
* @param ctx the parse tree
@ -194,4 +302,214 @@ public interface SysYListener extends ParseTreeListener {
* @param ctx the parse tree
*/
void exitNumber(SysYParser.NumberContext ctx);
/**
* Enter a parse tree produced by the {@code primaryUnaryExp}
* labeled alternative in {@link SysYParser#unaryExp}.
* @param ctx the parse tree
*/
void enterPrimaryUnaryExp(SysYParser.PrimaryUnaryExpContext ctx);
/**
* Exit a parse tree produced by the {@code primaryUnaryExp}
* labeled alternative in {@link SysYParser#unaryExp}.
* @param ctx the parse tree
*/
void exitPrimaryUnaryExp(SysYParser.PrimaryUnaryExpContext ctx);
/**
* Enter a parse tree produced by the {@code callUnaryExp}
* labeled alternative in {@link SysYParser#unaryExp}.
* @param ctx the parse tree
*/
void enterCallUnaryExp(SysYParser.CallUnaryExpContext ctx);
/**
* Exit a parse tree produced by the {@code callUnaryExp}
* labeled alternative in {@link SysYParser#unaryExp}.
* @param ctx the parse tree
*/
void exitCallUnaryExp(SysYParser.CallUnaryExpContext ctx);
/**
* Enter a parse tree produced by the {@code opUnaryExp}
* labeled alternative in {@link SysYParser#unaryExp}.
* @param ctx the parse tree
*/
void enterOpUnaryExp(SysYParser.OpUnaryExpContext ctx);
/**
* Exit a parse tree produced by the {@code opUnaryExp}
* labeled alternative in {@link SysYParser#unaryExp}.
* @param ctx the parse tree
*/
void exitOpUnaryExp(SysYParser.OpUnaryExpContext ctx);
/**
* Enter a parse tree produced by {@link SysYParser#unaryOp}.
* @param ctx the parse tree
*/
void enterUnaryOp(SysYParser.UnaryOpContext ctx);
/**
* Exit a parse tree produced by {@link SysYParser#unaryOp}.
* @param ctx the parse tree
*/
void exitUnaryOp(SysYParser.UnaryOpContext ctx);
/**
* Enter a parse tree produced by {@link SysYParser#funcRParams}.
* @param ctx the parse tree
*/
void enterFuncRParams(SysYParser.FuncRParamsContext ctx);
/**
* Exit a parse tree produced by {@link SysYParser#funcRParams}.
* @param ctx the parse tree
*/
void exitFuncRParams(SysYParser.FuncRParamsContext ctx);
/**
* Enter a parse tree produced by the {@code binaryMulExp}
* labeled alternative in {@link SysYParser#mulExp}.
* @param ctx the parse tree
*/
void enterBinaryMulExp(SysYParser.BinaryMulExpContext ctx);
/**
* Exit a parse tree produced by the {@code binaryMulExp}
* labeled alternative in {@link SysYParser#mulExp}.
* @param ctx the parse tree
*/
void exitBinaryMulExp(SysYParser.BinaryMulExpContext ctx);
/**
* Enter a parse tree produced by the {@code unaryMulExp}
* labeled alternative in {@link SysYParser#mulExp}.
* @param ctx the parse tree
*/
void enterUnaryMulExp(SysYParser.UnaryMulExpContext ctx);
/**
* Exit a parse tree produced by the {@code unaryMulExp}
* labeled alternative in {@link SysYParser#mulExp}.
* @param ctx the parse tree
*/
void exitUnaryMulExp(SysYParser.UnaryMulExpContext ctx);
/**
* Enter a parse tree produced by the {@code binaryAddExp}
* labeled alternative in {@link SysYParser#addExp}.
* @param ctx the parse tree
*/
void enterBinaryAddExp(SysYParser.BinaryAddExpContext ctx);
/**
* Exit a parse tree produced by the {@code binaryAddExp}
* labeled alternative in {@link SysYParser#addExp}.
* @param ctx the parse tree
*/
void exitBinaryAddExp(SysYParser.BinaryAddExpContext ctx);
/**
* Enter a parse tree produced by the {@code mulAddExp}
* labeled alternative in {@link SysYParser#addExp}.
* @param ctx the parse tree
*/
void enterMulAddExp(SysYParser.MulAddExpContext ctx);
/**
* Exit a parse tree produced by the {@code mulAddExp}
* labeled alternative in {@link SysYParser#addExp}.
* @param ctx the parse tree
*/
void exitMulAddExp(SysYParser.MulAddExpContext ctx);
/**
* Enter a parse tree produced by the {@code addRelExp}
* labeled alternative in {@link SysYParser#relExp}.
* @param ctx the parse tree
*/
void enterAddRelExp(SysYParser.AddRelExpContext ctx);
/**
* Exit a parse tree produced by the {@code addRelExp}
* labeled alternative in {@link SysYParser#relExp}.
* @param ctx the parse tree
*/
void exitAddRelExp(SysYParser.AddRelExpContext ctx);
/**
* Enter a parse tree produced by the {@code binaryRelExp}
* labeled alternative in {@link SysYParser#relExp}.
* @param ctx the parse tree
*/
void enterBinaryRelExp(SysYParser.BinaryRelExpContext ctx);
/**
* Exit a parse tree produced by the {@code binaryRelExp}
* labeled alternative in {@link SysYParser#relExp}.
* @param ctx the parse tree
*/
void exitBinaryRelExp(SysYParser.BinaryRelExpContext ctx);
/**
* Enter a parse tree produced by the {@code binaryEqExp}
* labeled alternative in {@link SysYParser#eqExp}.
* @param ctx the parse tree
*/
void enterBinaryEqExp(SysYParser.BinaryEqExpContext ctx);
/**
* Exit a parse tree produced by the {@code binaryEqExp}
* labeled alternative in {@link SysYParser#eqExp}.
* @param ctx the parse tree
*/
void exitBinaryEqExp(SysYParser.BinaryEqExpContext ctx);
/**
* Enter a parse tree produced by the {@code relEqExp}
* labeled alternative in {@link SysYParser#eqExp}.
* @param ctx the parse tree
*/
void enterRelEqExp(SysYParser.RelEqExpContext ctx);
/**
* Exit a parse tree produced by the {@code relEqExp}
* labeled alternative in {@link SysYParser#eqExp}.
* @param ctx the parse tree
*/
void exitRelEqExp(SysYParser.RelEqExpContext ctx);
/**
* Enter a parse tree produced by the {@code eqLAndExp}
* labeled alternative in {@link SysYParser#lAndExp}.
* @param ctx the parse tree
*/
void enterEqLAndExp(SysYParser.EqLAndExpContext ctx);
/**
* Exit a parse tree produced by the {@code eqLAndExp}
* labeled alternative in {@link SysYParser#lAndExp}.
* @param ctx the parse tree
*/
void exitEqLAndExp(SysYParser.EqLAndExpContext ctx);
/**
* Enter a parse tree produced by the {@code binaryLAndExp}
* labeled alternative in {@link SysYParser#lAndExp}.
* @param ctx the parse tree
*/
void enterBinaryLAndExp(SysYParser.BinaryLAndExpContext ctx);
/**
* Exit a parse tree produced by the {@code binaryLAndExp}
* labeled alternative in {@link SysYParser#lAndExp}.
* @param ctx the parse tree
*/
void exitBinaryLAndExp(SysYParser.BinaryLAndExpContext ctx);
/**
* Enter a parse tree produced by the {@code andLOrExp}
* labeled alternative in {@link SysYParser#lOrExp}.
* @param ctx the parse tree
*/
void enterAndLOrExp(SysYParser.AndLOrExpContext ctx);
/**
* Exit a parse tree produced by the {@code andLOrExp}
* labeled alternative in {@link SysYParser#lOrExp}.
* @param ctx the parse tree
*/
void exitAndLOrExp(SysYParser.AndLOrExpContext ctx);
/**
* Enter a parse tree produced by the {@code binaryLOrExp}
* labeled alternative in {@link SysYParser#lOrExp}.
* @param ctx the parse tree
*/
void enterBinaryLOrExp(SysYParser.BinaryLOrExpContext ctx);
/**
* Exit a parse tree produced by the {@code binaryLOrExp}
* labeled alternative in {@link SysYParser#lOrExp}.
* @param ctx the parse tree
*/
void exitBinaryLOrExp(SysYParser.BinaryLOrExpContext ctx);
/**
* Enter a parse tree produced by {@link SysYParser#constExp}.
* @param ctx the parse tree
*/
void enterConstExp(SysYParser.ConstExpContext ctx);
/**
* Exit a parse tree produced by {@link SysYParser#constExp}.
* @param ctx the parse tree
*/
void exitConstExp(SysYParser.ConstExpContext ctx);
}

@ -1,4 +1,4 @@
// Generated from //wsl.localhost/Ubuntu/home/hw/nudt-compiler-cpp/src/antlr4/SysY.g4 by ANTLR 4.13.1
// Generated from /root/sysy2026/nudt-compiler-cpp/src/antlr4/SysY.g4 by ANTLR 4.13.1
import org.antlr.v4.runtime.atn.*;
import org.antlr.v4.runtime.dfa.DFA;
import org.antlr.v4.runtime.*;
@ -129,6 +129,14 @@ public class SysYParser extends Parser {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_compUnit; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterCompUnit(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitCompUnit(this);
}
}
public final CompUnitContext compUnit() throws RecognitionException {
@ -191,6 +199,14 @@ public class SysYParser extends Parser {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_decl; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterDecl(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitDecl(this);
}
}
public final DeclContext decl() throws RecognitionException {
@ -251,6 +267,14 @@ public class SysYParser extends Parser {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_constDecl; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterConstDecl(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitConstDecl(this);
}
}
public final ConstDeclContext constDecl() throws RecognitionException {
@ -305,6 +329,14 @@ public class SysYParser extends Parser {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_bType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterBType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitBType(this);
}
}
public final BTypeContext bType() throws RecognitionException {
@ -362,6 +394,14 @@ public class SysYParser extends Parser {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_constDef; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterConstDef(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitConstDef(this);
}
}
public final ConstDefContext constDef() throws RecognitionException {
@ -429,6 +469,14 @@ public class SysYParser extends Parser {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_constInitVal; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterConstInitVal(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitConstInitVal(this);
}
}
public final ConstInitValContext constInitVal() throws RecognitionException {
@ -522,6 +570,14 @@ public class SysYParser extends Parser {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_varDecl; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterVarDecl(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitVarDecl(this);
}
}
public final VarDeclContext varDecl() throws RecognitionException {
@ -591,6 +647,14 @@ public class SysYParser extends Parser {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_varDef; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterVarDef(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitVarDef(this);
}
}
public final VarDefContext varDef() throws RecognitionException {
@ -689,6 +753,14 @@ public class SysYParser extends Parser {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_initVal; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterInitVal(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitInitVal(this);
}
}
public final InitValContext initVal() throws RecognitionException {
@ -780,6 +852,14 @@ public class SysYParser extends Parser {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_funcDef; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterFuncDef(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitFuncDef(this);
}
}
public final FuncDefContext funcDef() throws RecognitionException {
@ -831,6 +911,14 @@ public class SysYParser extends Parser {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_funcType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterFuncType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitFuncType(this);
}
}
public final FuncTypeContext funcType() throws RecognitionException {
@ -879,6 +967,14 @@ public class SysYParser extends Parser {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_funcFParams; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterFuncFParams(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitFuncFParams(this);
}
}
public final FuncFParamsContext funcFParams() throws RecognitionException {
@ -943,6 +1039,14 @@ public class SysYParser extends Parser {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_funcFParam; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterFuncFParam(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitFuncFParam(this);
}
}
public final FuncFParamContext funcFParam() throws RecognitionException {
@ -1020,6 +1124,14 @@ public class SysYParser extends Parser {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_block; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterBlock(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitBlock(this);
}
}
public final BlockContext block() throws RecognitionException {
@ -1072,6 +1184,14 @@ public class SysYParser extends Parser {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_blockItem; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterBlockItem(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitBlockItem(this);
}
}
public final BlockItemContext blockItem() throws RecognitionException {
@ -1149,6 +1269,14 @@ public class SysYParser extends Parser {
return getRuleContext(StmtContext.class,0);
}
public WhileStmtContext(StmtContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterWhileStmt(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitWhileStmt(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class IfStmtContext extends StmtContext {
@ -1166,6 +1294,14 @@ public class SysYParser extends Parser {
}
public TerminalNode ELSE() { return getToken(SysYParser.ELSE, 0); }
public IfStmtContext(StmtContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterIfStmt(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitIfStmt(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class BlockStmtContext extends StmtContext {
@ -1173,6 +1309,14 @@ public class SysYParser extends Parser {
return getRuleContext(BlockContext.class,0);
}
public BlockStmtContext(StmtContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterBlockStmt(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitBlockStmt(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class AssignStmtContext extends StmtContext {
@ -1185,12 +1329,28 @@ public class SysYParser extends Parser {
}
public TerminalNode SEMI() { return getToken(SysYParser.SEMI, 0); }
public AssignStmtContext(StmtContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterAssignStmt(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitAssignStmt(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class BreakStmtContext extends StmtContext {
public TerminalNode BREAK() { return getToken(SysYParser.BREAK, 0); }
public TerminalNode SEMI() { return getToken(SysYParser.SEMI, 0); }
public BreakStmtContext(StmtContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterBreakStmt(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitBreakStmt(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class ExpStmtContext extends StmtContext {
@ -1199,6 +1359,14 @@ public class SysYParser extends Parser {
return getRuleContext(ExpContext.class,0);
}
public ExpStmtContext(StmtContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterExpStmt(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitExpStmt(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class ReturnStmtContext extends StmtContext {
@ -1208,12 +1376,28 @@ public class SysYParser extends Parser {
return getRuleContext(ExpContext.class,0);
}
public ReturnStmtContext(StmtContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterReturnStmt(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitReturnStmt(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class ContinueStmtContext extends StmtContext {
public TerminalNode CONTINUE() { return getToken(SysYParser.CONTINUE, 0); }
public TerminalNode SEMI() { return getToken(SysYParser.SEMI, 0); }
public ContinueStmtContext(StmtContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterContinueStmt(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitContinueStmt(this);
}
}
public final StmtContext stmt() throws RecognitionException {
@ -1370,6 +1554,14 @@ public class SysYParser extends Parser {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_exp; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterExp(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitExp(this);
}
}
public final ExpContext exp() throws RecognitionException {
@ -1402,6 +1594,14 @@ public class SysYParser extends Parser {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_cond; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterCond(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitCond(this);
}
}
public final CondContext cond() throws RecognitionException {
@ -1446,6 +1646,14 @@ public class SysYParser extends Parser {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_lVal; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterLVal(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitLVal(this);
}
}
public final LValContext lVal() throws RecognitionException {
@ -1507,6 +1715,14 @@ public class SysYParser extends Parser {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_primaryExp; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterPrimaryExp(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitPrimaryExp(this);
}
}
public final PrimaryExpContext primaryExp() throws RecognitionException {
@ -1565,6 +1781,14 @@ public class SysYParser extends Parser {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_number; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterNumber(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitNumber(this);
}
}
public final NumberContext number() throws RecognitionException {
@ -1618,6 +1842,14 @@ public class SysYParser extends Parser {
return getRuleContext(UnaryExpContext.class,0);
}
public OpUnaryExpContext(UnaryExpContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterOpUnaryExp(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitOpUnaryExp(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class CallUnaryExpContext extends UnaryExpContext {
@ -1628,6 +1860,14 @@ public class SysYParser extends Parser {
return getRuleContext(FuncRParamsContext.class,0);
}
public CallUnaryExpContext(UnaryExpContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterCallUnaryExp(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitCallUnaryExp(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class PrimaryUnaryExpContext extends UnaryExpContext {
@ -1635,6 +1875,14 @@ public class SysYParser extends Parser {
return getRuleContext(PrimaryExpContext.class,0);
}
public PrimaryUnaryExpContext(UnaryExpContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterPrimaryUnaryExp(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitPrimaryUnaryExp(this);
}
}
public final UnaryExpContext unaryExp() throws RecognitionException {
@ -1707,6 +1955,14 @@ public class SysYParser extends Parser {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_unaryOp; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterUnaryOp(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitUnaryOp(this);
}
}
public final UnaryOpContext unaryOp() throws RecognitionException {
@ -1755,6 +2011,14 @@ public class SysYParser extends Parser {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_funcRParams; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterFuncRParams(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitFuncRParams(this);
}
}
public final FuncRParamsContext funcRParams() throws RecognitionException {
@ -1820,6 +2084,14 @@ public class SysYParser extends Parser {
public TerminalNode DIV() { return getToken(SysYParser.DIV, 0); }
public TerminalNode MOD() { return getToken(SysYParser.MOD, 0); }
public BinaryMulExpContext(MulExpContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterBinaryMulExp(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitBinaryMulExp(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class UnaryMulExpContext extends MulExpContext {
@ -1827,6 +2099,14 @@ public class SysYParser extends Parser {
return getRuleContext(UnaryExpContext.class,0);
}
public UnaryMulExpContext(MulExpContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterUnaryMulExp(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitUnaryMulExp(this);
}
}
public final MulExpContext mulExp() throws RecognitionException {
@ -1924,6 +2204,14 @@ public class SysYParser extends Parser {
public TerminalNode ADD() { return getToken(SysYParser.ADD, 0); }
public TerminalNode SUB() { return getToken(SysYParser.SUB, 0); }
public BinaryAddExpContext(AddExpContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterBinaryAddExp(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitBinaryAddExp(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class MulAddExpContext extends AddExpContext {
@ -1931,6 +2219,14 @@ public class SysYParser extends Parser {
return getRuleContext(MulExpContext.class,0);
}
public MulAddExpContext(AddExpContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterMulAddExp(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitMulAddExp(this);
}
}
public final AddExpContext addExp() throws RecognitionException {
@ -2022,6 +2318,14 @@ public class SysYParser extends Parser {
return getRuleContext(AddExpContext.class,0);
}
public AddRelExpContext(RelExpContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterAddRelExp(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitAddRelExp(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class BinaryRelExpContext extends RelExpContext {
@ -2037,6 +2341,14 @@ public class SysYParser extends Parser {
public TerminalNode LE() { return getToken(SysYParser.LE, 0); }
public TerminalNode GE() { return getToken(SysYParser.GE, 0); }
public BinaryRelExpContext(RelExpContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterBinaryRelExp(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitBinaryRelExp(this);
}
}
public final RelExpContext relExp() throws RecognitionException {
@ -2134,6 +2446,14 @@ public class SysYParser extends Parser {
public TerminalNode EQ() { return getToken(SysYParser.EQ, 0); }
public TerminalNode NE() { return getToken(SysYParser.NE, 0); }
public BinaryEqExpContext(EqExpContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterBinaryEqExp(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitBinaryEqExp(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class RelEqExpContext extends EqExpContext {
@ -2141,6 +2461,14 @@ public class SysYParser extends Parser {
return getRuleContext(RelExpContext.class,0);
}
public RelEqExpContext(EqExpContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterRelEqExp(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitRelEqExp(this);
}
}
public final EqExpContext eqExp() throws RecognitionException {
@ -2232,6 +2560,14 @@ public class SysYParser extends Parser {
return getRuleContext(EqExpContext.class,0);
}
public EqLAndExpContext(LAndExpContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterEqLAndExp(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitEqLAndExp(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class BinaryLAndExpContext extends LAndExpContext {
@ -2243,6 +2579,14 @@ public class SysYParser extends Parser {
return getRuleContext(EqExpContext.class,0);
}
public BinaryLAndExpContext(LAndExpContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterBinaryLAndExp(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitBinaryLAndExp(this);
}
}
public final LAndExpContext lAndExp() throws RecognitionException {
@ -2324,6 +2668,14 @@ public class SysYParser extends Parser {
return getRuleContext(LAndExpContext.class,0);
}
public AndLOrExpContext(LOrExpContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterAndLOrExp(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitAndLOrExp(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class BinaryLOrExpContext extends LOrExpContext {
@ -2335,6 +2687,14 @@ public class SysYParser extends Parser {
return getRuleContext(LAndExpContext.class,0);
}
public BinaryLOrExpContext(LOrExpContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterBinaryLOrExp(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitBinaryLOrExp(this);
}
}
public final LOrExpContext lOrExp() throws RecognitionException {
@ -2407,6 +2767,14 @@ public class SysYParser extends Parser {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_constExp; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterConstExp(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitConstExp(this);
}
}
public final ConstExpContext constExp() throws RecognitionException {

Loading…
Cancel
Save