⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 2.output

📁 打开2.tab.c编译运行
💻 OUTPUT
📖 第 1 页 / 共 3 页
字号:
Grammar

  Number, Line, Rule
    1  14 Program -> PartialProgram DOT
    2  18 PartialProgram -> ConstantDeclaration VariableDeclaration ProcedureDeclaration Statement
    3  20 PartialProgram -> VariableDeclaration ProcedureDeclaration Statement
    4  22 PartialProgram -> ConstantDeclaration ProcedureDeclaration Statement
    5  24 PartialProgram -> ConstantDeclaration VariableDeclaration Statement
    6  26 PartialProgram -> ConstantDeclaration Statement
    7  28 PartialProgram -> VariableDeclaration Statement
    8  30 PartialProgram -> ProcedureDeclaration Statement
    9  32 PartialProgram -> Statement
   10  37 ConstantDeclaration -> CONST ConstList SEMICOLON
   11  42 ConstList -> ConstDefination
   12  44 ConstList -> ConstList COMMA ConstDefination
   13  49 ConstDefination -> IDENT EVALUATE NOSIGNINTEGER
   14  54 VariableDeclaration -> VAR IdentList SEMICOLON
   15  59 IdentList -> IDENT
   16  61 IdentList -> IdentList COMMA IDENT
   17  66 ProcedureDeclaration -> ProcedureHead PartialProgram SEMICOLON ProcedureDeclaration SEMICOLON
   18  68 ProcedureDeclaration -> ProcedureHead PartialProgram SEMICOLON
   19  72 ProcedureHead -> PROCEDURE IDENT SEMICOLON
   20  77 Statement -> EvaluateStatement
   21  79 Statement -> ComplexStatement
   22  81 Statement -> ConditionStatement
   23  83 Statement -> WhileStatement
   24  85 Statement -> ProcedureCallStatement
   25  87 Statement -> ReadStatement
   26  89 Statement -> WriteStatement
   27  91 Statement -> /* empty */
   28  96 EvaluateStatement -> IDENT EVALUATE Expression
   29 101 ComplexStatement -> BEGIN StatementList END
   30 106 StatementList -> Statement
   31 108 StatementList -> StatementList SEMICOLON Statement
   32 113 Condition -> Expression RelationOperator Expression
   33 115 Condition -> ODD Expression
   34 120 ConditionStatement -> IF Condition THEN Statement
   35 125 Expression -> ADD TermList
   36 127 Expression -> MINUS TermList
   37 129 Expression -> TermList
   38 134 TermList -> Term
   39 136 TermList -> TermList ADD Term
   40 138 TermList -> TermList MINUS Term
   41 143 Term -> GeneList
   42 148 GeneList -> Gene
   43 150 GeneList -> GeneList MULTIPLY Gene
   44 152 GeneList -> GeneList DIVIDE Gene
   45 157 Gene -> IDENT
   46 159 Gene -> NOSIGNINTEGER
   47 161 Gene -> LPARENTHESES Expression RPARENTHESES
   48 166 RelationOperator -> EQUAL
   49 168 RelationOperator -> UNEQUAL
   50 170 RelationOperator -> LESS
   51 172 RelationOperator -> LESSEQUAL
   52 174 RelationOperator -> MORE
   53 176 RelationOperator -> MOREEQUAL
   54 181 WhileStatement -> WHILE Condition DO Statement
   55 186 ProcedureCallStatement -> CALL IDENT
   56 191 ReadStatement -> READ LPARENTHESES IdentList RPARENTHESES
   57 196 WriteStatement -> WRITE LPARENTHESES ExpressionList RPARENTHESES
   58 201 ExpressionList -> Expression
   59 203 ExpressionList -> ExpressionList COMMA Expression


Terminals, with rules where they appear

