( | ) | * | + | , | - | . | / | : | := | ; | < | <= | <> | = | > | >= | Boolean | EOF | False | Float | Integer | String | True | and | begin | div | do | downto | else | end | for | function | identifier | if | mod | not | or | procedure | program | read | repeat | stringLiteral | then | to | unsignedFloat | unsignedInteger | until | var | while | write | writeln | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<SystemGoal> | 1 | |||||||||||||||||||||||||||||||||||||||||||||||||||
<Progrm> | 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||
<ProgramHeading> | 3 | |||||||||||||||||||||||||||||||||||||||||||||||||||
<Block> | 4 | 4 | 4 | 4 | ||||||||||||||||||||||||||||||||||||||||||||||||
<VariableDeclarationPart> | 6 | 6 | 6 | 5 | ||||||||||||||||||||||||||||||||||||||||||||||||
<VariableDeclarationTail> | 8 | 8 | 7 | 8 | ||||||||||||||||||||||||||||||||||||||||||||||||
<VariableDeclaration> | 9 | |||||||||||||||||||||||||||||||||||||||||||||||||||
<Type> | 13 | 11 | 10 | 12 | ||||||||||||||||||||||||||||||||||||||||||||||||
<ProcedureAndFunctionDeclarationPart> | 16 | 15 | 14 | |||||||||||||||||||||||||||||||||||||||||||||||||
<ProcedureDeclaration> | 17 | |||||||||||||||||||||||||||||||||||||||||||||||||||
<FunctionDeclaration> | 18 | |||||||||||||||||||||||||||||||||||||||||||||||||||
<ProcedureHeading> | 19 | |||||||||||||||||||||||||||||||||||||||||||||||||||
<FunctionHeading> | 20 | |||||||||||||||||||||||||||||||||||||||||||||||||||
<OptionalFormalParameterList> | 21 | 22 | 22 | |||||||||||||||||||||||||||||||||||||||||||||||||
<FormalParameterSectionTail> | 24 | 23 | ||||||||||||||||||||||||||||||||||||||||||||||||||
<FormalParameterSection> | 25 | 26 | ||||||||||||||||||||||||||||||||||||||||||||||||||
<ValueParameterSection> | 27 | |||||||||||||||||||||||||||||||||||||||||||||||||||
<VariableParameterSection> | 28 | |||||||||||||||||||||||||||||||||||||||||||||||||||
<StatementPart> | 29 | |||||||||||||||||||||||||||||||||||||||||||||||||||
<CompoundStatement> | 30 | |||||||||||||||||||||||||||||||||||||||||||||||||||
<StatementSequence> | 31 | 31 | 31 | 31 | 31 | 31 | 31 | 31 | 31 | 31 | 31 | 31 | ||||||||||||||||||||||||||||||||||||||||
<StatementTail> | 32 | 33 | 33 | |||||||||||||||||||||||||||||||||||||||||||||||||
<Statement> | 34 | 35 | 34 | 34 | 42 | 38,43 | 39 | 36 | 41 | 34 | 40 | 37 | 37 | |||||||||||||||||||||||||||||||||||||||
<EmptyStatement> | 44 | 44 | 44 | 44 | ||||||||||||||||||||||||||||||||||||||||||||||||
<ReadStatement> | 45 | |||||||||||||||||||||||||||||||||||||||||||||||||||
<ReadParameterTail> | 47 | 46 | ||||||||||||||||||||||||||||||||||||||||||||||||||
<ReadParameter> | 48 | |||||||||||||||||||||||||||||||||||||||||||||||||||
<WriteStatement> | 49 | 50 | ||||||||||||||||||||||||||||||||||||||||||||||||||
<WriteParameterTail> | 52 | 51 | ||||||||||||||||||||||||||||||||||||||||||||||||||
<WriteParameter> | 53 | 53 | 53 | 53 | 53 | 53 | 53 | 53 | 53 | 53 | ||||||||||||||||||||||||||||||||||||||||||
<AssignmentStatement> | 54,55 | |||||||||||||||||||||||||||||||||||||||||||||||||||
<IfStatement> | 56 | |||||||||||||||||||||||||||||||||||||||||||||||||||
<OptionalElsePart> | 58 | 57,58 | 58 | 58 | ||||||||||||||||||||||||||||||||||||||||||||||||
<RepeatStatement> | 59 | |||||||||||||||||||||||||||||||||||||||||||||||||||
<WhileStatement> | 60 | |||||||||||||||||||||||||||||||||||||||||||||||||||
<ForStatement> | 61 | |||||||||||||||||||||||||||||||||||||||||||||||||||
<ControlVariable> | 62 | |||||||||||||||||||||||||||||||||||||||||||||||||||
<InitialValue> | 63 | 63 | 63 | 63 | 63 | 63 | 63 | 63 | 63 | 63 | ||||||||||||||||||||||||||||||||||||||||||
<StepValue> | 65 | 64 | ||||||||||||||||||||||||||||||||||||||||||||||||||
<FinalValue> | 66 | 66 | 66 | 66 | 66 | 66 | 66 | 66 | 66 | 66 | ||||||||||||||||||||||||||||||||||||||||||
<ProcedureStatement> | 67 | |||||||||||||||||||||||||||||||||||||||||||||||||||
<OptionalActualParameterList> | 68 | 69 | 69 | 69 | 69 | 69 | 69 | 69 | 69 | 69 | 69 | 69 | 69 | 69 | 69 | 69 | 69 | 69 | 69 | 69 | 69 | 69 | 69 | 69 | 69 | |||||||||||||||||||||||||||
<ActualParameterTail> | 71 | 70 | ||||||||||||||||||||||||||||||||||||||||||||||||||
<ActualParameter> | 72 | 72 | 72 | 72 | 72 | 72 | 72 | 72 | 72 | 72 | ||||||||||||||||||||||||||||||||||||||||||
<Expression> | 73 | 73 | 73 | 73 | 73 | 73 | 73 | 73 | 73 | 73 | ||||||||||||||||||||||||||||||||||||||||||
<OptionalRelationalPart> | 75 | 75 | 75 | 74 | 74 | 74 | 74 | 74 | 74 | 75 | 75 | 75 | 75 | 75 | 75 | 75 | ||||||||||||||||||||||||||||||||||||
<RelationalOperator> | 77 | 79 | 81 | 76 | 78 | 80 | ||||||||||||||||||||||||||||||||||||||||||||||
<SimpleExpression> | 82 | 82 | 82 | 82 | 82 | 82 | 82 | 82 | 82 | 82 | ||||||||||||||||||||||||||||||||||||||||||
<TermTail> | 84 | 83 | 84 | 83 | 84 | 84 | 84 | 84 | 84 | 84 | 84 | 84 | 84 | 84 | 84 | 83 | 84 | 84 | 84 | |||||||||||||||||||||||||||||||||
<OptionalSign> | 87 | 85 | 86 | 87 | 87 | 87 | 87 | 87 | 87 | 87 | ||||||||||||||||||||||||||||||||||||||||||
<AddingOperator> | 88 | 89 | 90 | |||||||||||||||||||||||||||||||||||||||||||||||||
<Term> | 91 | 91 | 91 | 91 | 91 | 91 | 91 | 91 | ||||||||||||||||||||||||||||||||||||||||||||
<FactorTail> | 93 | 92 | 93 | 93 | 93 | 92 | 93 | 93 | 93 | 93 | 93 | 93 | 93 | 92 | 92 | 93 | 93 | 93 | 93 | 92 | 93 | 93 | 93 | 93 | ||||||||||||||||||||||||||||
<MultiplyingOperator> | 94 | 95 | 98 | 96 | 97 | |||||||||||||||||||||||||||||||||||||||||||||||
<Factor> | 105 | 103 | 102 | 106,116 | 104 | 101 | 100 | 99 | ||||||||||||||||||||||||||||||||||||||||||||
<ProgramIdentifier> | 107 | |||||||||||||||||||||||||||||||||||||||||||||||||||
<VariableIdentifier> | 108 | |||||||||||||||||||||||||||||||||||||||||||||||||||
<ProcedureIdentifier> | 109 | |||||||||||||||||||||||||||||||||||||||||||||||||||
<FunctionIdentifier> | 110 | |||||||||||||||||||||||||||||||||||||||||||||||||||
<BooleanExpression> | 111 | 111 | 111 | 111 | 111 | 111 | 111 | 111 | 111 | 111 | ||||||||||||||||||||||||||||||||||||||||||
<OrdinalExpression> | 112 | 112 | 112 | 112 | 112 | 112 | 112 | 112 | 112 | 112 | ||||||||||||||||||||||||||||||||||||||||||
<IdentifierList> | 113 | |||||||||||||||||||||||||||||||||||||||||||||||||||
<IdentifierTail> | 114 | 115 |
First Set:
<SystemGoal> -> program
<Progrm> -> program
<ProgramHeading> -> program
<Block> -> function begin var procedure
<VariableDeclarationPart> -> var lambda
<VariableDeclarationTail> -> identifier lambda
<VariableDeclaration> -> identifier
<Type> -> Integer Float String Boolean
<ProcedureAndFunctionDeclarationPart> -> function procedure lambda
<ProcedureDeclaration> -> procedure
<FunctionDeclaration> -> function
<ProcedureHeading> -> procedure
<FunctionHeading> -> function
<OptionalFormalParameterList> -> ( lambda
<FormalParameterSectionTail> -> ; lambda
<FormalParameterSection> -> var identifier
<ValueParameterSection> -> identifier
<VariableParameterSection> -> var
<StatementPart> -> begin
<CompoundStatement> -> begin
<StatementSequence> -> writeln begin repeat for read write while identifier ; if lambda
<StatementTail> -> ; lambda
<Statement> -> writeln begin repeat for read write while identifier lambda if
<EmptyStatement> -> lambda
<ReadStatement> -> read
<ReadParameterTail> -> , lambda
<ReadParameter> -> identifier
<WriteStatement> -> write writeln
<WriteParameterTail> -> , lambda
<WriteParameter> -> False ( + - stringLiteral not unsignedFloat identifier True unsignedInteger
<AssignmentStatement> -> identifier
<IfStatement> -> if
<OptionalElsePart> -> else lambda
<RepeatStatement> -> repeat
<WhileStatement> -> while
<ForStatement> -> for
<ControlVariable> -> identifier
<InitialValue> -> False ( + - stringLiteral not unsignedFloat identifier True unsignedInteger
<StepValue> -> to downto
<FinalValue> -> False ( + - stringLiteral not unsignedFloat identifier True unsignedInteger
<ProcedureStatement> -> identifier
<OptionalActualParameterList> -> ( lambda
<ActualParameterTail> -> , lambda
<ActualParameter> -> False ( + - stringLiteral not unsignedFloat identifier True unsignedInteger
<Expression> -> False ( + - stringLiteral not unsignedFloat identifier True unsignedInteger
<OptionalRelationalPart> -> >= <> <= lambda = < >
<RelationalOperator> -> >= <> <= = < >
<SimpleExpression> -> False ( + - stringLiteral not unsignedFloat identifier True unsignedInteger
<TermTail> -> + - or lambda
<OptionalSign> -> + - lambda
<AddingOperator> -> + - or
<Term> -> False ( unsignedInteger stringLiteral not unsignedFloat identifier True
<FactorTail> -> and * / div lambda mod
<MultiplyingOperator> -> and div * / mod
<Factor> -> False ( not unsignedFloat unsignedInteger identifier True stringLiteral
<ProgramIdentifier> -> identifier
<VariableIdentifier> -> identifier
<ProcedureIdentifier> -> identifier
<FunctionIdentifier> -> identifier
<BooleanExpression> -> False ( + - stringLiteral not unsignedFloat identifier True unsignedInteger
<OrdinalExpression> -> False ( + - stringLiteral not unsignedFloat identifier True unsignedInteger
<IdentifierList> -> identifier
<IdentifierTail> -> , lambda
Follow Set:
<SystemGoal> ->
<Progrm> -> EOF
<ProgramHeading> -> ;
<Block> -> ; .
<VariableDeclarationPart> -> function begin procedure
<VariableDeclarationTail> -> function begin procedure
<VariableDeclaration> -> ;
<Type> -> ) ;
<ProcedureAndFunctionDeclarationPart> -> begin
<ProcedureDeclaration> -> function begin procedure
<FunctionDeclaration> -> function begin procedure
<ProcedureHeading> -> ;
<FunctionHeading> -> ;
<OptionalFormalParameterList> -> ; :
<FormalParameterSectionTail> -> )
<FormalParameterSection> -> ) ;
<ValueParameterSection> -> ) ;
<VariableParameterSection> -> ) ;
<StatementPart> -> ; .
<CompoundStatement> -> end ; else until .
<StatementSequence> -> end until
<StatementTail> -> end until
<Statement> -> end ; until else
<EmptyStatement> -> end ; until else
<ReadStatement> -> end ; until else
<ReadParameterTail> -> )
<ReadParameter> -> ) ,
<WriteStatement> -> end ; until else
<WriteParameterTail> -> )
<WriteParameter> -> ) ,
<AssignmentStatement> -> end ; until else
<IfStatement> -> end ; until else
<OptionalElsePart> -> end ; until else
<RepeatStatement> -> end ; until else
<WhileStatement> -> end ; until else
<ForStatement> -> end ; until else
<ControlVariable> -> :=
<InitialValue> -> to downto
<StepValue> -> False ( + - stringLiteral not unsignedFloat identifier True unsignedInteger
<FinalValue> -> do
<ProcedureStatement> -> end ; until else
<OptionalActualParameterList> -> and >= then <> <= end downto ) + * - , / to ; = < > do else mod until div or
<ActualParameterTail> -> )
<ActualParameter> -> ) ,
<Expression> -> then end do ) downto , else to ; until
<OptionalRelationalPart> -> then end to do ) , else downto ; until
<RelationalOperator> -> False ( + - stringLiteral not unsignedFloat identifier True unsignedInteger
<SimpleExpression> -> then >= do <> <= else end to ) , < downto ; = until >
<TermTail> -> then >= do <> <= else end downto ) , until to ; = < >
<OptionalSign> -> False ( unsignedInteger stringLiteral not unsignedFloat identifier True
<AddingOperator> -> False ( unsignedInteger stringLiteral not unsignedFloat identifier True
<Term> -> then >= do <> <= else end downto ) + - , or to until ; = < >
<FactorTail> -> then >= do <> <= else end to ) + - , < downto until ; = or >
<MultiplyingOperator> -> False ( unsignedInteger stringLiteral not unsignedFloat identifier True
<Factor> -> and >= do <> <= end downto ) + * - , / to ; = until > then else mod < div or
<ProgramIdentifier> -> ;
<VariableIdentifier> -> and >= then <> <= := end to ) + * - , / downto ; = < > do else mod until div or
<ProcedureIdentifier> -> end ( ; until else
<FunctionIdentifier> -> and >= then <> <= := end to ) ( + * - , / downto ; : = < > do else mod until div or
<BooleanExpression> -> then end do else ; until
<OrdinalExpression> -> to do ) downto ,
<IdentifierList> -> :
<IdentifierTail> -> :