First e Follow
First e Follow utilizada para a construção da vivi lang.
First e Follow
First e Follow
Não terminal | First | Follow |
---|---|---|
S | $<vivi> | $ |
Script | $<vivi> | $ |
Statements | ε, function, id, if, for, return, print | $</vivi>, } |
FunctionDefinition | function | function, id, if, for, return, print, $</vivi>, } |
FunctionCall | id | function, id, if, for, return, print, $</vivi>, } |
Parameters | ε, id | ) |
ParameterList | id | ) |
MoreParameters | ,, ε | ) |
Arguments | ε, (, id, integer, decimal, digit, str, true, false, null | ) |
ArgumentList | (, id, integer, decimal, digit, str, true, false, null | ) |
MoreArguments | ,, ε | ) |
Statement | function, id, if, for, return, print | function, id, if, for, return, print, $</vivi>, } |
VariableDeclaration | id | function, id, if, for, return, print, $</vivi>, }, (, integer, decimal, digit, str, true, false, null |
VariableAssignment | id | function, id, if, for, return, print, $</vivi>, } |
Type | int, double, boolean, string | {, ,, ), (, id, integer, decimal, digit, str, true, false, null |
IfStatement | if | function, id, if, for, return, print, $</vivi>, } |
ElseClause | else, ε | function, id, if, for, return, print, $</vivi>, } |
ForLoop | for | function, id, if, for, return, print, $</vivi>, } |
Condition | (, id, integer, decimal, digit, str, true, false, null | ), ; |
RelationalOp | == | (, id, integer, decimal, digit, str, true, false, null |
ReturnStatement | return | function, id, if, for, return, print, $</vivi>, } |
PrintStatement | function, id, if, for, return, print, $</vivi>, } | |
PrintArgument | (, id, integer, decimal, digit, str, true, false, null | ) |
Expression | (, id, integer, decimal, digit, str, true, false, null | ,, ), ;, ==, str |
MoreTerms | +, -, ε, &&, || | ,, ), ;, ==, str |
LogicalOp | &&, || | (, id, integer, decimal, digit, str, true, false, null |
Term | (, id, integer, decimal, digit, str, true, false, null | +, -, &&, ||, ,, ), ;, ==, str |
MoreFactors | *, /, %, ε | +, -, &&, ||, ,, ), ;, ==, str |
Factor | (, id, integer, decimal, digit, str, true, false, null | *, /, %, +, -, &&, ||, ,, ), ;, ==, str |
- First(S): { $<vivi> }
- First(Script): { $<vivi> }
- First(Statements): { ε, function, id, if, for, return, print }
- First(FunctionDefinition): { function }
- First(FunctionCall): { id }
- First(Parameters): { ε, id }
- First(ParameterList): { id }
- First(MoreParameters): { ,, ε }
- First(Arguments): { ε, (, id, integer, decimal, digit, str, true, false, null }
- First(ArgumentList): { (, id, integer, decimal, digit, str, true, false, null }
- First(MoreArguments): { ,, ε }
- First(Statement): { function, id, if, for, return, print }
- First(VariableDeclaration): { id }
- First(VariableAssignment): { id }
- First(Type): { int, double, boolean, string }
- First(IfStatement): { if }
- First(ElseClause): { else, ε }
- First(ForLoop): { for }
- First(Condition): { (, id, integer, decimal, digit, str, true, false, null }
- First(RelationalOp): { == }
- First(ReturnStatement): { return }
- First(PrintStatement): { print }
- First(PrintArgument): { (, id, integer, decimal, digit, str, true, false, null }
- First(Expression): { (, id, integer, decimal, digit, str, true, false, null }
- First(MoreTerms): { +, -, ε, &&, || }
- First(LogicalOp): { &&, || }
- First(Term): { (, id, integer, decimal, digit, str, true, false, null }
- First(MoreFactors): { *, /, %, ε }
- First(Factor): { (, id, integer, decimal, digit, str, true, false, null }
- Follow(S): { $ }
- Follow(Script): { $ }
- Follow(Statements): { $</vivi>, } }
- Follow(FunctionDefinition): { function, id, if, for, return, print, $</vivi>, } }
- Follow(FunctionCall): { function, id, if, for, return, print, $</vivi>, } }
- Follow(Parameters): { ) }
- Follow(ParameterList): { ) }
- Follow(MoreParameters): { ) }
- Follow(Arguments): { ) }
- Follow(ArgumentList): { ) }
- Follow(MoreArguments): { ) }
- Follow(Statement): { function, id, if, for, return, print, $</vivi>, } }
- Follow(VariableDeclaration): { function, id, if, for, return, print, $</vivi>, }, (, integer, decimal, digit, str, true, false, null }
- Follow(VariableAssignment): { function, id, if, for, return, print, $</vivi>, } }
- Follow(Type): { {, ,, ), (, id, integer, decimal, digit, str, true, false, null }
- Follow(IfStatement): { function, id, if, for, return, print, $</vivi>, } }
- Follow(ElseClause): { function, id, if, for, return, print, $</vivi>, } }
- Follow(ForLoop): { function, id, if, for, return, print, $</vivi>, } }
- Follow(Condition): { ), ; }
- Follow(RelationalOp): { (, id, integer, decimal, digit, str, true, false, null }
- Follow(ReturnStatement): { function, id, if, for, return, print, $</vivi>, } }
- Follow(PrintStatement): { function, id, if, for, return, print, $</vivi>, } }
- Follow(PrintArgument): { ) }
- Follow(Expression): { ,, ), ;, ==, str }
- Follow(MoreTerms): { ,, ), ;, ==, str }
- Follow(LogicalOp): { (, id, integer, decimal, digit, str, true, false, null }
- Follow(Term): { +, -, &&, ||, ,, ), ;, ==, str }
- Follow(MoreFactors): { +, -, &&, ||, ,, ), ;, ==, str }
- Follow(Factor): { *, /, %, +, -, &&, ||, ,, ), ;, ==, str }