$ (-1)
error (256)
IF (257) 34
THEN (258) 34
WHILE (259) 54
DO (260) 54
READ (261) 56
WRITE (262) 57
CALL (263) 55
BEGIN (264) 29
END (265) 29
CONST (266) 10
VAR (267) 14
PROCEDURE (268) 19
ODD (269) 33
ADD (270) 35 39
MINUS (271) 36 40
MULTIPLY (272) 43
DIVIDE (273) 44
EQUAL (274) 48
UNEQUAL (275) 49
LESS (276) 50
LESSEQUAL (277) 51
MORE (278) 52
MOREEQUAL (279) 53
EVALUATE (280) 13 28
LPARENTHESES (281) 47 56 57
RPARENTHESES (282) 47 56 57
COMMA (283) 12 16 59
SEMICOLON (284) 10 14 17 18 19 31
DOT (285) 1
NOSIGNINTEGER (286) 13 46
IDENT (287) 13 15 16 19 28 45 55


Nonterminals, with rules where they appear

Program (34)
    on left: 1
PartialProgram (35)
    on left: 2 3 4 5 6 7 8 9, on right: 1 17 18
ConstantDeclaration (36)
    on left: 10, on right: 2 4 5 6
ConstList (37)
    on left: 11 12, on right: 10 12
ConstDefination (38)
    on left: 13, on right: 11 12
VariableDeclaration (39)
    on left: 14, on right: 2 3 5 7
IdentList (40)
    on left: 15 16, on right: 14 16 56
ProcedureDeclaration (41)
    on left: 17 18, on right: 2 3 4 8 17
ProcedureHead (42)
    on left: 19, on right: 17 18
Statement (43)
    on left: 20 21 22 23 24 25 26 27, on right: 2 3 4 5 6 7 8 9 30
    31 34 54
EvaluateStatement (44)
    on left: 28, on right: 20
ComplexStatement (45)
    on left: 29, on right: 21
StatementList (46)
    on left: 30 31, on right: 29 31
Condition (47)
    on left: 32 33, on right: 34 54
ConditionStatement (48)
    on left: 34, on right: 22
Expression (49)
    on left: 35 36 37, on right: 28 32 33 47 58 59
TermList (50)
    on left: 38 39 40, on right: 35 36 37 39 40
Term (51)
    on left: 41, on right: 38 39 40
GeneList (52)
    on left: 42 43 44, on right: 41 43 44
Gene (53)
    on left: 45 46 47, on right: 42 43 44
RelationOperator (54)
    on left: 48 49 50 51 52 53, on right: 32
WhileStatement (55)
    on left: 54, on right: 23
ProcedureCallStatement (56)
    on left: 55, on right: 24
ReadStatement (57)
    on left: 56, on right: 25
WriteStatement (58)
    on left: 57, on right: 26
ExpressionList (59)
    on left: 58 59, on right: 57 59


state 0

    IF  	shift, and go to state 1
    WHILE	shift, and go to state 2
    READ	shift, and go to state 3
    WRITE	shift, and go to state 4
    CALL	shift, and go to state 5
    BEGIN	shift, and go to state 6
    CONST	shift, and go to state 7
    VAR 	shift, and go to state 8
    PROCEDURE	shift, and go to state 9
    IDENT	shift, and go to state 10

    $default	reduce using rule 27 (Statement)

    Program	go to state 110
    PartialProgram	go to state 11
    ConstantDeclaration	go to state 12
    VariableDeclaration	go to state 13
    ProcedureDeclaration	go to state 14
    ProcedureHead	go to state 15
    Statement	go to state 16
    EvaluateStatement	go to state 17
    ComplexStatement	go to state 18
    ConditionStatement	go to state 19
    WhileStatement	go to state 20
    ProcedureCallStatement	go to state 21
    ReadStatement	go to state 22
    WriteStatement	go to state 23



state 1

    ConditionStatement  ->  IF . Condition THEN Statement   (rule 34)

    ODD 	shift, and go to state 24
    ADD 	shift, and go to state 25
    MINUS	shift, and go to state 26
    LPARENTHESES	shift, and go to state 27
    NOSIGNINTEGER	shift, and go to state 28
    IDENT	shift, and go to state 29

    Condition	go to state 30
    Expression	go to state 31
    TermList	go to state 32
    Term	go to state 33
    GeneList	go to state 34
    Gene	go to state 35



state 2

    WhileStatement  ->  WHILE . Condition DO Statement   (rule 54)

    ODD 	shift, and go to state 24
    ADD 	shift, and go to state 25
    MINUS	shift, and go to state 26
    LPARENTHESES	shift, and go to state 27
    NOSIGNINTEGER	shift, and go to state 28
    IDENT	shift, and go to state 29

    Condition	go to state 36
    Expression	go to state 31
    TermList	go to state 32
    Term	go to state 33
    GeneList	go to state 34
    Gene	go to state 35



state 3

    ReadStatement  ->  READ . LPARENTHESES IdentList RPARENTHESES   (rule 56)

    LPARENTHESES	shift, and go to state 37



state 4

    WriteStatement  ->  WRITE . LPARENTHESES ExpressionList RPARENTHESES   (rule 57)

    LPARENTHESES	shift, and go to state 38



state 5

    ProcedureCallStatement  ->  CALL . IDENT   (rule 55)

    IDENT	shift, and go to state 39



state 6

    ComplexStatement  ->  BEGIN . StatementList END   (rule 29)

    IF  	shift, and go to state 1
    WHILE	shift, and go to state 2
    READ	shift, and go to state 3
    WRITE	shift, and go to state 4
    CALL	shift, and go to state 5
    BEGIN	shift, and go to state 6
    IDENT	shift, and go to state 10

    $default	reduce using rule 27 (Statement)

    Statement	go to state 40
    EvaluateStatement	go to state 17
    ComplexStatement	go to state 18
    StatementList	go to state 41
    ConditionStatement	go to state 19
    WhileStatement	go to state 20
    ProcedureCallStatement	go to state 21
    ReadStatement	go to state 22
    WriteStatement	go to state 23



state 7

    ConstantDeclaration  ->  CONST . ConstList SEMICOLON   (rule 10)

    IDENT	shift, and go to state 42

    ConstList	go to state 43
    ConstDefination	go to state 44



state 8

    VariableDeclaration  ->  VAR . IdentList SEMICOLON   (rule 14)

    IDENT	shift, and go to state 45

    IdentList	go to state 46



state 9

    ProcedureHead  ->  PROCEDURE . IDENT SEMICOLON   (rule 19)

    IDENT	shift, and go to state 47



state 10

    EvaluateStatement  ->  IDENT . EVALUATE Expression   (rule 28)

    EVALUATE	shift, and go to state 48



state 11

    Program  ->  PartialProgram . DOT   (rule 1)

    DOT 	shift, and go to state 49



state 12

    PartialProgram  ->  ConstantDeclaration . VariableDeclaration ProcedureDeclaration Statement   (rule 2)
    PartialProgram  ->  ConstantDeclaration . ProcedureDeclaration Statement   (rule 4)
    PartialProgram  ->  ConstantDeclaration . VariableDeclaration Statement   (rule 5)
    PartialProgram  ->  ConstantDeclaration . Statement   (rule 6)

    IF  	shift, and go to state 1
    WHILE	shift, and go to state 2
    READ	shift, and go to state 3
    WRITE	shift, and go to state 4
    CALL	shift, and go to state 5
    BEGIN	shift, and go to state 6
    VAR 	shift, and go to state 8
    PROCEDURE	shift, and go to state 9
    IDENT	shift, and go to state 10

    $default	reduce using rule 27 (Statement)

    VariableDeclaration	go to state 50
    ProcedureDeclaration	go to state 51
    ProcedureHead	go to state 15
    Statement	go to state 52
    EvaluateStatement	go to state 17
    ComplexStatement	go to state 18
    ConditionStatement	go to state 19
    WhileStatement	go to state 20
    ProcedureCallStatement	go to state 21
    ReadStatement	go to state 22
    WriteStatement	go to state 23



state 13

    PartialProgram  ->  VariableDeclaration . ProcedureDeclaration Statement   (rule 3)
    PartialProgram  ->  VariableDeclaration . Statement   (rule 7)

    IF  	shift, and go to state 1
    WHILE	shift, and go to state 2
    READ	shift, and go to state 3
    WRITE	shift, and go to state 4
    CALL	shift, and go to state 5
    BEGIN	shift, and go to state 6
    PROCEDURE	shift, and go to state 9
    IDENT	shift, and go to state 10

    $default	reduce using rule 27 (Statement)

    ProcedureDeclaration	go to state 53
    ProcedureHead	go to state 15
    Statement	go to state 54
    EvaluateStatement	go to state 17
    ComplexStatement	go to state 18
    ConditionStatement	go to state 19
    WhileStatement	go to state 20
    ProcedureCallStatement	go to state 21
    ReadStatement	go to state 22
    WriteStatement	go to state 23



state 14

    PartialProgram  ->  ProcedureDeclaration . Statement   (rule 8)

    IF  	shift, and go to state 1
    WHILE	shift, and go to state 2
    READ	shift, and go to state 3
    WRITE	shift, and go to state 4
    CALL	shift, and go to state 5
    BEGIN	shift, and go to state 6
    IDENT	shift, and go to state 10

    $default	reduce using rule 27 (Statement)

    Statement	go to state 55
    EvaluateStatement	go to state 17
    ComplexStatement	go to state 18
    ConditionStatement	go to state 19
    WhileStatement	go to state 20
    ProcedureCallStatement	go to state 21
    ReadStatement	go to state 22
    WriteStatement	go to state 23



state 15

    ProcedureDeclaration  ->  ProcedureHead . PartialProgram SEMICOLON ProcedureDeclaration SEMICOLON   (rule 17)
    ProcedureDeclaration  ->  ProcedureHead . PartialProgram SEMICOLON   (rule 18)

    IF  	shift, and go to state 1
    WHILE	shift, and go to state 2
    READ	shift, and go to state 3
    WRITE	shift, and go to state 4
    CALL	shift, and go to state 5
    BEGIN	shift, and go to state 6
    CONST	shift, and go to state 7
    VAR 	shift, and go to state 8
    PROCEDURE	shift, and go to state 9
    IDENT	shift, and go to state 10

    $default	reduce using rule 27 (Statement)

    PartialProgram	go to state 56
    ConstantDeclaration	go to state 12
    VariableDeclaration	go to state 13
    ProcedureDeclaration	go to state 14
    ProcedureHead	go to state 15
    Statement	go to state 16
    EvaluateStatement	go to state 17
    ComplexStatement	go to state 18
    ConditionStatement	go to state 19
    WhileStatement	go to state 20
    ProcedureCallStatement	go to state 21
    ReadStatement	go to state 22
    WriteStatement	go to state 23



state 16

    PartialProgram  ->  Statement .   (rule 9)

    $default	reduce using rule 9 (PartialProgram)



state 17

    Statement  ->  EvaluateStatement .   (rule 20)

    $default	reduce using rule 20 (Statement)



state 18

    Statement  ->  ComplexStatement .   (rule 21)

    $default	reduce using rule 21 (Statement)



state 19

    Statement  ->  ConditionStatement .   (rule 22)

    $default	reduce using rule 22 (Statement)



state 20

    Statement  ->  WhileStatement .   (rule 23)

    $default	reduce using rule 23 (Statement)



state 21

    Statement  ->  ProcedureCallStatement .   (rule 24)

    $default	reduce using rule 24 (Statement)



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -