diff --git a/ANTLR/.gitignore b/ANTLR/.gitignore new file mode 100644 index 0000000..2167eb4 --- /dev/null +++ b/ANTLR/.gitignore @@ -0,0 +1,15 @@ +*.class + +.idea/ +out/ + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* diff --git a/ANTLR/src/Test/ObsidiCode.g4 b/ANTLR/src/Test/ObsidiCode.g4 new file mode 100644 index 0000000..de59657 --- /dev/null +++ b/ANTLR/src/Test/ObsidiCode.g4 @@ -0,0 +1,265 @@ +grammar ObsidiCode; + +//Fragment rules for lexer +fragment NameStartChar + : 'A'..'Z' | 'a'..'z'; +fragment NameChar + : NameStartChar + | '0'..'9' + | '_' + ; +fragment Num + : '0'..'9'; + +//Regex for the scanner: +Identifier + : NameStartChar NameChar*; + +NumLit + : Num+ ('.'Num+)?; +CoordLit + : '('Num+',' Num+','Num+')'; +StringLit + : '"'~('"')*'"'; + +WS + : [\t\r' ']+ -> skip; + +//Comments +COMMENT + : '/*' .*? '*/' -> skip + ; +EOLCOMMENT + : '//' .*? '\n' -> skip + ; + +prog + : roboDcl loads roboBodyDcl; +//Types and literals: +literal + : NumLit + | 'TRUE' + | 'FALSE' + | CoordLit + | StringLit + ; +typeName + : Identifier + | typeName '.' Identifier + ; + +type + : referenceType + | primitiveType + ; +primitiveType + : 'NUM' + | 'BOOL' + ; +referenceType + : 'STRING' + | 'COORD' + | 'LIST' + ; + +loads + : loads 'LOAD' '(' StringLit ')' '\n' + | //lambda + ; + +//Declarations +roboDcl + : Identifier':''\n' + ; +roboBodyDcl + : roboBodyDcl memberDcl + | memberDcl + ; + +memberDcl + : fieldDcl + | methodDcl + | '\n' + ; + +fieldDcl + : type variableDclList '\n'; +variableDclList + : variableDcl + | variableDclList ',' variableDcl + ; +variableDcl + : variableInitializer + | Identifier '=' listInitializer + ; +variableInitializer + : assignmentExpression + | Identifier + ; +listInitializer + : litList 'END' Identifier + | //lambda + ; +litList + : litList ',' primary + | primary + ; + +//method stuff +methodDcl + : methodHeader methodBody + | hearDcl + ; +methodHeader + : type methodDeclarator + | 'VOID' methodDeclarator + ; +methodDeclarator + : Identifier '(' formalParams ')' '\n' + ; +methodBody + : block 'END' Identifier + ; +hearDcl + : 'HEAR' Identifier '(' formalParams ')' '\n' block 'END HEAR' + ; + +//Statements +block + : blockStmtList + | //lambda + ; +blockStmtList + : blockStmtList statement '\n' + | statement '\n' + ; +statement + : type variableDclList + | stmtNoSub + | ifStmt + | loopStmt + ; +stmtNoSub + : //lambda + | signalStmt + | exprStmt + | 'BREAK' + | 'RETURN' expression + ; +signalStmt + : 'SIGNAL' Identifier '(' argsList ')' + ; +exprStmt + : assignmentExpression + | methodInvocation + ; + +methodInvocation + : typeName '(' formalArgs ')' + ; + +ifStmt + : 'IF' '(' expression ')' '\n' block 'END IF' elseIfOpt elseOpt + ; +elseIfOpt + : elseIfOpt '\n' 'ELSE IF' '(' expression ')' '\n' block 'END ELSEIF' + | //lambda + ; +elseOpt + : '\n' 'ELSE' '\n' block 'END ELSE' + | //lambda + ; + +loopStmt + : repeatStmt + | foreverStmt + ; +repeatStmt + : 'REPEAT UNTIL' '(' expression ')' '\n' block 'END REPEAT' + ; +foreverStmt + : 'FOREVER' '\n' block 'END FOREVER' + ; + +//Args and params +formalArgs + : argsList + | //lambda + ; +argsList + : argsList ',' expression + | expression + ; +formalParams + : paramsList + | //lambda + ; +paramsList + : paramsList ',' param + | param + ; +param + : type Identifier + ; + +//Expression part +expression + : assignmentExpression; + +assignmentExpression + : conditionalExpression + | assignment; +assignment + : leftHandSide '=' expression; +leftHandSide + : typeName listOpt; +listOpt + : '[' expression ']' + | //lambda + ;conditionalExpression + : conditionOrExpression; +conditionOrExpression + : conditionAndExpression + | conditionOrExpression 'OR' conditionAndExpression; +conditionAndExpression + : xOrExpression + | conditionAndExpression 'AND' xOrExpression; +xOrExpression + : equalityExpression + | xOrExpression 'XOR' equalityExpression; +equalityExpression + : relationalExpression + | equalityExpression equalityExpressionEnd; +equalityExpressionEnd + : 'IS' relationalExpression + | 'NOT' relationalExpression; +relationalExpression + : additiveExpression + | relationalExpression relationalExpressionEnd; +relationalExpressionEnd + : 'LESS_THAN' additiveExpression + | 'GREATER_THAN' additiveExpression + | 'LESS_THAN_EQUAL' additiveExpression + | 'GREATER_THAN_EQUAL' additiveExpression; +additiveExpression + : multiExpr + | additiveExpression additiveExpressionEnd; +additiveExpressionEnd + : '+' multiExpr + | '-' multiExpr; +multiExpr + : unaryExpr + | multiExpr multiExprEnd; +multiExprEnd + : '*' unaryExpr + | '/' unaryExpr; +unaryExpr + : '+' unaryExpr + | '-' unaryExpr + | primary; +primary + : literal + | '(' expression ')' + | typeName listOpt + | methodInvocation +; diff --git a/ANTLR/src/Test/antlr-4.5-complete.jar b/ANTLR/src/Test/antlr-4.5-complete.jar new file mode 100644 index 0000000..5d07a7f Binary files /dev/null and b/ANTLR/src/Test/antlr-4.5-complete.jar differ diff --git a/ANTLR/src/Test/build.sh b/ANTLR/src/Test/build.sh new file mode 100644 index 0000000..923b6eb --- /dev/null +++ b/ANTLR/src/Test/build.sh @@ -0,0 +1,7 @@ +#!/bin/bash +export CLASSPATH=".:antlr-4.5-complete.jar:$CLASSPATH" + +echo building the parser via ANTLR4... +java -Xmx500M -cp "antlr-4.5-complete.jar:$CLASSPATH" org.antlr.v4.Tool -package ObsidiCode.g4 +echo compiling paser... +javac ObsidiCode*.java diff --git a/ANTLR/src/Test/clean.sh b/ANTLR/src/Test/clean.sh new file mode 100644 index 0000000..6534b8c --- /dev/null +++ b/ANTLR/src/Test/clean.sh @@ -0,0 +1,7 @@ +#!/bin/bash +echo cleaning binaries +rm *.class +echo cleaning java files +rm ObsidiCode*.java +echo cleaning tokens +rm *.tokens diff --git a/ANTLR/src/Test/run.sh b/ANTLR/src/Test/run.sh new file mode 100644 index 0000000..874e330 --- /dev/null +++ b/ANTLR/src/Test/run.sh @@ -0,0 +1,5 @@ +#!/bin/bash/ +export CLASSPATH=".:antlr-4.5-complete.jar:$CLASSPATH" + +echo starting up... +java org.antlr.v4.runtime.misc.TestRig ObsidiCode prog -gui $1 diff --git a/ANTLR/src/Test/test_decl.txt b/ANTLR/src/Test/test_decl.txt new file mode 100644 index 0000000..d33f023 --- /dev/null +++ b/ANTLR/src/Test/test_decl.txt @@ -0,0 +1,31 @@ +Test_robo: +LOAD("Attack-bot") +LOAD("Bow-bot") + +BOOL works = true + +//This be le tests con many! +/*Whattup maite!?*/ + +VOID Start() + NUM c = 10 + a = b + c + SIGNAL guardian (a, b) +END Start + +NUM TestNumMethod(NUM x, STRING s) + RETURN s + x +END TestNumMethod + +VOID AnotherTestMethod(BOOL atHome) + FOREVER + COORD currentPos = (1,23,45) + + IF(currentPos.x GREATER_THAN 10) + BREAK + END IF + ELSE IF (atHome) + //Something to find chest mayby + END ELSEIF + END FOREVER +END AnotherTestMethod diff --git a/AST/.gitignore b/AST/.gitignore new file mode 100644 index 0000000..f69c541 --- /dev/null +++ b/AST/.gitignore @@ -0,0 +1,13 @@ +*.class +.idea/ + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* diff --git a/AST/ASTLee/production/org/AST/GeneralNodes/BinaryNode.class b/AST/ASTLee/production/org/AST/GeneralNodes/BinaryNode.class new file mode 100644 index 0000000..4440096 Binary files /dev/null and b/AST/ASTLee/production/org/AST/GeneralNodes/BinaryNode.class differ diff --git a/AST/ASTLee/production/org/AST/GeneralNodes/NaryNode.class b/AST/ASTLee/production/org/AST/GeneralNodes/NaryNode.class new file mode 100644 index 0000000..3cdf189 Binary files /dev/null and b/AST/ASTLee/production/org/AST/GeneralNodes/NaryNode.class differ diff --git a/AST/ASTLee/production/org/AST/GeneralNodes/Node.class b/AST/ASTLee/production/org/AST/GeneralNodes/Node.class new file mode 100644 index 0000000..d438db7 Binary files /dev/null and b/AST/ASTLee/production/org/AST/GeneralNodes/Node.class differ diff --git a/AST/ASTLee/production/org/AST/GeneralNodes/UnaryNode.class b/AST/ASTLee/production/org/AST/GeneralNodes/UnaryNode.class new file mode 100644 index 0000000..ff68758 Binary files /dev/null and b/AST/ASTLee/production/org/AST/GeneralNodes/UnaryNode.class differ diff --git a/AST/ASTLee/production/org/AST/Main.class b/AST/ASTLee/production/org/AST/Main.class new file mode 100644 index 0000000..84bcfc2 Binary files /dev/null and b/AST/ASTLee/production/org/AST/Main.class differ diff --git a/AST/ASTLee/production/org/AST/SyntaxNodes/PlusNode.class b/AST/ASTLee/production/org/AST/SyntaxNodes/PlusNode.class new file mode 100644 index 0000000..5126be3 Binary files /dev/null and b/AST/ASTLee/production/org/AST/SyntaxNodes/PlusNode.class differ diff --git a/AST/ASTLee/production/org/Visitors/PrettyPrintVisitor.class b/AST/ASTLee/production/org/Visitors/PrettyPrintVisitor.class new file mode 100644 index 0000000..ea1950e Binary files /dev/null and b/AST/ASTLee/production/org/Visitors/PrettyPrintVisitor.class differ diff --git a/AST/ASTLee/production/org/Visitors/Visitor.class b/AST/ASTLee/production/org/Visitors/Visitor.class new file mode 100644 index 0000000..99c4e51 Binary files /dev/null and b/AST/ASTLee/production/org/Visitors/Visitor.class differ diff --git a/AST/ASTLee/src/java/org/AST/GeneralNodes/BinaryNode.java b/AST/ASTLee/src/java/org/AST/GeneralNodes/BinaryNode.java new file mode 100644 index 0000000..375ca40 --- /dev/null +++ b/AST/ASTLee/src/java/org/AST/GeneralNodes/BinaryNode.java @@ -0,0 +1,20 @@ +package org.AST.GeneralNodes; + +import org.Visitors.Visitor; + +/** + * Created by Nete on 08-03-2016. + */ +public abstract class BinaryNode extends Node { + protected Node rightChild; + + public Node GetRightChild() + { + return rightChild; + } + + public BinaryNode (Node leftChild, Node rightChild){ + this._leftmostChild = leftChild; + this.rightChild = rightChild; + } +} diff --git a/AST/ASTLee/src/java/org/AST/GeneralNodes/NaryNode.java b/AST/ASTLee/src/java/org/AST/GeneralNodes/NaryNode.java new file mode 100644 index 0000000..bf66052 --- /dev/null +++ b/AST/ASTLee/src/java/org/AST/GeneralNodes/NaryNode.java @@ -0,0 +1,30 @@ +package org.AST.GeneralNodes; + +import com.sun.org.apache.xpath.internal.operations.Plus; +import org.AST.SyntaxNodes.ExpressionNode; +import org.AST.SyntaxNodes.PlusNode; + +import java.util.ArrayList; + +/** + * Created by Nete on 08-03-2016. + */ +public abstract class NaryNode extends Node { + protected ArrayList children; + + public NaryNode(ArrayList childNodes) + { + //childNodes must be ordered in left to right appearance in tree + this._leftmostChild = childNodes.get(0); + + for (int i = 0; i < childNodes.size(); i++) { + Node n = childNodes.get(i); + n._parent = this; + } + + if(this._leftmostChild != null) + System.out.println("In outer if."); + if (this._leftmostChild instanceof ExpressionNode) + System.out.println("Left child is plus"); + } +} diff --git a/AST/ASTLee/src/java/org/AST/GeneralNodes/Node.java b/AST/ASTLee/src/java/org/AST/GeneralNodes/Node.java new file mode 100644 index 0000000..50d321c --- /dev/null +++ b/AST/ASTLee/src/java/org/AST/GeneralNodes/Node.java @@ -0,0 +1,16 @@ +package org.AST.GeneralNodes; + +import org.Visitors.Visitor; + +public abstract class Node +{ + public Node _parent; + protected Node _leftmostChild; + + public Node GetLeftChild() + { + return _leftmostChild; + } + + public abstract Object Visit(Visitor v); +} diff --git a/AST/ASTLee/src/java/org/AST/GeneralNodes/UnaryNode.java b/AST/ASTLee/src/java/org/AST/GeneralNodes/UnaryNode.java new file mode 100644 index 0000000..3577f25 --- /dev/null +++ b/AST/ASTLee/src/java/org/AST/GeneralNodes/UnaryNode.java @@ -0,0 +1,13 @@ +package org.AST.GeneralNodes; + +import org.AST.GeneralNodes.Node; + +/** + * Created by Nete on 08-03-2016. + */ +public abstract class UnaryNode extends Node { + public UnaryNode (Node child) + { + this._leftmostChild = child; + } +} diff --git a/AST/ASTLee/src/java/org/AST/Main.java b/AST/ASTLee/src/java/org/AST/Main.java new file mode 100644 index 0000000..57b397e --- /dev/null +++ b/AST/ASTLee/src/java/org/AST/Main.java @@ -0,0 +1,25 @@ +package org.AST; + +import org.AST.GeneralNodes.NaryNode; +import org.AST.GeneralNodes.Node; +import org.AST.SyntaxNodes.ExpressionNode; +import org.AST.SyntaxNodes.PlusNode; +import org.Visitors.PrettyPrintVisitor; +import org.Visitors.Visitor; + +import java.util.ArrayList; + +public class Main +{ + public static void main (String args[]) + { + ArrayList al = new ArrayList(); + al.add(new ExpressionNode(null, null) ); + NaryNode n = new NaryNode(al) { + @Override + public Object Visit(Visitor v) { + return null; + } + }; + } +} diff --git a/AST/ASTLee/src/java/org/AST/SyntaxNodes/AssignNode.java b/AST/ASTLee/src/java/org/AST/SyntaxNodes/AssignNode.java new file mode 100644 index 0000000..9dd895f --- /dev/null +++ b/AST/ASTLee/src/java/org/AST/SyntaxNodes/AssignNode.java @@ -0,0 +1,11 @@ +package org.AST; + +import org.AST.SyntaxNodes; +import org.AST.GeneralNodes; + +public class AssignNode extends BinaryNode{ + public AssignNode(IDNode id, ExpressionNode expr){ + this.leftmostchild = id; + this.rightChild = expr; + } +} \ No newline at end of file diff --git a/AST/ASTLee/src/java/org/AST/SyntaxNodes/BlockNode.java b/AST/ASTLee/src/java/org/AST/SyntaxNodes/BlockNode.java new file mode 100644 index 0000000..bc720ed --- /dev/null +++ b/AST/ASTLee/src/java/org/AST/SyntaxNodes/BlockNode.java @@ -0,0 +1,4 @@ +import +package org.AST; + +public class BlockNode extends N \ No newline at end of file diff --git a/AST/ASTLee/src/java/org/AST/SyntaxNodes/DivNode.java b/AST/ASTLee/src/java/org/AST/SyntaxNodes/DivNode.java new file mode 100644 index 0000000..6c0ae30 --- /dev/null +++ b/AST/ASTLee/src/java/org/AST/SyntaxNodes/DivNode.java @@ -0,0 +1,7 @@ +package org.AST; + +public class DivNode extends BinaryNode{ + public DivNode(Node left, Node right){ + super(left,right); + } +} \ No newline at end of file diff --git a/AST/ASTLee/src/java/org/AST/SyntaxNodes/ExpressionNode.java b/AST/ASTLee/src/java/org/AST/SyntaxNodes/ExpressionNode.java new file mode 100644 index 0000000..b2ee9a8 --- /dev/null +++ b/AST/ASTLee/src/java/org/AST/SyntaxNodes/ExpressionNode.java @@ -0,0 +1,20 @@ +package org.AST.SyntaxNodes; + +import org.AST.GeneralNodes.BinaryNode; +import org.AST.GeneralNodes.Node; +import org.Visitors.Visitor; + +/** + * Created by Nete on 09-03-2016. + */ +public class ExpressionNode extends BinaryNode{ + public ExpressionNode (Node left, Node right) + { + super(left, right); + } + + @Override + public Object Visit(Visitor v) { + return null; + } +} diff --git a/AST/ASTLee/src/java/org/AST/SyntaxNodes/IDNode.java b/AST/ASTLee/src/java/org/AST/SyntaxNodes/IDNode.java new file mode 100644 index 0000000..223c8f0 --- /dev/null +++ b/AST/ASTLee/src/java/org/AST/SyntaxNodes/IDNode.java @@ -0,0 +1,8 @@ +package org.AST.GeneralNodes; + +public class ID_Node extends UnaryNode{ + private String ID; + public ID_Node(String identifier){ + this.ID = identifier; + } +} \ No newline at end of file diff --git a/AST/ASTLee/src/java/org/AST/SyntaxNodes/MinusNode.java b/AST/ASTLee/src/java/org/AST/SyntaxNodes/MinusNode.java new file mode 100644 index 0000000..2f29532 --- /dev/null +++ b/AST/ASTLee/src/java/org/AST/SyntaxNodes/MinusNode.java @@ -0,0 +1,8 @@ +package org.AST.SyntaxNodes; + +public class MinusNode extends BinaryNode{ + public MinusNode(Node left, Node right){ + super(left,right); + } + +} \ No newline at end of file diff --git a/AST/ASTLee/src/java/org/AST/SyntaxNodes/MultNode.java b/AST/ASTLee/src/java/org/AST/SyntaxNodes/MultNode.java new file mode 100644 index 0000000..a287c96 --- /dev/null +++ b/AST/ASTLee/src/java/org/AST/SyntaxNodes/MultNode.java @@ -0,0 +1,7 @@ +package org.AST; + +public class MultNode extends BinaryNode{ + public MultNode(Node left, Node right){ + super(left, right); + } +} \ No newline at end of file diff --git a/AST/ASTLee/src/java/org/AST/SyntaxNodes/PlusNode.java b/AST/ASTLee/src/java/org/AST/SyntaxNodes/PlusNode.java new file mode 100644 index 0000000..b6ab3e2 --- /dev/null +++ b/AST/ASTLee/src/java/org/AST/SyntaxNodes/PlusNode.java @@ -0,0 +1,20 @@ +package org.AST.SyntaxNodes; + +import org.AST.GeneralNodes.BinaryNode; +import org.AST.GeneralNodes.Node; +import org.Visitors.Visitor; + +/** + * Created by Nete on 09-03-2016. + */ +public class PlusNode extends BinaryNode { + public PlusNode(Node left, Node right) + { + super(left, right); + } + + @Override + public Object Visit(Visitor v) { + return v.Visit(this); + } +} diff --git a/AST/ASTLee/src/java/org/AST/SyntaxNodes/PwrNode.java b/AST/ASTLee/src/java/org/AST/SyntaxNodes/PwrNode.java new file mode 100644 index 0000000..f029494 --- /dev/null +++ b/AST/ASTLee/src/java/org/AST/SyntaxNodes/PwrNode.java @@ -0,0 +1,7 @@ +package org.AST; + +public class PwrNode extends BinaryNode{ + public PwrNode(Node left, Node right){ + super(left, right); + } +} \ No newline at end of file diff --git a/AST/ASTLee/src/java/org/AST/SyntaxNodes/SqrtNode.java b/AST/ASTLee/src/java/org/AST/SyntaxNodes/SqrtNode.java new file mode 100644 index 0000000..17c1d8c --- /dev/null +++ b/AST/ASTLee/src/java/org/AST/SyntaxNodes/SqrtNode.java @@ -0,0 +1,7 @@ +package org.AST; + +public class SqrtNode extends BinaryNode{ + public SqrtNode(Node left, Node right){ + super(left, right); + } +} \ No newline at end of file diff --git a/AST/ASTLee/src/java/org/AST/SyntaxNodes/ValueNode.java b/AST/ASTLee/src/java/org/AST/SyntaxNodes/ValueNode.java new file mode 100644 index 0000000..7a14e41 --- /dev/null +++ b/AST/ASTLee/src/java/org/AST/SyntaxNodes/ValueNode.java @@ -0,0 +1,8 @@ +package org.AST; + +public class ValueNode extends UnaryNode{ + private String value; + public ValueNode(String val){ + this.value = val; + } +} \ No newline at end of file diff --git a/AST/ASTLee/src/java/org/Visitors/PrettyPrintVisitor.java b/AST/ASTLee/src/java/org/Visitors/PrettyPrintVisitor.java new file mode 100644 index 0000000..a4f66ce --- /dev/null +++ b/AST/ASTLee/src/java/org/Visitors/PrettyPrintVisitor.java @@ -0,0 +1,30 @@ +package org.Visitors; + +import org.AST.GeneralNodes.Node; +import org.AST.SyntaxNodes.PlusNode; + +/** + * Created by Nete on 09-03-2016. + */ +public class PrettyPrintVisitor extends Visitor { + + @Override + public Object Visit(PlusNode n) { + System.out.println("Encountered a plus node!"); + + Node c = n.GetLeftChild(); + if(c != null) + Visit(c); + c = n.GetRightChild(); + if(c != null) + Visit(c); + + //Should be fixed!!! + return null; + } + + @Override + public void Visit(Node n) { + System.out.println("Encountered a Node."); + } +} diff --git a/AST/ASTLee/src/java/org/Visitors/Visitor.java b/AST/ASTLee/src/java/org/Visitors/Visitor.java new file mode 100644 index 0000000..2d88b99 --- /dev/null +++ b/AST/ASTLee/src/java/org/Visitors/Visitor.java @@ -0,0 +1,12 @@ +package org.Visitors; + +import org.AST.GeneralNodes.Node; +import org.AST.SyntaxNodes.PlusNode; + +/** + * Created by Nete on 09-03-2016. + */ +public abstract class Visitor { + public abstract Object Visit(PlusNode n); + public abstract void Visit(Node n); +} diff --git a/Scanner/src/java/org/Scanner/Main.java b/Scanner/src/java/org/Scanner/Main.java new file mode 100644 index 0000000..5aac695 --- /dev/null +++ b/Scanner/src/java/org/Scanner/Main.java @@ -0,0 +1,9 @@ +package org.Scanner; + +public class Main +{ + public static final void main (String[] args) + { + System.out.println("tesft"); + } +} diff --git a/Scanner/src/java/org/Scanner/Parser.java b/Scanner/src/java/org/Scanner/Parser.java new file mode 100644 index 0000000..c49afe9 --- /dev/null +++ b/Scanner/src/java/org/Scanner/Parser.java @@ -0,0 +1,311 @@ +package org.Scanner; +import org.Scanner.Token.*; + +/** + * Created by Tidsfordriv on 03/03/16. + */ +public class Parser { + + TokenStream ts; + + public Parser(){ + ts = new TokenStream(); + } + + private void expect(Token.type expectedTokenType){ + if (ts.CurrentToken._type == expectedTokenType) + ts.CurrentToken = ts.Peek(); + else + System.out.println("u dun goofed"); + //Insert error here + } + + private void expect(Token.type expectedTokenType, Token.type expectedFollowingToken){ + if (ts.CurrentToken._type == expectedTokenType && ts.Peek()._type == expectedFollowingToken) + ts.CurrentToken = ts.PeekTwo(); + else + System.out.println("u dun goofed"); + //Insert error here + } + + private void expect(Token.type expectedFirstToken, Token.type expectedSecondToken, Token.type expectedThirdToken){ + if (ts.CurrentToken._type == expectedFirstToken && ts.Peek()._type == expectedSecondToken && ts.PeekTwo()._type == expectedThirdToken) { + ts.CurrentToken = ts.PeekTwo(); + ts.CurrentToken = ts.Peek(); + } + else + System.out.println("u dun goofed"); + //Insert error here + } + + private void acceptIt(){ + ts.CurrentToken = ts.Peek(); + } + + private boolean isDCL(type t){ + if (t == type.BOOL_DCL || t == type.REF_DCL || t == type.NUM_DCL || t == type.COORD_DCL || t == type.STRING_DCL) + return true; + return false; + } + + private boolean isSTMT(type t){ + if (t == type.IF || t == type.REPEAT || t == type.FOREVER || t == type.SIGNAL) + return true; + return false; + } + + private void Program(){ + Robo(); + Load(); + dcl(); + start_func(); + while(ts.CurrentToken._type != type.EOF) + func(); + expect(type.EOF); + } + + private void Robo(){ + if(ts.CurrentToken._type == type.ROBOT_NAME) + expect(type.ROBOT_NAME); + else + System.out.println("u dun goofed"); + } + + private void Load(){ + /*while(ts.Peek()._type == type.LOAD || ts.Peek()._type == type.ID || ts.Peek()._type == type.EOL){ + Do something + }*/ + } + + private void dcl(){ + boolean declaring = true; + while(declaring) + switch (ts.CurrentToken._type){ + case NUM_DCL:{ + num_dcl(); + //Stuff it do. + } + break; + case REF_DCL:{ + ref_dcl(); + //Stuff it do + } + break; + case STRING_DCL:{ + string_dcl(); + //Stuff it do + } + break; + case BOOL_DCL:{ + bool_dcl(); + //Stuff it do + } + break; + case COORD_DCL:{ + coord_dcl(); + //Stuff it do + } + break; + default: + declaring = false; + break; + } + } + + private void num_dcl(){ + //Parse num_dcl + } + + private void ref_dcl(){ + //Parse ref_dcl + } + + private void string_dcl(){ + //Parse string_dcl + } + + private void bool_dcl() { + //Parse bool_dcl + } + + private void coord_dcl() { + + } + + private void start_func() { + if (ts.CurrentToken._type == type.VOID && ts.Peek()._type == type.START && ts.PeekTwo()._type == type.EOL){ + ts.CurrentToken = ts.PeekTwo(); + acceptIt(); + func_body(); + } + else + System.out.println("u dun goofed"); + //Error + if (ts.CurrentToken._type == type.END && ts.Peek()._type == type.START) + System.out.println("u dun well"); + + } + + private void func() { + if(ts.CurrentToken._type == type.TYPE && ts.Peek()._type == type.ID){ + acceptIt(); + acceptIt(); + params(); + expect(type.EOL); + func_body(); + if (ts.CurrentToken._type == type.RETURN) + expr(); + expect(type.END); + expect(type.ID); + } + else if(ts.CurrentToken._type == type.HEAR && ts.Peek()._type == type.STRING_LIT){ + acceptIt(); + acceptIt(); + params(); + func_body(); + expect(type.END); + expect(type.HEAR); + } + else + System.out.println("u dun goofed"); + //Throw error + } + + private void func_body() { + while (ts.CurrentToken._type != type.END){ + if(isDCL(ts.CurrentToken._type)) + dcl(); + else if (isSTMT(ts.CurrentToken._type)) + stmt(); + else + System.out.println("u dun goofed"); + //Error + expect(type.EOL); + } + } + + private void stmt() { + switch(ts.CurrentToken._type){ + case IF:{ + acceptIt(); + if_stmt(); + //Stuff it do + } + break; + case REPEAT:{ + acceptIt(); + loop_stmt(); + //Stuff it do + } + break; + case FOREVER:{ + acceptIt(); + loop_stmt(); + } + break; + case SIGNAL:{ + acceptIt(); + sig_stmt(); + } + break; + case FUNC_CALL:{ + acceptIt(); + func_call(); + } + break; + default:{ + //Errors + } + break; + } + } + + private void if_stmt() { + expect(type.IF); + cond(); + expect(type.EOL); + func_body(); + expect(type.END, type.IF); + while(ts.CurrentToken._type == type.ELSE && ts.Peek()._type == type.IF){ + expect(type.ELSE, type.IF); + func_body(); + expect(type.END, type.ELSE, type.IF); + } + if(ts.CurrentToken._type == type.ELSE){ + expect(type.ELSE); + func_body(); + expect(type.END, type.ELSE); + } + } + + private void loop_stmt() { + if(ts.CurrentToken._type == type.REPEAT) { + expect(type.REPEAT, type.UNTIL); + cond(); + expect(type.EOL); + func_body(); + expect(type.END, type.REPEAT); + } + else if(ts.CurrentToken._type == type.FOREVER){ + expect(type.FOREVER, type.EOL); + func_body(); + expect(type.END, type.FOREVER); + } + else + System.out.println("u dun goofed"); + //Error + } + + private void func_call() { + expect(type.ID); + if(ts.CurrentToken._type == type.DOT){ + expect(type.DOT, type.ID); + args(); + } + else + args(); + expect(type.EOL); + + } + + private void sig_stmt() { + + } + + private void expr() { + + } + + private void term() { + + } + + private void factor() { + + } + + private void exp() { + + } + + private void cond() { + + } + + private void bool_op() { + + } + + private void bool_end() { + + } + + private void args() { + + } + + private void params() { + + } + +} diff --git a/Scanner/src/java/org/Scanner/ScannerCode.java b/Scanner/src/java/org/Scanner/ScannerCode.java new file mode 100644 index 0000000..fe4408b --- /dev/null +++ b/Scanner/src/java/org/Scanner/ScannerCode.java @@ -0,0 +1,58 @@ +package org.Scanner; + +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.lang.StringBuffer; +import java.util.ArrayList; +import java.util.List; +import java.io.IOException; + +public class ScannerCode +{ + private List WhiteList = new ArrayList (); + String _filePath; + + /* Idéen her er, at FileReaderen er uafhængig af GetToken metoden */ + FileReader inputStream; + + public ScannerCode (String filePath) + { + _filePath = filePath; + + try { + inputStream = new FileReader(_filePath); + } catch (FileNotFoundException e) { + throw e; + } finally { + inputStream.close(); + } + } + public Token GetToken () + { + StringBuffer currentWord = new StringBuffer(); + char currentChar = 'a'; + + return new Token (Token.type.ASSIGN, "kage"); + } + + private void ScanForTokens (FileReader reader) + { + + } + + private boolean isDigit(char c) + { + return '0' <= c && c <= '9'; + } + + private boolean isLetter(char c) { + return 'a' <= c && c <= 'z'; + } + + + private boolean isAGraphicCharacter(char c) + { + if(isLetter(c) || isDigit(c) || c == ' ') return true; + else return false; + } +} diff --git a/Scanner/src/java/org/Scanner/Token.java b/Scanner/src/java/org/Scanner/Token.java new file mode 100644 index 0000000..094db47 --- /dev/null +++ b/Scanner/src/java/org/Scanner/Token.java @@ -0,0 +1,68 @@ +package org.Scanner; + +import com.sun.javafx.fxml.expression.Expression; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.regex.Pattern; + + +public class Token { + + public enum type { + EOF, BREAK, EOL, ROBOT_NAME, LOAD, NUM_DCL, ID, + STRING_DCL, BOOL_DCL, COORD_DCL, REF_DCL, VOID, END, HEAR, + SIGNAL, START, IF, REPEAT, UNTIL, FOREVER, ELSE, VAL, + PLUS, MINUS, TIMES, DIVIDE, ASSIGN, POWER, SQUARE_ROOT, + BOOL_AND, BOOL_OR, BOOL_EQ, BOOL_GT, BOOL_LT, BOOL_GTE, + BOOL_LTE, BOOL_LIT, COORD_LIT, STRING_LIT, DOT, FUNC_CALL + } + + public final type _type; + public final String value; + + /** + * @param t The type of the Token + * @param val The string value of the Token + */ + public Token(type t, String val) { + _type = t; + value = val; + } + + public Token(type t) { + this(t, ""); + } + + public static class TokenPattern { + TokenPattern(type t, String p){ + tokenType = t; + regex = p; + pattern = Pattern.compile(p); + } + public final type tokenType; + public final String regex; + public final Pattern pattern; + } + + public static final ArrayList patternList = new ArrayList(Arrays.asList( + new TokenPattern(type.ASSIGN,"="), + new TokenPattern(type.BOOL_AND,"AND"), + new TokenPattern(type.BOOL_DCL,"BOOL"), + new TokenPattern(type.BOOL_EQ,"IS"), + new TokenPattern(type.BOOL_GT,"GREATER_THAN"), + new TokenPattern(type.BOOL_GTE,"GREATER_THAN_EQUAL"), + new TokenPattern(type.BOOL_LIT,"(TRUE|FALSE)"), + new TokenPattern(type.BOOL_LT,"LESS_THAN"), + new TokenPattern(type.BOOL_LTE,"LESS_THAN_EQUAL"), + new TokenPattern(type.BOOL_OR,"OR"), + new TokenPattern(type.BREAK,"BREAK"), + new TokenPattern(type.COORD_DCL,"COORD"), + new TokenPattern(type.DIVIDE,"/"), + new TokenPattern(type.ELSE,"ELSE"), + new TokenPattern(type.END,"END"), + new TokenPattern(type.EOL,"\n"), + new TokenPattern(type.EOL,"\n") + )); + +} diff --git a/Scanner/src/java/org/Scanner/TokenStream.java b/Scanner/src/java/org/Scanner/TokenStream.java new file mode 100644 index 0000000..fbc19aa --- /dev/null +++ b/Scanner/src/java/org/Scanner/TokenStream.java @@ -0,0 +1,10 @@ +package org.Scanner; + +public class TokenStream { + + public Token CurrentToken; + + public Token Peek(){return new Token();} + + public Token PeekTwo(){return new Token();} +} diff --git a/compiler/src/Main.java b/compiler/src/Main.java new file mode 100644 index 0000000..8e3695c --- /dev/null +++ b/compiler/src/Main.java @@ -0,0 +1,17 @@ +/** + * Created by Lee on 09/03/16. + */ + +import java_cup.*; +import java.io.FileReader; + +public class Main { + + public static void main (String args[]) throws Exception + { + Scanner s = new Scanner(new FileReader("src/cancer")); + parser p = new parser (s); + + p.debug_parse(); + } +} diff --git a/compiler/src/Scanner.java b/compiler/src/Scanner.java new file mode 100644 index 0000000..f9ba83e --- /dev/null +++ b/compiler/src/Scanner.java @@ -0,0 +1,1295 @@ +/* The following code was generated by JFlex 1.6.1 */ + +import java_cup.runtime.*; + + +/** + * This class is a scanner generated by + * JFlex 1.6.1 + * from the specification file /Users/Lee/Documents/P4/compiler/src/java.flex + */ +public class Scanner implements sym, java_cup.runtime.Scanner { + + /** This character denotes the end of file */ + public static final int YYEOF = -1; + + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** lexical states */ + public static final int YYINITIAL = 0; + public static final int STRING = 2; + public static final int CHARLITERAL = 4; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0, 1, 1, 2, 2 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\31\1\3\1\2\1\0\1\3\1\1\16\31\4\0\1\3\1\0"+ + "\1\12\1\0\1\30\2\0\1\13\1\56\1\57\1\5\1\63\1\27"+ + "\1\11\1\7\1\4\12\6\1\60\2\0\1\62\3\0\1\40\1\44"+ + "\1\55\1\35\1\10\1\33\1\43\1\41\1\32\1\30\1\45\1\20"+ + "\1\54\1\34\1\37\1\50\1\53\1\42\1\36\1\46\1\47\1\51"+ + "\1\30\1\61\2\30\1\0\1\14\2\0\1\52\1\0\1\25\3\30"+ + "\1\23\3\30\1\21\2\30\1\26\1\17\1\15\3\30\1\24\1\30"+ + "\1\22\1\16\5\30\3\0\1\64\41\31\2\0\4\30\4\0\1\30"+ + "\2\0\1\31\7\0\1\30\4\0\1\30\5\0\27\30\1\0\37\30"+ + "\1\0\u01ca\30\4\0\14\30\16\0\5\30\7\0\1\30\1\0\1\30"+ + "\21\0\160\31\5\30\1\0\2\30\2\0\4\30\10\0\1\30\1\0"+ + "\3\30\1\0\1\30\1\0\24\30\1\0\123\30\1\0\213\30\1\0"+ + "\5\31\2\0\236\30\11\0\46\30\2\0\1\30\7\0\47\30\11\0"+ + "\55\31\1\0\1\31\1\0\2\31\1\0\2\31\1\0\1\31\10\0"+ + "\33\30\5\0\3\30\15\0\4\31\7\0\1\30\4\0\13\31\5\0"+ + "\53\30\37\31\4\0\2\30\1\31\143\30\1\0\1\30\10\31\1\0"+ + "\6\31\2\30\2\31\1\0\4\31\2\30\12\31\3\30\2\0\1\30"+ + "\17\0\1\31\1\30\1\31\36\30\33\31\2\0\131\30\13\31\1\30"+ + "\16\0\12\31\41\30\11\31\2\30\4\0\1\30\5\0\26\30\4\31"+ + "\1\30\11\31\1\30\3\31\1\30\5\31\22\0\31\30\3\31\244\0"+ + "\4\31\66\30\3\31\1\30\22\31\1\30\7\31\12\30\2\31\2\0"+ + "\12\31\1\0\7\30\1\0\7\30\1\0\3\31\1\0\10\30\2\0"+ + "\2\30\2\0\26\30\1\0\7\30\1\0\1\30\3\0\4\30\2\0"+ + "\1\31\1\30\7\31\2\0\2\31\2\0\3\31\1\30\10\0\1\31"+ + "\4\0\2\30\1\0\3\30\2\31\2\0\12\31\4\30\7\0\1\30"+ + "\5\0\3\31\1\0\6\30\4\0\2\30\2\0\26\30\1\0\7\30"+ + "\1\0\2\30\1\0\2\30\1\0\2\30\2\0\1\31\1\0\5\31"+ + "\4\0\2\31\2\0\3\31\3\0\1\31\7\0\4\30\1\0\1\30"+ + "\7\0\14\31\3\30\1\31\13\0\3\31\1\0\11\30\1\0\3\30"+ + "\1\0\26\30\1\0\7\30\1\0\2\30\1\0\5\30\2\0\1\31"+ + "\1\30\10\31\1\0\3\31\1\0\3\31\2\0\1\30\17\0\2\30"+ + "\2\31\2\0\12\31\1\0\1\30\17\0\3\31\1\0\10\30\2\0"+ + "\2\30\2\0\26\30\1\0\7\30\1\0\2\30\1\0\5\30\2\0"+ + "\1\31\1\30\7\31\2\0\2\31\2\0\3\31\10\0\2\31\4\0"+ + "\2\30\1\0\3\30\2\31\2\0\12\31\1\0\1\30\20\0\1\31"+ + "\1\30\1\0\6\30\3\0\3\30\1\0\4\30\3\0\2\30\1\0"+ + "\1\30\1\0\2\30\3\0\2\30\3\0\3\30\3\0\14\30\4\0"+ + "\5\31\3\0\3\31\1\0\4\31\2\0\1\30\6\0\1\31\16\0"+ + "\12\31\11\0\1\30\7\0\3\31\1\0\10\30\1\0\3\30\1\0"+ + "\27\30\1\0\12\30\1\0\5\30\3\0\1\30\7\31\1\0\3\31"+ + "\1\0\4\31\7\0\2\31\1\0\2\30\6\0\2\30\2\31\2\0"+ + "\12\31\22\0\2\31\1\0\10\30\1\0\3\30\1\0\27\30\1\0"+ + "\12\30\1\0\5\30\2\0\1\31\1\30\7\31\1\0\3\31\1\0"+ + "\4\31\7\0\2\31\7\0\1\30\1\0\2\30\2\31\2\0\12\31"+ + "\1\0\2\30\17\0\2\31\1\0\10\30\1\0\3\30\1\0\51\30"+ + "\2\0\1\30\7\31\1\0\3\31\1\0\4\31\1\30\10\0\1\31"+ + "\10\0\2\30\2\31\2\0\12\31\12\0\6\30\2\0\2\31\1\0"+ + "\22\30\3\0\30\30\1\0\11\30\1\0\1\30\2\0\7\30\3\0"+ + "\1\31\4\0\6\31\1\0\1\31\1\0\10\31\22\0\2\31\15\0"+ + "\60\30\1\31\2\30\7\31\4\0\10\30\10\31\1\0\12\31\47\0"+ + "\2\30\1\0\1\30\2\0\2\30\1\0\1\30\2\0\1\30\6\0"+ + "\4\30\1\0\7\30\1\0\3\30\1\0\1\30\1\0\1\30\2\0"+ + "\2\30\1\0\4\30\1\31\2\30\6\31\1\0\2\31\1\30\2\0"+ + "\5\30\1\0\1\30\1\0\6\31\2\0\12\31\2\0\2\30\42\0"+ + "\1\30\27\0\2\31\6\0\12\31\13\0\1\31\1\0\1\31\1\0"+ + "\1\31\4\0\2\31\10\30\1\0\44\30\4\0\24\31\1\0\2\31"+ + "\5\30\13\31\1\0\44\31\11\0\1\31\71\0\53\30\24\31\1\30"+ + "\12\31\6\0\6\30\4\31\4\30\3\31\1\30\3\31\2\30\7\31"+ + "\3\30\4\31\15\30\14\31\1\30\17\31\2\0\46\30\12\0\53\30"+ + "\1\0\1\30\3\0\u0149\30\1\0\4\30\2\0\7\30\1\0\1\30"+ + "\1\0\4\30\2\0\51\30\1\0\4\30\2\0\41\30\1\0\4\30"+ + "\2\0\7\30\1\0\1\30\1\0\4\30\2\0\17\30\1\0\71\30"+ + "\1\0\4\30\2\0\103\30\2\0\3\31\40\0\20\30\20\0\125\30"+ + "\14\0\u026c\30\2\0\21\30\1\0\32\30\5\0\113\30\3\0\3\30"+ + "\17\0\15\30\1\0\4\30\3\31\13\0\22\30\3\31\13\0\22\30"+ + "\2\31\14\0\15\30\1\0\3\30\1\0\2\31\14\0\64\30\40\31"+ + "\3\0\1\30\3\0\2\30\1\31\2\0\12\31\41\0\3\31\2\0"+ + "\12\31\6\0\130\30\10\0\51\30\1\31\1\30\5\0\106\30\12\0"+ + "\35\30\3\0\14\31\4\0\14\31\12\0\12\31\36\30\2\0\5\30"+ + "\13\0\54\30\4\0\21\31\7\30\2\31\6\0\12\31\46\0\27\30"+ + "\5\31\4\0\65\30\12\31\1\0\35\31\2\0\13\31\6\0\12\31"+ + "\15\0\1\30\130\0\5\31\57\30\21\31\7\30\4\0\12\31\21\0"+ + "\11\31\14\0\3\31\36\30\12\31\3\0\2\30\12\31\6\0\46\30"+ + "\16\31\14\0\44\30\24\31\10\0\12\31\3\0\3\30\12\31\44\30"+ + "\122\0\3\31\1\0\25\31\4\30\1\31\4\30\1\31\15\0\300\30"+ + "\47\31\25\0\4\31\u0116\30\2\0\6\30\2\0\46\30\2\0\6\30"+ + "\2\0\10\30\1\0\1\30\1\0\1\30\1\0\1\30\1\0\37\30"+ + "\2\0\65\30\1\0\7\30\1\0\1\30\3\0\3\30\1\0\7\30"+ + "\3\0\4\30\2\0\6\30\4\0\15\30\5\0\3\30\1\0\7\30"+ + "\16\0\5\31\32\0\5\31\20\0\2\30\23\0\1\30\13\0\5\31"+ + "\5\0\6\31\1\0\1\30\15\0\1\30\20\0\15\30\3\0\32\30"+ + "\26\0\15\31\4\0\1\31\3\0\14\31\21\0\1\30\4\0\1\30"+ + "\2\0\12\30\1\0\1\30\3\0\5\30\6\0\1\30\1\0\1\30"+ + "\1\0\1\30\1\0\4\30\1\0\13\30\2\0\4\30\5\0\5\30"+ + "\4\0\1\30\21\0\51\30\u0a77\0\57\30\1\0\57\30\1\0\205\30"+ + "\6\0\4\30\3\31\16\0\46\30\12\0\66\30\11\0\1\30\17\0"+ + "\1\31\27\30\11\0\7\30\1\0\7\30\1\0\7\30\1\0\7\30"+ + "\1\0\7\30\1\0\7\30\1\0\7\30\1\0\7\30\1\0\40\31"+ + "\57\0\1\30\u01d5\0\3\30\31\0\11\30\6\31\1\0\5\30\2\0"+ + "\5\30\4\0\126\30\2\0\2\31\2\0\3\30\1\0\132\30\1\0"+ + "\4\30\5\0\51\30\3\0\136\30\21\0\33\30\65\0\20\30\u0200\0"+ + "\u19b6\30\112\0\u51cc\30\64\0\u048d\30\103\0\56\30\2\0\u010d\30\3\0"+ + "\20\30\12\31\2\30\24\0\57\30\1\31\14\0\2\31\1\0\31\30"+ + "\10\0\120\30\2\31\45\0\11\30\2\0\147\30\2\0\4\30\1\0"+ + "\2\30\16\0\12\30\120\0\10\30\1\31\3\30\1\31\4\30\1\31"+ + "\27\30\5\31\20\0\1\30\7\0\64\30\14\0\2\31\62\30\21\31"+ + "\13\0\12\31\6\0\22\31\6\30\3\0\1\30\4\0\12\31\34\30"+ + "\10\31\2\0\27\30\15\31\14\0\35\30\3\0\4\31\57\30\16\31"+ + "\16\0\1\30\12\31\46\0\51\30\16\31\11\0\3\30\1\31\10\30"+ + "\2\31\2\0\12\31\6\0\27\30\3\0\1\30\1\31\4\0\60\30"+ + "\1\31\1\30\3\31\2\30\2\31\5\30\2\31\1\30\1\31\1\30"+ + "\30\0\3\30\43\0\6\30\2\0\6\30\2\0\6\30\11\0\7\30"+ + "\1\0\7\30\221\0\43\30\10\31\1\0\2\31\2\0\12\31\6\0"+ + "\u2ba4\30\14\0\27\30\4\0\61\30\u2104\0\u012e\30\2\0\76\30\2\0"+ + "\152\30\46\0\7\30\14\0\5\30\5\0\1\30\1\31\12\30\1\0"+ + "\15\30\1\0\5\30\1\0\1\30\1\0\2\30\1\0\2\30\1\0"+ + "\154\30\41\0\u016b\30\22\0\100\30\2\0\66\30\50\0\15\30\3\0"+ + "\20\31\20\0\7\31\14\0\2\30\30\0\3\30\31\0\1\30\6\0"+ + "\5\30\1\0\207\30\2\0\1\31\4\0\1\30\13\0\12\31\7\0"+ + "\32\30\4\0\1\30\1\0\32\30\13\0\131\30\3\0\6\30\2\0"+ + "\6\30\2\0\6\30\2\0\3\30\3\0\2\30\3\0\2\30\22\0"+ + "\3\31\4\0\14\30\1\0\32\30\1\0\23\30\1\0\2\30\1\0"+ + "\17\30\2\0\16\30\42\0\173\30\105\0\65\30\210\0\1\31\202\0"+ + "\35\30\3\0\61\30\57\0\37\30\21\0\33\30\65\0\36\30\2\0"+ + "\44\30\4\0\10\30\1\0\5\30\52\0\236\30\2\0\12\31\u0356\0"+ + "\6\30\2\0\1\30\1\0\54\30\1\0\2\30\3\0\1\30\2\0"+ + "\27\30\252\0\26\30\12\0\32\30\306\0\1\30\3\31\1\0\2\31"+ + "\5\0\4\31\4\30\1\0\3\30\1\0\33\30\4\0\3\31\4\0"+ + "\1\31\40\0\35\30\203\0\66\30\12\0\26\30\12\0\23\30\215\0"+ + "\111\30\u03b7\0\3\31\65\30\17\31\37\0\12\31\20\0\3\31\55\30"+ + "\13\31\2\0\1\31\u0f42\0\u036f\30\221\0\143\30\u0b9d\0\u042f\30\u33d1\0"+ + "\u0239\30\u45c7\0\2\30\u2163\0\5\31\3\0\26\31\2\0\7\31\36\0"+ + "\4\31\224\0\3\31\u01bb\0\125\30\1\0\107\30\1\0\2\30\2\0"+ + "\1\30\2\0\2\30\2\0\4\30\1\0\14\30\1\0\1\30\1\0"+ + "\7\30\1\0\101\30\1\0\4\30\2\0\10\30\1\0\7\30\1\0"+ + "\34\30\1\0\4\30\1\0\5\30\1\0\1\30\3\0\7\30\1\0"+ + "\u0154\30\2\0\31\30\1\0\31\30\1\0\37\30\1\0\31\30\1\0"+ + "\37\30\1\0\31\30\1\0\37\30\1\0\31\30\1\0\37\30\1\0"+ + "\31\30\1\0\10\30\2\0\62\31\u2800\0\ua6d7\30\51\0\u1035\30\13\0"+ + "\336\30\u3fe2\0\u021e\30\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\u05ee\0"+ + "\1\31\36\0\140\31\200\0\360\31\uffff\0\uffff\0\ufe12\0"; + + /** + * Translates characters to character classes + */ + private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\3\0\1\1\1\2\1\1\1\3\1\4\1\5\1\6"+ + "\1\7\1\10\1\11\1\12\3\7\1\13\16\7\1\14"+ + "\1\15\1\16\1\7\1\17\1\20\1\21\1\22\1\23"+ + "\1\24\1\0\1\5\1\0\6\7\1\25\1\26\6\7"+ + "\1\27\13\7\2\24\1\0\1\5\1\0\1\7\1\30"+ + "\6\7\1\31\1\32\2\7\1\33\12\7\1\34\1\35"+ + "\2\7\1\36\1\37\4\7\1\40\3\7\1\41\1\7"+ + "\1\42\1\7\1\43\4\7\1\44\5\7\1\45\1\46"+ + "\1\47\3\7\1\50\1\51\1\52\1\53\3\7\1\54"+ + "\5\7\1\55\4\7\1\0\2\7\1\0\1\7\1\56"+ + "\1\0\2\7\1\0\2\7\1\0\2\7\1\0\2\7"+ + "\1\0\2\7\1\0\2\7\1\0\2\7\1\0\2\7"+ + "\1\0\1\57\1\7\1\0\1\7\1\0\1\7\1\0"+ + "\1\60\7\0\1\61"; + + private static int [] zzUnpackAction() { + int [] result = new int[199]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\65\0\152\0\237\0\324\0\324\0\u0109\0\324"+ + "\0\u013e\0\u0173\0\u01a8\0\324\0\324\0\324\0\u01dd\0\u0212"+ + "\0\u0247\0\324\0\u027c\0\u02b1\0\u02e6\0\u031b\0\u0350\0\u0385"+ + "\0\u03ba\0\u03ef\0\u0424\0\u0459\0\u048e\0\u04c3\0\u04f8\0\u052d"+ + "\0\324\0\324\0\324\0\u0562\0\324\0\324\0\324\0\u0597"+ + "\0\324\0\u05cc\0\u0601\0\u0636\0\u066b\0\u06a0\0\u06d5\0\u070a"+ + "\0\u073f\0\u0774\0\u07a9\0\u0212\0\u0212\0\u07de\0\u0813\0\u0848"+ + "\0\u087d\0\u08b2\0\u08e7\0\u0212\0\u091c\0\u0951\0\u0986\0\u09bb"+ + "\0\u09f0\0\u0a25\0\u0a5a\0\u0a8f\0\u0ac4\0\u0af9\0\u0b2e\0\u0b63"+ + "\0\324\0\u0b98\0\u0bcd\0\u0bcd\0\u0c02\0\u0212\0\u0c37\0\u0c6c"+ + "\0\u0ca1\0\u0cd6\0\u0d0b\0\u0d40\0\u0212\0\u0212\0\u0d75\0\u0daa"+ + "\0\u0212\0\u0ddf\0\u0e14\0\u0e49\0\u0e7e\0\u0eb3\0\u0ee8\0\u0f1d"+ + "\0\u0f52\0\u0f87\0\u0fbc\0\u0212\0\u0212\0\u0ff1\0\u1026\0\u0212"+ + "\0\u0212\0\u105b\0\u1090\0\u10c5\0\u10fa\0\u0212\0\u112f\0\u1164"+ + "\0\u1199\0\u0212\0\u11ce\0\u0212\0\u1203\0\u0212\0\u1238\0\u126d"+ + "\0\u12a2\0\u12d7\0\u0212\0\u130c\0\u1341\0\u1376\0\u13ab\0\u13e0"+ + "\0\u0212\0\u0212\0\u0212\0\u1415\0\u144a\0\u147f\0\u0212\0\u0212"+ + "\0\u0212\0\u0212\0\u14b4\0\u14e9\0\u151e\0\u0212\0\u1553\0\u1588"+ + "\0\u15bd\0\u15f2\0\u1627\0\u165c\0\u1691\0\u16c6\0\u16fb\0\u1730"+ + "\0\u1765\0\u179a\0\u17cf\0\u1804\0\u1839\0\u186e\0\u18a3\0\u18d8"+ + "\0\u190d\0\u1942\0\u1977\0\u19ac\0\u19e1\0\u1a16\0\u1a4b\0\u1a80"+ + "\0\u1ab5\0\u1aea\0\u1b1f\0\u1b54\0\u1b89\0\u1bbe\0\u1bf3\0\u1c28"+ + "\0\u1c5d\0\u1c92\0\u1cc7\0\u1cfc\0\u1d31\0\u1d66\0\u1d9b\0\u0212"+ + "\0\u1dd0\0\u1e05\0\u1e3a\0\u1e6f\0\u1ea4\0\u1ed9\0\u0212\0\u1f0e"+ + "\0\u1f43\0\u1f78\0\u1fad\0\u1fe2\0\u2017\0\u204c\0\324"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[199]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\1\0\1\4\1\5\1\6\1\7\1\10\1\11\1\12"+ + "\1\13\1\14\1\15\1\16\1\0\1\17\2\20\1\21"+ + "\6\20\1\22\1\20\1\0\1\23\1\24\1\25\1\20"+ + "\1\26\1\27\1\30\1\31\1\32\1\33\1\34\1\20"+ + "\1\35\1\36\1\20\1\37\3\20\1\40\1\41\1\42"+ + "\1\43\1\44\1\45\1\46\1\47\1\50\2\0\7\50"+ + "\1\51\1\50\1\0\50\50\64\0\1\47\2\0\1\6"+ + "\153\0\1\52\1\53\65\0\1\11\1\54\1\55\12\0"+ + "\1\55\47\0\1\54\64\0\1\20\1\0\1\20\4\0"+ + "\3\20\1\56\6\20\1\0\4\20\1\57\21\20\3\0"+ + "\1\20\11\0\1\20\1\0\1\20\4\0\1\20\1\60"+ + "\10\20\1\0\26\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\12\20\1\0\26\20\3\0\1\20\11\0"+ + "\1\20\1\0\1\61\4\0\12\20\1\0\2\20\1\62"+ + "\4\20\1\63\16\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\12\20\1\0\3\20\1\64\2\20\1\65"+ + "\17\20\3\0\1\20\11\0\1\20\1\0\1\20\4\0"+ + "\12\20\1\0\7\20\1\66\1\67\15\20\3\0\1\20"+ + "\11\0\1\20\1\0\1\20\4\0\12\20\1\0\7\20"+ + "\1\70\7\20\1\71\6\20\3\0\1\20\11\0\1\20"+ + "\1\0\1\20\4\0\12\20\1\0\2\20\1\72\13\20"+ + "\1\73\7\20\3\0\1\20\11\0\1\20\1\0\1\20"+ + "\4\0\12\20\1\0\12\20\1\74\13\20\3\0\1\20"+ + "\11\0\1\20\1\0\1\20\4\0\12\20\1\0\4\20"+ + "\1\75\21\20\3\0\1\20\11\0\1\20\1\0\1\76"+ + "\4\0\12\20\1\0\26\20\3\0\1\20\11\0\1\20"+ + "\1\0\1\77\4\0\12\20\1\0\26\20\3\0\1\20"+ + "\11\0\1\20\1\0\1\20\4\0\12\20\1\0\12\20"+ + "\1\100\13\20\3\0\1\20\11\0\1\20\1\0\1\20"+ + "\4\0\12\20\1\0\7\20\1\101\2\20\1\102\13\20"+ + "\3\0\1\20\11\0\1\20\1\0\1\20\4\0\12\20"+ + "\1\0\12\20\1\103\13\20\3\0\1\20\11\0\1\20"+ + "\1\0\1\20\4\0\12\20\1\0\4\20\1\104\21\20"+ + "\3\0\1\20\11\0\1\20\1\0\1\20\4\0\12\20"+ + "\1\0\7\20\1\105\16\20\3\0\1\20\11\0\1\20"+ + "\1\0\1\20\4\0\12\20\1\0\7\20\1\106\16\20"+ + "\3\0\1\20\11\0\1\20\1\0\1\20\4\0\12\20"+ + "\1\0\7\20\1\107\16\20\3\0\1\20\3\0\1\50"+ + "\2\0\7\50\1\0\1\50\1\0\50\50\1\52\1\110"+ + "\1\111\62\52\5\53\1\112\57\53\6\0\1\54\1\0"+ + "\1\55\12\0\1\55\47\0\1\113\2\0\1\114\51\0"+ + "\1\114\7\0\1\20\1\0\1\20\4\0\12\20\1\0"+ + "\6\20\1\115\17\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\12\20\1\0\5\20\1\116\20\20\3\0"+ + "\1\20\11\0\1\20\1\0\1\20\4\0\2\20\1\117"+ + "\7\20\1\0\26\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\12\20\1\0\6\20\1\120\17\20\3\0"+ + "\1\20\11\0\1\20\1\0\1\20\4\0\12\20\1\0"+ + "\6\20\1\121\17\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\12\20\1\0\10\20\1\122\15\20\3\0"+ + "\1\20\11\0\1\20\1\0\1\20\4\0\12\20\1\0"+ + "\12\20\1\123\13\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\3\20\1\124\6\20\1\0\26\20\3\0"+ + "\1\20\11\0\1\20\1\0\1\20\4\0\12\20\1\0"+ + "\16\20\1\125\7\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\12\20\1\0\24\20\1\126\1\20\3\0"+ + "\1\20\11\0\1\20\1\0\1\20\4\0\12\20\1\0"+ + "\13\20\1\127\12\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\12\20\1\0\12\20\1\130\13\20\3\0"+ + "\1\20\11\0\1\20\1\0\1\20\4\0\12\20\1\0"+ + "\5\20\1\131\20\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\12\20\1\0\10\20\1\132\15\20\3\0"+ + "\1\20\11\0\1\20\1\0\1\20\4\0\12\20\1\0"+ + "\16\20\1\133\1\20\1\134\5\20\3\0\1\20\11\0"+ + "\1\20\1\0\1\135\4\0\12\20\1\0\26\20\3\0"+ + "\1\20\11\0\1\20\1\0\1\20\4\0\12\20\1\0"+ + "\7\20\1\136\16\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\137\4\0\12\20\1\0\26\20\3\0\1\20\11\0"+ + "\1\20\1\0\1\20\4\0\12\20\1\0\17\20\1\140"+ + "\6\20\3\0\1\20\11\0\1\20\1\0\1\20\4\0"+ + "\12\20\1\0\16\20\1\141\7\20\3\0\1\20\11\0"+ + "\1\20\1\0\1\20\4\0\12\20\1\0\2\20\1\142"+ + "\23\20\3\0\1\20\11\0\1\20\1\0\1\20\4\0"+ + "\12\20\1\0\7\20\1\143\16\20\3\0\1\20\11\0"+ + "\1\20\1\0\1\20\4\0\12\20\1\0\12\20\1\144"+ + "\13\20\3\0\1\20\5\0\1\111\62\0\4\53\1\111"+ + "\1\112\57\53\6\0\1\113\64\0\1\20\1\0\1\145"+ + "\4\0\12\20\1\0\26\20\3\0\1\20\11\0\1\20"+ + "\1\0\1\20\4\0\3\20\1\146\6\20\1\0\26\20"+ + "\3\0\1\20\11\0\1\20\1\0\1\20\4\0\12\20"+ + "\1\0\6\20\1\147\17\20\3\0\1\20\11\0\1\20"+ + "\1\0\1\20\4\0\12\20\1\0\16\20\1\150\7\20"+ + "\3\0\1\20\11\0\1\20\1\0\1\20\4\0\12\20"+ + "\1\0\5\20\1\151\20\20\3\0\1\20\11\0\1\20"+ + "\1\0\1\152\4\0\12\20\1\0\26\20\3\0\1\20"+ + "\11\0\1\20\1\0\1\20\4\0\12\20\1\0\6\20"+ + "\1\153\17\20\3\0\1\20\11\0\1\20\1\0\1\20"+ + "\4\0\12\20\1\0\4\20\1\154\21\20\3\0\1\20"+ + "\11\0\1\20\1\0\1\20\4\0\12\20\1\0\2\20"+ + "\1\155\23\20\3\0\1\20\11\0\1\20\1\0\1\20"+ + "\4\0\12\20\1\0\12\20\1\156\13\20\3\0\1\20"+ + "\11\0\1\20\1\0\1\20\4\0\12\20\1\0\17\20"+ + "\1\157\6\20\3\0\1\20\11\0\1\20\1\0\1\160"+ + "\4\0\12\20\1\0\26\20\3\0\1\20\11\0\1\20"+ + "\1\0\1\20\4\0\12\20\1\0\10\20\1\161\15\20"+ + "\3\0\1\20\11\0\1\20\1\0\1\20\4\0\3\20"+ + "\1\162\6\20\1\0\26\20\3\0\1\20\11\0\1\20"+ + "\1\0\1\20\4\0\12\20\1\0\10\20\1\163\15\20"+ + "\3\0\1\20\11\0\1\20\1\0\1\164\4\0\12\20"+ + "\1\0\26\20\3\0\1\20\11\0\1\20\1\0\1\20"+ + "\4\0\12\20\1\0\2\20\1\165\23\20\3\0\1\20"+ + "\11\0\1\20\1\0\1\20\4\0\12\20\1\0\5\20"+ + "\1\166\20\20\3\0\1\20\11\0\1\20\1\0\1\20"+ + "\4\0\12\20\1\0\12\20\1\167\13\20\3\0\1\20"+ + "\11\0\1\20\1\0\1\20\4\0\4\20\1\170\5\20"+ + "\1\0\26\20\3\0\1\20\11\0\1\20\1\0\1\20"+ + "\4\0\12\20\1\0\22\20\1\171\3\20\3\0\1\20"+ + "\11\0\1\20\1\0\1\20\4\0\12\20\1\0\21\20"+ + "\1\172\4\20\3\0\1\20\11\0\1\20\1\0\1\173"+ + "\4\0\12\20\1\0\26\20\3\0\1\20\11\0\1\20"+ + "\1\0\1\20\4\0\12\20\1\0\10\20\1\174\15\20"+ + "\3\0\1\20\11\0\1\20\1\0\1\20\4\0\12\20"+ + "\1\0\4\20\1\175\21\20\3\0\1\20\11\0\1\20"+ + "\1\0\1\20\4\0\12\20\1\0\12\20\1\176\13\20"+ + "\3\0\1\20\11\0\1\20\1\0\1\20\4\0\12\20"+ + "\1\0\10\20\1\177\15\20\3\0\1\20\11\0\1\20"+ + "\1\0\1\20\4\0\12\20\1\0\16\20\1\200\7\20"+ + "\3\0\1\20\11\0\1\20\1\0\1\20\4\0\12\20"+ + "\1\0\15\20\1\201\10\20\3\0\1\20\11\0\1\20"+ + "\1\0\1\20\4\0\3\20\1\202\6\20\1\0\26\20"+ + "\3\0\1\20\11\0\1\20\1\0\1\20\4\0\12\20"+ + "\1\0\5\20\1\203\20\20\3\0\1\20\11\0\1\20"+ + "\1\0\1\20\4\0\5\20\1\204\4\20\1\0\26\20"+ + "\3\0\1\20\11\0\1\20\1\0\1\20\4\0\12\20"+ + "\1\0\16\20\1\205\7\20\3\0\1\20\11\0\1\20"+ + "\1\0\1\206\4\0\12\20\1\0\26\20\3\0\1\20"+ + "\11\0\1\20\1\0\1\20\4\0\3\20\1\207\6\20"+ + "\1\0\26\20\3\0\1\20\11\0\1\20\1\0\1\20"+ + "\4\0\12\20\1\0\13\20\1\210\12\20\3\0\1\20"+ + "\11\0\1\20\1\0\1\20\4\0\12\20\1\0\4\20"+ + "\1\211\21\20\3\0\1\20\11\0\1\20\1\0\1\20"+ + "\4\0\12\20\1\0\16\20\1\212\7\20\3\0\1\20"+ + "\11\0\1\20\1\0\1\213\4\0\12\20\1\0\26\20"+ + "\3\0\1\20\11\0\1\20\1\0\1\20\4\0\6\20"+ + "\1\214\3\20\1\0\26\20\3\0\1\20\11\0\1\20"+ + "\1\0\1\20\4\0\12\20\1\0\11\20\1\215\14\20"+ + "\3\0\1\20\11\0\1\20\1\0\1\20\4\0\12\20"+ + "\1\0\12\20\1\216\13\20\3\0\1\20\11\0\1\20"+ + "\1\0\1\20\4\0\12\20\1\0\12\20\1\217\13\20"+ + "\3\0\1\20\11\0\1\20\1\0\1\20\4\0\7\20"+ + "\1\220\2\20\1\0\26\20\3\0\1\20\11\0\1\20"+ + "\1\0\1\20\4\0\12\20\1\0\10\20\1\221\15\20"+ + "\3\0\1\20\11\0\1\20\1\0\1\20\4\0\12\20"+ + "\1\0\22\20\1\222\3\20\3\0\1\20\11\0\1\20"+ + "\1\0\1\20\4\0\10\20\1\223\1\20\1\0\26\20"+ + "\3\0\1\20\11\0\1\20\1\0\1\20\4\0\12\20"+ + "\1\0\4\20\1\224\21\20\3\0\1\20\11\0\1\20"+ + "\1\0\1\20\4\0\12\20\1\0\16\20\1\225\7\20"+ + "\3\0\1\20\11\0\1\20\1\0\1\20\4\0\11\20"+ + "\1\226\1\0\26\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\12\20\1\0\22\20\1\227\3\20\3\0"+ + "\1\20\11\0\1\20\1\0\1\20\4\0\12\20\1\0"+ + "\11\20\1\230\14\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\12\20\1\231\26\20\3\0\1\20\11\0"+ + "\1\20\1\0\1\20\4\0\12\20\1\0\7\20\1\232"+ + "\16\20\3\0\1\20\11\0\1\20\1\0\1\20\4\0"+ + "\12\20\1\0\10\20\1\233\15\20\3\0\1\20\20\0"+ + "\1\234\55\0\1\20\1\0\1\20\4\0\12\20\1\0"+ + "\12\20\1\235\13\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\12\20\1\0\4\20\1\236\21\20\3\0"+ + "\1\20\21\0\1\237\54\0\1\20\1\0\1\20\4\0"+ + "\12\20\1\0\22\20\1\240\3\20\3\0\1\20\11\0"+ + "\1\20\1\0\1\20\4\0\12\20\1\0\22\20\1\241"+ + "\3\20\3\0\1\20\22\0\1\242\53\0\1\20\1\0"+ + "\1\243\4\0\12\20\1\0\26\20\3\0\1\20\11\0"+ + "\1\20\1\0\1\20\4\0\12\20\1\0\7\20\1\244"+ + "\16\20\3\0\1\20\23\0\1\245\52\0\1\20\1\0"+ + "\1\20\4\0\12\20\1\0\23\20\1\246\2\20\3\0"+ + "\1\20\11\0\1\20\1\0\1\20\4\0\12\20\1\0"+ + "\12\20\1\247\13\20\3\0\1\20\24\0\1\250\51\0"+ + "\1\20\1\0\1\20\4\0\12\20\1\0\17\20\1\251"+ + "\6\20\3\0\1\20\11\0\1\20\1\0\1\20\4\0"+ + "\12\20\1\0\22\20\1\252\3\20\3\0\1\20\25\0"+ + "\1\253\50\0\1\20\1\0\1\20\4\0\12\20\1\0"+ + "\10\20\1\254\15\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\255\4\0\12\20\1\0\26\20\3\0\1\20\26\0"+ + "\1\256\47\0\1\20\1\0\1\20\4\0\3\20\1\257"+ + "\6\20\1\0\26\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\12\20\1\0\23\20\1\260\2\20\3\0"+ + "\1\20\27\0\1\261\46\0\1\20\1\0\1\20\4\0"+ + "\12\20\1\0\22\20\1\262\3\20\3\0\1\20\11\0"+ + "\1\20\1\0\1\20\4\0\12\20\1\0\17\20\1\263"+ + "\6\20\3\0\1\20\30\0\1\264\45\0\1\20\1\0"+ + "\1\20\4\0\12\20\1\0\16\20\1\265\7\20\3\0"+ + "\1\20\11\0\1\20\1\0\1\20\4\0\12\20\1\0"+ + "\10\20\1\266\15\20\3\0\1\20\31\0\1\267\44\0"+ + "\1\20\1\0\1\20\4\0\12\20\1\0\7\20\1\270"+ + "\16\20\3\0\1\20\11\0\1\20\1\0\1\20\4\0"+ + "\3\20\1\271\6\20\1\0\26\20\3\0\1\20\32\0"+ + "\1\272\43\0\1\20\1\0\1\20\4\0\12\20\1\0"+ + "\22\20\1\273\3\20\3\0\1\20\20\0\1\274\55\0"+ + "\1\20\1\0\1\20\4\0\12\20\1\0\16\20\1\275"+ + "\7\20\3\0\1\20\21\0\1\276\54\0\1\20\1\0"+ + "\1\20\4\0\12\20\1\0\7\20\1\277\16\20\3\0"+ + "\1\20\22\0\1\300\65\0\1\301\65\0\1\302\65\0"+ + "\1\303\65\0\1\304\65\0\1\305\65\0\1\306\65\0"+ + "\1\307\36\0"; + + private static int [] zzUnpackTrans() { + int [] result = new int[8321]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unknown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\3\0\1\1\2\11\1\1\1\11\3\1\3\11\3\1"+ + "\1\11\16\1\3\11\1\1\3\11\1\1\1\11\1\1"+ + "\1\0\1\1\1\0\33\1\1\11\1\0\1\1\1\0"+ + "\114\1\1\0\2\1\1\0\2\1\1\0\2\1\1\0"+ + "\2\1\1\0\2\1\1\0\2\1\1\0\2\1\1\0"+ + "\2\1\1\0\2\1\1\0\2\1\1\0\2\1\1\0"+ + "\1\1\1\0\1\1\1\0\1\1\7\0\1\11"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[199]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** the input device */ + private java.io.Reader zzReader; + + /** the current state of the DFA */ + private int zzState; + + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; + + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** the textposition at the last accepting state */ + private int zzMarkedPos; + + /** the current text position in the buffer */ + private int zzCurrentPos; + + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; + + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; + + /** number of newlines encountered up to the start of the matched text */ + private int yyline; + + /** the number of characters up to the start of the matched text */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; + + /** + * The number of occupied positions in zzBuffer beyond zzEndRead. + * When a lead/high surrogate has been read from the input stream + * into the final zzBuffer position, this will have a value of 1; + * otherwise, it will have a value of 0. + */ + private int zzFinalHighSurrogate = 0; + + /* user code: */ + StringBuilder string = new StringBuilder(); + + private Symbol symbol(int type) { + return new Symbol(type, yyline+1, yycolumn+1); + } + + private Symbol symbol(int type, Object value) { + return new Symbol(type, yyline+1, yycolumn+1, value); + } + + /** + * assumes correct representation of a long value for + * specified radix in scanner buffer from start + * to end + */ + private long parseLong(int start, int end, int radix) { + long result = 0; + long digit; + + for (int i = start; i < end; i++) { + digit = Character.digit(yycharat(i),radix); + result*= radix; + result+= digit; + } + + return result; + } + + + /** + * Creates a new scanner + * + * @param in the java.io.Reader to read input from. + */ + public Scanner(java.io.Reader in) { + this.zzReader = in; + } + + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char [] zzUnpackCMap(String packed) { + char [] map = new char[0x110000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 2626) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + zzEndRead += zzFinalHighSurrogate; + zzFinalHighSurrogate = 0; + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead-zzStartRead); + + /* translate stored positions */ + zzEndRead-= zzStartRead; + zzCurrentPos-= zzStartRead; + zzMarkedPos-= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length - zzFinalHighSurrogate) { + /* if not: blow it up */ + char newBuffer[] = new char[zzBuffer.length*2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + zzEndRead += zzFinalHighSurrogate; + zzFinalHighSurrogate = 0; + } + + /* fill the buffer with new input */ + int requested = zzBuffer.length - zzEndRead; + int numRead = zzReader.read(zzBuffer, zzEndRead, requested); + + /* not supposed to occur according to specification of java.io.Reader */ + if (numRead == 0) { + throw new java.io.IOException("Reader returned 0 characters. See JFlex examples for workaround."); + } + if (numRead > 0) { + zzEndRead += numRead; + /* If numRead == requested, we might have requested to few chars to + encode a full Unicode character. We assume that a Reader would + otherwise never return half characters. */ + if (numRead == requested) { + if (Character.isHighSurrogate(zzBuffer[zzEndRead - 1])) { + --zzEndRead; + zzFinalHighSurrogate = 1; + } + } + /* potentially more input available */ + return false; + } + + /* numRead < 0 ==> end of stream */ + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + * + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * Internal scan buffer is resized down to its initial length, if it has grown. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + zzFinalHighSurrogate = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + if (zzBuffer.length > ZZ_BUFFERSIZE) + zzBuffer = new char[ZZ_BUFFERSIZE]; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); + } + + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead+pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Contains user EOF-code, which will be executed exactly once, + * when the end of file is reached + */ + private void zzDoEOF() throws java.io.IOException { + if (!zzEOFDone) { + zzEOFDone = true; + yyclose(); + } + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public java_cup.runtime.Symbol next_token() throws java.io.IOException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + boolean zzR = false; + int zzCh; + int zzCharCount; + for (zzCurrentPosL = zzStartRead ; + zzCurrentPosL < zzMarkedPosL ; + zzCurrentPosL += zzCharCount ) { + zzCh = Character.codePointAt(zzBufferL, zzCurrentPosL, zzMarkedPosL); + zzCharCount = Character.charCount(zzCh); + switch (zzCh) { + case '\u000B': + case '\u000C': + case '\u0085': + case '\u2028': + case '\u2029': + yyline++; + yycolumn = 0; + zzR = false; + break; + case '\r': + yyline++; + yycolumn = 0; + zzR = true; + break; + case '\n': + if (zzR) + zzR = false; + else { + yyline++; + yycolumn = 0; + } + break; + default: + zzR = false; + yycolumn += zzCharCount; + } + } + + if (zzR) { + // peek one character ahead if it is \n (if we have counted one line too much) + boolean zzPeek; + if (zzMarkedPosL < zzEndReadL) + zzPeek = zzBufferL[zzMarkedPosL] == '\n'; + else if (zzAtEOF) + zzPeek = false; + else { + boolean eof = zzRefill(); + zzEndReadL = zzEndRead; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + if (eof) + zzPeek = false; + else + zzPeek = zzBufferL[zzMarkedPosL] == '\n'; + } + if (zzPeek) yyline--; + } + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + // set up zzAction for empty match case: + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + } + + + zzForAction: { + while (true) { + + if (zzCurrentPosL < zzEndReadL) { + zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL, zzEndReadL); + zzCurrentPosL += Character.charCount(zzInput); + } + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } + else { + zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL, zzEndReadL); + zzCurrentPosL += Character.charCount(zzInput); + } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + zzDoEOF(); + { return symbol(EOF); + } + } + else { + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 1: + { /*Ignore*/ + } + case 50: break; + case 2: + { return symbol(EOL); + } + case 51: break; + case 3: + { return symbol(DIV); + } + case 52: break; + case 4: + { return symbol(MULT); + } + case 53: break; + case 5: + { return symbol(NumLit, new Double(yytext())); + } + case 54: break; + case 6: + { return symbol(DOT); + } + case 55: break; + case 7: + { return symbol(Identifier, yytext()); + } + case 56: break; + case 8: + { return symbol(MINUS); + } + case 57: break; + case 9: + { yybegin(STRING); string.setLength(0); + } + case 58: break; + case 10: + { yybegin(CHARLITERAL); + } + case 59: break; + case 11: + { return symbol(COMMA); + } + case 60: break; + case 12: + { return symbol(LPAREN); + } + case 61: break; + case 13: + { return symbol(RPAREN); + } + case 62: break; + case 14: + { return symbol(COLON); + } + case 63: break; + case 15: + { return symbol(ASSIGN); + } + case 64: break; + case 16: + { return symbol(PLUS); + } + case 65: break; + case 17: + { throw new RuntimeException("Illegal character \""+yytext()+ + "\" at line "+yyline+", column "+yycolumn); + } + case 66: break; + case 18: + { string.append( yytext() ); + } + case 67: break; + case 19: + { yybegin(YYINITIAL); return symbol(StringLit, string.toString()); + } + case 68: break; + case 20: + { /* ignore */ + } + case 69: break; + case 21: + { return symbol(IF); + } + case 70: break; + case 22: + { return symbol(IS); + } + case 71: break; + case 23: + { return symbol(OR); + } + case 72: break; + case 24: + { return symbol(END); + } + case 73: break; + case 25: + { return symbol(NOT); + } + case 74: break; + case 26: + { return symbol(NUM); + } + case 75: break; + case 27: + { return symbol(AND); + } + case 76: break; + case 28: + { return symbol(XOR); + } + case 77: break; + case 29: + { return symbol(ELSE); + } + case 78: break; + case 30: + { return symbol(LIST); + } + case 79: break; + case 31: + { return symbol(LOAD); + } + case 80: break; + case 32: + { return symbol(HEAR); + } + case 81: break; + case 33: + { return symbol(BOOL); + } + case 82: break; + case 34: + { return symbol(TRUE); + } + case 83: break; + case 35: + { return symbol(VOID); + } + case 84: break; + case 36: + { return symbol(FALSE); + } + case 85: break; + case 37: + { return symbol(BREAK); + } + case 86: break; + case 38: + { return symbol(UNTIL); + } + case 87: break; + case 39: + { return symbol(COORD); + } + case 88: break; + case 40: + { return symbol(SIGNAL); + } + case 89: break; + case 41: + { return symbol(STRING); + } + case 90: break; + case 42: + { return symbol(RETURN); + } + case 91: break; + case 43: + { return symbol(REPEAT); + } + case 92: break; + case 44: + { return symbol(FOREVER); + } + case 93: break; + case 45: + { return symbol(LT); + } + case 94: break; + case 46: + { return symbol(GT); + } + case 95: break; + case 47: + { return symbol(LTE); + } + case 96: break; + case 48: + { return symbol(GTE); + } + case 97: break; + case 49: + { return symbol(CoordLit); + } + case 98: break; + default: + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + /** + * Converts an int token code into the name of the + * token by reflection on the cup symbol class/interface sym + * + * This code was contributed by Karl Meissner + */ + private String getTokenName(int token) { + try { + java.lang.reflect.Field [] classFields = sym.class.getFields(); + for (int i = 0; i < classFields.length; i++) { + if (classFields[i].getInt(null) == token) { + return classFields[i].getName(); + } + } + } catch (Exception e) { + e.printStackTrace(System.err); + } + + return "UNKNOWN TOKEN"; + } + + /** + * Same as next_token but also prints the token to standard out + * for debugging. + * + * This code was contributed by Karl Meissner + */ + public java_cup.runtime.Symbol debug_next_token() throws java.io.IOException { + java_cup.runtime.Symbol s = next_token(); + System.out.println( "line:" + (yyline+1) + " col:" + (yycolumn+1) + " --"+ yytext() + "--" + getTokenName(s.sym) + "--"); + return s; + } + + /** + * Runs the scanner on input files. + * + * This main method is the debugging routine for the scanner. + * It prints debugging information about each returned token to + * System.out until the end of file is reached, or an error occured. + * + * @param argv the command line, contains the filenames to run + * the scanner on. + */ + public static void main(String argv[]) { + if (argv.length == 0) { + System.out.println("Usage : java Scanner [ --encoding ] "); + } + else { + int firstFilePos = 0; + String encodingName = "UTF-8"; + if (argv[0].equals("--encoding")) { + firstFilePos = 2; + encodingName = argv[1]; + try { + java.nio.charset.Charset.forName(encodingName); // Side-effect: is encodingName valid? + } catch (Exception e) { + System.out.println("Invalid encoding '" + encodingName + "'"); + return; + } + } + for (int i = firstFilePos; i < argv.length; i++) { + Scanner scanner = null; + try { + java.io.FileInputStream stream = new java.io.FileInputStream(argv[i]); + java.io.Reader reader = new java.io.InputStreamReader(stream, encodingName); + scanner = new Scanner(reader); + while ( !scanner.zzAtEOF ) scanner.debug_next_token(); + } + catch (java.io.FileNotFoundException e) { + System.out.println("File not found : \""+argv[i]+"\""); + } + catch (java.io.IOException e) { + System.out.println("IO error scanning file \""+argv[i]+"\""); + System.out.println(e); + } + catch (Exception e) { + System.out.println("Unexpected exception:"); + e.printStackTrace(); + } + } + } + } + + +} diff --git a/compiler/src/Scanner.java~ b/compiler/src/Scanner.java~ new file mode 100644 index 0000000..d442327 --- /dev/null +++ b/compiler/src/Scanner.java~ @@ -0,0 +1,1251 @@ +/* The following code was generated by JFlex 1.6.1 */ + +import java_cup.runtime.*; + + +/** + * This class is a scanner generated by + * JFlex 1.6.1 + * from the specification file /Users/Lee/Documents/P4/compiler/src/java.flex + */ +public class Scanner implements sym, java_cup.runtime.Scanner { + + /** This character denotes the end of file */ + public static final int YYEOF = -1; + + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** lexical states */ + public static final int YYINITIAL = 0; + public static final int STRING = 2; + public static final int CHARLITERAL = 4; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0, 1, 1, 2, 2 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\31\1\3\1\2\1\0\1\3\1\1\16\31\4\0\1\3\1\0"+ + "\1\12\1\0\1\30\2\0\1\13\1\54\1\55\1\5\1\61\1\27"+ + "\1\11\1\7\1\4\12\6\1\56\2\0\1\60\3\0\1\40\1\44"+ + "\1\30\1\35\1\10\1\33\1\43\1\41\1\32\1\30\1\45\1\20"+ + "\1\30\1\34\1\37\1\50\1\53\1\42\1\36\1\46\1\47\1\51"+ + "\1\30\1\57\2\30\1\0\1\14\2\0\1\52\1\0\1\25\3\30"+ + "\1\23\3\30\1\21\2\30\1\26\1\17\1\15\3\30\1\24\1\30"+ + "\1\22\1\16\5\30\3\0\1\62\41\31\2\0\4\30\4\0\1\30"+ + "\2\0\1\31\7\0\1\30\4\0\1\30\5\0\27\30\1\0\37\30"+ + "\1\0\u01ca\30\4\0\14\30\16\0\5\30\7\0\1\30\1\0\1\30"+ + "\21\0\160\31\5\30\1\0\2\30\2\0\4\30\10\0\1\30\1\0"+ + "\3\30\1\0\1\30\1\0\24\30\1\0\123\30\1\0\213\30\1\0"+ + "\5\31\2\0\236\30\11\0\46\30\2\0\1\30\7\0\47\30\11\0"+ + "\55\31\1\0\1\31\1\0\2\31\1\0\2\31\1\0\1\31\10\0"+ + "\33\30\5\0\3\30\15\0\4\31\7\0\1\30\4\0\13\31\5\0"+ + "\53\30\37\31\4\0\2\30\1\31\143\30\1\0\1\30\10\31\1\0"+ + "\6\31\2\30\2\31\1\0\4\31\2\30\12\31\3\30\2\0\1\30"+ + "\17\0\1\31\1\30\1\31\36\30\33\31\2\0\131\30\13\31\1\30"+ + "\16\0\12\31\41\30\11\31\2\30\4\0\1\30\5\0\26\30\4\31"+ + "\1\30\11\31\1\30\3\31\1\30\5\31\22\0\31\30\3\31\244\0"+ + "\4\31\66\30\3\31\1\30\22\31\1\30\7\31\12\30\2\31\2\0"+ + "\12\31\1\0\7\30\1\0\7\30\1\0\3\31\1\0\10\30\2\0"+ + "\2\30\2\0\26\30\1\0\7\30\1\0\1\30\3\0\4\30\2\0"+ + "\1\31\1\30\7\31\2\0\2\31\2\0\3\31\1\30\10\0\1\31"+ + "\4\0\2\30\1\0\3\30\2\31\2\0\12\31\4\30\7\0\1\30"+ + "\5\0\3\31\1\0\6\30\4\0\2\30\2\0\26\30\1\0\7\30"+ + "\1\0\2\30\1\0\2\30\1\0\2\30\2\0\1\31\1\0\5\31"+ + "\4\0\2\31\2\0\3\31\3\0\1\31\7\0\4\30\1\0\1\30"+ + "\7\0\14\31\3\30\1\31\13\0\3\31\1\0\11\30\1\0\3\30"+ + "\1\0\26\30\1\0\7\30\1\0\2\30\1\0\5\30\2\0\1\31"+ + "\1\30\10\31\1\0\3\31\1\0\3\31\2\0\1\30\17\0\2\30"+ + "\2\31\2\0\12\31\1\0\1\30\17\0\3\31\1\0\10\30\2\0"+ + "\2\30\2\0\26\30\1\0\7\30\1\0\2\30\1\0\5\30\2\0"+ + "\1\31\1\30\7\31\2\0\2\31\2\0\3\31\10\0\2\31\4\0"+ + "\2\30\1\0\3\30\2\31\2\0\12\31\1\0\1\30\20\0\1\31"+ + "\1\30\1\0\6\30\3\0\3\30\1\0\4\30\3\0\2\30\1\0"+ + "\1\30\1\0\2\30\3\0\2\30\3\0\3\30\3\0\14\30\4\0"+ + "\5\31\3\0\3\31\1\0\4\31\2\0\1\30\6\0\1\31\16\0"+ + "\12\31\11\0\1\30\7\0\3\31\1\0\10\30\1\0\3\30\1\0"+ + "\27\30\1\0\12\30\1\0\5\30\3\0\1\30\7\31\1\0\3\31"+ + "\1\0\4\31\7\0\2\31\1\0\2\30\6\0\2\30\2\31\2\0"+ + "\12\31\22\0\2\31\1\0\10\30\1\0\3\30\1\0\27\30\1\0"+ + "\12\30\1\0\5\30\2\0\1\31\1\30\7\31\1\0\3\31\1\0"+ + "\4\31\7\0\2\31\7\0\1\30\1\0\2\30\2\31\2\0\12\31"+ + "\1\0\2\30\17\0\2\31\1\0\10\30\1\0\3\30\1\0\51\30"+ + "\2\0\1\30\7\31\1\0\3\31\1\0\4\31\1\30\10\0\1\31"+ + "\10\0\2\30\2\31\2\0\12\31\12\0\6\30\2\0\2\31\1\0"+ + "\22\30\3\0\30\30\1\0\11\30\1\0\1\30\2\0\7\30\3\0"+ + "\1\31\4\0\6\31\1\0\1\31\1\0\10\31\22\0\2\31\15\0"+ + "\60\30\1\31\2\30\7\31\4\0\10\30\10\31\1\0\12\31\47\0"+ + "\2\30\1\0\1\30\2\0\2\30\1\0\1\30\2\0\1\30\6\0"+ + "\4\30\1\0\7\30\1\0\3\30\1\0\1\30\1\0\1\30\2\0"+ + "\2\30\1\0\4\30\1\31\2\30\6\31\1\0\2\31\1\30\2\0"+ + "\5\30\1\0\1\30\1\0\6\31\2\0\12\31\2\0\2\30\42\0"+ + "\1\30\27\0\2\31\6\0\12\31\13\0\1\31\1\0\1\31\1\0"+ + "\1\31\4\0\2\31\10\30\1\0\44\30\4\0\24\31\1\0\2\31"+ + "\5\30\13\31\1\0\44\31\11\0\1\31\71\0\53\30\24\31\1\30"+ + "\12\31\6\0\6\30\4\31\4\30\3\31\1\30\3\31\2\30\7\31"+ + "\3\30\4\31\15\30\14\31\1\30\17\31\2\0\46\30\12\0\53\30"+ + "\1\0\1\30\3\0\u0149\30\1\0\4\30\2\0\7\30\1\0\1\30"+ + "\1\0\4\30\2\0\51\30\1\0\4\30\2\0\41\30\1\0\4\30"+ + "\2\0\7\30\1\0\1\30\1\0\4\30\2\0\17\30\1\0\71\30"+ + "\1\0\4\30\2\0\103\30\2\0\3\31\40\0\20\30\20\0\125\30"+ + "\14\0\u026c\30\2\0\21\30\1\0\32\30\5\0\113\30\3\0\3\30"+ + "\17\0\15\30\1\0\4\30\3\31\13\0\22\30\3\31\13\0\22\30"+ + "\2\31\14\0\15\30\1\0\3\30\1\0\2\31\14\0\64\30\40\31"+ + "\3\0\1\30\3\0\2\30\1\31\2\0\12\31\41\0\3\31\2\0"+ + "\12\31\6\0\130\30\10\0\51\30\1\31\1\30\5\0\106\30\12\0"+ + "\35\30\3\0\14\31\4\0\14\31\12\0\12\31\36\30\2\0\5\30"+ + "\13\0\54\30\4\0\21\31\7\30\2\31\6\0\12\31\46\0\27\30"+ + "\5\31\4\0\65\30\12\31\1\0\35\31\2\0\13\31\6\0\12\31"+ + "\15\0\1\30\130\0\5\31\57\30\21\31\7\30\4\0\12\31\21\0"+ + "\11\31\14\0\3\31\36\30\12\31\3\0\2\30\12\31\6\0\46\30"+ + "\16\31\14\0\44\30\24\31\10\0\12\31\3\0\3\30\12\31\44\30"+ + "\122\0\3\31\1\0\25\31\4\30\1\31\4\30\1\31\15\0\300\30"+ + "\47\31\25\0\4\31\u0116\30\2\0\6\30\2\0\46\30\2\0\6\30"+ + "\2\0\10\30\1\0\1\30\1\0\1\30\1\0\1\30\1\0\37\30"+ + "\2\0\65\30\1\0\7\30\1\0\1\30\3\0\3\30\1\0\7\30"+ + "\3\0\4\30\2\0\6\30\4\0\15\30\5\0\3\30\1\0\7\30"+ + "\16\0\5\31\32\0\5\31\20\0\2\30\23\0\1\30\13\0\5\31"+ + "\5\0\6\31\1\0\1\30\15\0\1\30\20\0\15\30\3\0\32\30"+ + "\26\0\15\31\4\0\1\31\3\0\14\31\21\0\1\30\4\0\1\30"+ + "\2\0\12\30\1\0\1\30\3\0\5\30\6\0\1\30\1\0\1\30"+ + "\1\0\1\30\1\0\4\30\1\0\13\30\2\0\4\30\5\0\5\30"+ + "\4\0\1\30\21\0\51\30\u0a77\0\57\30\1\0\57\30\1\0\205\30"+ + "\6\0\4\30\3\31\16\0\46\30\12\0\66\30\11\0\1\30\17\0"+ + "\1\31\27\30\11\0\7\30\1\0\7\30\1\0\7\30\1\0\7\30"+ + "\1\0\7\30\1\0\7\30\1\0\7\30\1\0\7\30\1\0\40\31"+ + "\57\0\1\30\u01d5\0\3\30\31\0\11\30\6\31\1\0\5\30\2\0"+ + "\5\30\4\0\126\30\2\0\2\31\2\0\3\30\1\0\132\30\1\0"+ + "\4\30\5\0\51\30\3\0\136\30\21\0\33\30\65\0\20\30\u0200\0"+ + "\u19b6\30\112\0\u51cc\30\64\0\u048d\30\103\0\56\30\2\0\u010d\30\3\0"+ + "\20\30\12\31\2\30\24\0\57\30\1\31\14\0\2\31\1\0\31\30"+ + "\10\0\120\30\2\31\45\0\11\30\2\0\147\30\2\0\4\30\1\0"+ + "\2\30\16\0\12\30\120\0\10\30\1\31\3\30\1\31\4\30\1\31"+ + "\27\30\5\31\20\0\1\30\7\0\64\30\14\0\2\31\62\30\21\31"+ + "\13\0\12\31\6\0\22\31\6\30\3\0\1\30\4\0\12\31\34\30"+ + "\10\31\2\0\27\30\15\31\14\0\35\30\3\0\4\31\57\30\16\31"+ + "\16\0\1\30\12\31\46\0\51\30\16\31\11\0\3\30\1\31\10\30"+ + "\2\31\2\0\12\31\6\0\27\30\3\0\1\30\1\31\4\0\60\30"+ + "\1\31\1\30\3\31\2\30\2\31\5\30\2\31\1\30\1\31\1\30"+ + "\30\0\3\30\43\0\6\30\2\0\6\30\2\0\6\30\11\0\7\30"+ + "\1\0\7\30\221\0\43\30\10\31\1\0\2\31\2\0\12\31\6\0"+ + "\u2ba4\30\14\0\27\30\4\0\61\30\u2104\0\u012e\30\2\0\76\30\2\0"+ + "\152\30\46\0\7\30\14\0\5\30\5\0\1\30\1\31\12\30\1\0"+ + "\15\30\1\0\5\30\1\0\1\30\1\0\2\30\1\0\2\30\1\0"+ + "\154\30\41\0\u016b\30\22\0\100\30\2\0\66\30\50\0\15\30\3\0"+ + "\20\31\20\0\7\31\14\0\2\30\30\0\3\30\31\0\1\30\6\0"+ + "\5\30\1\0\207\30\2\0\1\31\4\0\1\30\13\0\12\31\7\0"+ + "\32\30\4\0\1\30\1\0\32\30\13\0\131\30\3\0\6\30\2\0"+ + "\6\30\2\0\6\30\2\0\3\30\3\0\2\30\3\0\2\30\22\0"+ + "\3\31\4\0\14\30\1\0\32\30\1\0\23\30\1\0\2\30\1\0"+ + "\17\30\2\0\16\30\42\0\173\30\105\0\65\30\210\0\1\31\202\0"+ + "\35\30\3\0\61\30\57\0\37\30\21\0\33\30\65\0\36\30\2\0"+ + "\44\30\4\0\10\30\1\0\5\30\52\0\236\30\2\0\12\31\u0356\0"+ + "\6\30\2\0\1\30\1\0\54\30\1\0\2\30\3\0\1\30\2\0"+ + "\27\30\252\0\26\30\12\0\32\30\306\0\1\30\3\31\1\0\2\31"+ + "\5\0\4\31\4\30\1\0\3\30\1\0\33\30\4\0\3\31\4\0"+ + "\1\31\40\0\35\30\203\0\66\30\12\0\26\30\12\0\23\30\215\0"+ + "\111\30\u03b7\0\3\31\65\30\17\31\37\0\12\31\20\0\3\31\55\30"+ + "\13\31\2\0\1\31\u0f42\0\u036f\30\221\0\143\30\u0b9d\0\u042f\30\u33d1\0"+ + "\u0239\30\u45c7\0\2\30\u2163\0\5\31\3\0\26\31\2\0\7\31\36\0"+ + "\4\31\224\0\3\31\u01bb\0\125\30\1\0\107\30\1\0\2\30\2\0"+ + "\1\30\2\0\2\30\2\0\4\30\1\0\14\30\1\0\1\30\1\0"+ + "\7\30\1\0\101\30\1\0\4\30\2\0\10\30\1\0\7\30\1\0"+ + "\34\30\1\0\4\30\1\0\5\30\1\0\1\30\3\0\7\30\1\0"+ + "\u0154\30\2\0\31\30\1\0\31\30\1\0\37\30\1\0\31\30\1\0"+ + "\37\30\1\0\31\30\1\0\37\30\1\0\31\30\1\0\37\30\1\0"+ + "\31\30\1\0\10\30\2\0\62\31\u2800\0\ua6d7\30\51\0\u1035\30\13\0"+ + "\336\30\u3fe2\0\u021e\30\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\u05ee\0"+ + "\1\31\36\0\140\31\200\0\360\31\uffff\0\uffff\0\ufe12\0"; + + /** + * Translates characters to character classes + */ + private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\3\0\1\1\1\2\1\1\1\3\1\4\1\5\1\6"+ + "\1\7\1\10\1\11\1\12\3\7\1\13\15\7\1\14"+ + "\1\15\1\16\1\7\1\17\1\20\1\21\1\22\1\23"+ + "\1\24\1\0\1\5\1\0\5\7\1\25\1\26\4\7"+ + "\1\27\11\7\2\24\1\0\1\5\1\0\1\7\1\30"+ + "\5\7\1\31\1\7\1\32\10\7\1\33\1\34\2\7"+ + "\1\35\3\7\1\36\4\7\1\37\1\7\1\40\3\7"+ + "\1\41\4\7\1\42\1\43\3\7\1\44\1\45\1\46"+ + "\3\7\1\47\5\7\1\50\4\7\1\0\2\7\1\0"+ + "\1\7\1\51\1\0\2\7\1\0\2\7\1\0\2\7"+ + "\1\0\2\7\1\0\2\7\1\0\2\7\1\0\2\7"+ + "\1\0\2\7\1\0\1\52\1\7\1\0\1\7\1\0"+ + "\1\7\1\0\1\53\7\0\1\54"; + + private static int [] zzUnpackAction() { + int [] result = new int[181]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\63\0\146\0\231\0\314\0\314\0\377\0\314"+ + "\0\u0132\0\u0165\0\u0198\0\314\0\314\0\314\0\u01cb\0\u01fe"+ + "\0\u0231\0\314\0\u0264\0\u0297\0\u02ca\0\u02fd\0\u0330\0\u0363"+ + "\0\u0396\0\u03c9\0\u03fc\0\u042f\0\u0462\0\u0495\0\u04c8\0\314"+ + "\0\314\0\314\0\u04fb\0\314\0\314\0\314\0\u052e\0\314"+ + "\0\u0561\0\u0594\0\u05c7\0\u05fa\0\u062d\0\u0660\0\u0693\0\u06c6"+ + "\0\u06f9\0\u01fe\0\u01fe\0\u072c\0\u075f\0\u0792\0\u07c5\0\u01fe"+ + "\0\u07f8\0\u082b\0\u085e\0\u0891\0\u08c4\0\u08f7\0\u092a\0\u095d"+ + "\0\u0990\0\u09c3\0\314\0\u09f6\0\u0a29\0\u0a29\0\u0a5c\0\u01fe"+ + "\0\u0a8f\0\u0ac2\0\u0af5\0\u0b28\0\u0b5b\0\u01fe\0\u0b8e\0\u01fe"+ + "\0\u0bc1\0\u0bf4\0\u0c27\0\u0c5a\0\u0c8d\0\u0cc0\0\u0cf3\0\u0d26"+ + "\0\u01fe\0\u01fe\0\u0d59\0\u0d8c\0\u01fe\0\u0dbf\0\u0df2\0\u0e25"+ + "\0\u01fe\0\u0e58\0\u0e8b\0\u0ebe\0\u0ef1\0\u01fe\0\u0f24\0\u01fe"+ + "\0\u0f57\0\u0f8a\0\u0fbd\0\u01fe\0\u0ff0\0\u1023\0\u1056\0\u1089"+ + "\0\u01fe\0\u01fe\0\u10bc\0\u10ef\0\u1122\0\u01fe\0\u01fe\0\u01fe"+ + "\0\u1155\0\u1188\0\u11bb\0\u01fe\0\u11ee\0\u1221\0\u1254\0\u1287"+ + "\0\u12ba\0\u12ed\0\u1320\0\u1353\0\u1386\0\u13b9\0\u13ec\0\u141f"+ + "\0\u1452\0\u1485\0\u14b8\0\u14eb\0\u151e\0\u1551\0\u1584\0\u15b7"+ + "\0\u15ea\0\u161d\0\u1650\0\u1683\0\u16b6\0\u16e9\0\u171c\0\u174f"+ + "\0\u1782\0\u17b5\0\u17e8\0\u181b\0\u184e\0\u1881\0\u18b4\0\u18e7"+ + "\0\u191a\0\u194d\0\u1980\0\u19b3\0\u19e6\0\u01fe\0\u1a19\0\u1a4c"+ + "\0\u1a7f\0\u1ab2\0\u1ae5\0\u1b18\0\u01fe\0\u1b4b\0\u1b7e\0\u1bb1"+ + "\0\u1be4\0\u1c17\0\u1c4a\0\u1c7d\0\314"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[181]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\1\0\1\4\1\5\1\6\1\7\1\10\1\11\1\12"+ + "\1\13\1\14\1\15\1\16\1\0\1\17\2\20\1\21"+ + "\6\20\1\22\1\20\1\0\1\23\1\24\1\25\1\20"+ + "\1\26\1\27\1\30\1\31\1\32\1\33\1\34\1\20"+ + "\1\35\1\36\1\20\1\37\2\20\1\40\1\41\1\42"+ + "\1\43\1\44\1\45\1\46\1\47\2\0\7\47\1\50"+ + "\1\47\1\0\46\47\62\0\1\46\2\0\1\6\147\0"+ + "\1\51\1\52\63\0\1\11\1\53\1\54\12\0\1\54"+ + "\45\0\1\53\62\0\1\20\1\0\1\20\4\0\3\20"+ + "\1\55\6\20\1\0\4\20\1\56\17\20\3\0\1\20"+ + "\11\0\1\20\1\0\1\20\4\0\1\20\1\57\10\20"+ + "\1\0\24\20\3\0\1\20\11\0\1\20\1\0\1\20"+ + "\4\0\12\20\1\0\24\20\3\0\1\20\11\0\1\20"+ + "\1\0\1\60\4\0\12\20\1\0\7\20\1\61\14\20"+ + "\3\0\1\20\11\0\1\20\1\0\1\20\4\0\12\20"+ + "\1\0\3\20\1\62\2\20\1\63\15\20\3\0\1\20"+ + "\11\0\1\20\1\0\1\20\4\0\12\20\1\0\7\20"+ + "\1\64\1\65\13\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\12\20\1\0\7\20\1\66\14\20\3\0"+ + "\1\20\11\0\1\20\1\0\1\20\4\0\12\20\1\0"+ + "\2\20\1\67\21\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\12\20\1\0\12\20\1\70\11\20\3\0"+ + "\1\20\11\0\1\20\1\0\1\20\4\0\12\20\1\0"+ + "\4\20\1\71\17\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\72\4\0\12\20\1\0\24\20\3\0\1\20\11\0"+ + "\1\20\1\0\1\73\4\0\12\20\1\0\24\20\3\0"+ + "\1\20\11\0\1\20\1\0\1\20\4\0\12\20\1\0"+ + "\12\20\1\74\11\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\12\20\1\0\12\20\1\75\11\20\3\0"+ + "\1\20\11\0\1\20\1\0\1\20\4\0\12\20\1\0"+ + "\12\20\1\76\11\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\12\20\1\0\4\20\1\77\17\20\3\0"+ + "\1\20\11\0\1\20\1\0\1\20\4\0\12\20\1\0"+ + "\7\20\1\100\14\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\12\20\1\0\7\20\1\101\14\20\3\0"+ + "\1\20\3\0\1\47\2\0\7\47\1\0\1\47\1\0"+ + "\46\47\1\51\1\102\1\103\60\51\5\52\1\104\55\52"+ + "\6\0\1\53\1\0\1\54\12\0\1\54\45\0\1\105"+ + "\2\0\1\106\47\0\1\106\7\0\1\20\1\0\1\20"+ + "\4\0\12\20\1\0\6\20\1\107\15\20\3\0\1\20"+ + "\11\0\1\20\1\0\1\20\4\0\12\20\1\0\5\20"+ + "\1\110\16\20\3\0\1\20\11\0\1\20\1\0\1\20"+ + "\4\0\2\20\1\111\7\20\1\0\24\20\3\0\1\20"+ + "\11\0\1\20\1\0\1\20\4\0\12\20\1\0\6\20"+ + "\1\112\15\20\3\0\1\20\11\0\1\20\1\0\1\20"+ + "\4\0\12\20\1\0\10\20\1\113\13\20\3\0\1\20"+ + "\11\0\1\20\1\0\1\20\4\0\12\20\1\0\12\20"+ + "\1\114\11\20\3\0\1\20\11\0\1\20\1\0\1\20"+ + "\4\0\3\20\1\115\6\20\1\0\24\20\3\0\1\20"+ + "\11\0\1\20\1\0\1\20\4\0\12\20\1\0\16\20"+ + "\1\116\5\20\3\0\1\20\11\0\1\20\1\0\1\20"+ + "\4\0\12\20\1\0\13\20\1\117\10\20\3\0\1\20"+ + "\11\0\1\20\1\0\1\20\4\0\12\20\1\0\5\20"+ + "\1\120\16\20\3\0\1\20\11\0\1\20\1\0\1\20"+ + "\4\0\12\20\1\0\10\20\1\121\13\20\3\0\1\20"+ + "\11\0\1\20\1\0\1\20\4\0\12\20\1\0\16\20"+ + "\1\122\1\20\1\123\3\20\3\0\1\20\11\0\1\20"+ + "\1\0\1\124\4\0\12\20\1\0\24\20\3\0\1\20"+ + "\11\0\1\20\1\0\1\125\4\0\12\20\1\0\24\20"+ + "\3\0\1\20\11\0\1\20\1\0\1\20\4\0\12\20"+ + "\1\0\17\20\1\126\4\20\3\0\1\20\11\0\1\20"+ + "\1\0\1\20\4\0\12\20\1\0\16\20\1\127\5\20"+ + "\3\0\1\20\11\0\1\20\1\0\1\20\4\0\12\20"+ + "\1\0\2\20\1\130\21\20\3\0\1\20\11\0\1\20"+ + "\1\0\1\20\4\0\12\20\1\0\12\20\1\131\11\20"+ + "\3\0\1\20\5\0\1\103\60\0\4\52\1\103\1\104"+ + "\55\52\6\0\1\105\62\0\1\20\1\0\1\132\4\0"+ + "\12\20\1\0\24\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\3\20\1\133\6\20\1\0\24\20\3\0"+ + "\1\20\11\0\1\20\1\0\1\20\4\0\12\20\1\0"+ + "\6\20\1\134\15\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\12\20\1\0\5\20\1\135\16\20\3\0"+ + "\1\20\11\0\1\20\1\0\1\136\4\0\12\20\1\0"+ + "\24\20\3\0\1\20\11\0\1\20\1\0\1\20\4\0"+ + "\12\20\1\0\6\20\1\137\15\20\3\0\1\20\11\0"+ + "\1\20\1\0\1\20\4\0\12\20\1\0\4\20\1\140"+ + "\17\20\3\0\1\20\11\0\1\20\1\0\1\20\4\0"+ + "\12\20\1\0\12\20\1\141\11\20\3\0\1\20\11\0"+ + "\1\20\1\0\1\20\4\0\12\20\1\0\17\20\1\142"+ + "\4\20\3\0\1\20\11\0\1\20\1\0\1\143\4\0"+ + "\12\20\1\0\24\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\12\20\1\0\10\20\1\144\13\20\3\0"+ + "\1\20\11\0\1\20\1\0\1\20\4\0\12\20\1\0"+ + "\10\20\1\145\13\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\146\4\0\12\20\1\0\24\20\3\0\1\20\11\0"+ + "\1\20\1\0\1\20\4\0\12\20\1\0\2\20\1\147"+ + "\21\20\3\0\1\20\11\0\1\20\1\0\1\20\4\0"+ + "\12\20\1\0\5\20\1\150\16\20\3\0\1\20\11\0"+ + "\1\20\1\0\1\20\4\0\4\20\1\151\5\20\1\0"+ + "\24\20\3\0\1\20\11\0\1\20\1\0\1\20\4\0"+ + "\12\20\1\0\22\20\1\152\1\20\3\0\1\20\11\0"+ + "\1\20\1\0\1\20\4\0\12\20\1\0\21\20\1\153"+ + "\2\20\3\0\1\20\11\0\1\20\1\0\1\154\4\0"+ + "\12\20\1\0\24\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\12\20\1\0\10\20\1\155\13\20\3\0"+ + "\1\20\11\0\1\20\1\0\1\20\4\0\12\20\1\0"+ + "\12\20\1\156\11\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\12\20\1\0\10\20\1\157\13\20\3\0"+ + "\1\20\11\0\1\20\1\0\1\20\4\0\12\20\1\0"+ + "\16\20\1\160\5\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\12\20\1\0\15\20\1\161\6\20\3\0"+ + "\1\20\11\0\1\20\1\0\1\20\4\0\3\20\1\162"+ + "\6\20\1\0\24\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\5\20\1\163\4\20\1\0\24\20\3\0"+ + "\1\20\11\0\1\20\1\0\1\20\4\0\12\20\1\0"+ + "\16\20\1\164\5\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\165\4\0\12\20\1\0\24\20\3\0\1\20\11\0"+ + "\1\20\1\0\1\20\4\0\3\20\1\166\6\20\1\0"+ + "\24\20\3\0\1\20\11\0\1\20\1\0\1\20\4\0"+ + "\12\20\1\0\4\20\1\167\17\20\3\0\1\20\11\0"+ + "\1\20\1\0\1\20\4\0\12\20\1\0\16\20\1\170"+ + "\5\20\3\0\1\20\11\0\1\20\1\0\1\171\4\0"+ + "\12\20\1\0\24\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\6\20\1\172\3\20\1\0\24\20\3\0"+ + "\1\20\11\0\1\20\1\0\1\20\4\0\12\20\1\0"+ + "\11\20\1\173\12\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\12\20\1\0\12\20\1\174\11\20\3\0"+ + "\1\20\11\0\1\20\1\0\1\20\4\0\12\20\1\0"+ + "\12\20\1\175\11\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\7\20\1\176\2\20\1\0\24\20\3\0"+ + "\1\20\11\0\1\20\1\0\1\20\4\0\12\20\1\0"+ + "\10\20\1\177\13\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\12\20\1\0\22\20\1\200\1\20\3\0"+ + "\1\20\11\0\1\20\1\0\1\20\4\0\10\20\1\201"+ + "\1\20\1\0\24\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\12\20\1\0\4\20\1\202\17\20\3\0"+ + "\1\20\11\0\1\20\1\0\1\20\4\0\12\20\1\0"+ + "\16\20\1\203\5\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\11\20\1\204\1\0\24\20\3\0\1\20"+ + "\11\0\1\20\1\0\1\20\4\0\12\20\1\0\22\20"+ + "\1\205\1\20\3\0\1\20\11\0\1\20\1\0\1\20"+ + "\4\0\12\20\1\0\11\20\1\206\12\20\3\0\1\20"+ + "\11\0\1\20\1\0\1\20\4\0\12\20\1\207\24\20"+ + "\3\0\1\20\11\0\1\20\1\0\1\20\4\0\12\20"+ + "\1\0\7\20\1\210\14\20\3\0\1\20\11\0\1\20"+ + "\1\0\1\20\4\0\12\20\1\0\10\20\1\211\13\20"+ + "\3\0\1\20\20\0\1\212\53\0\1\20\1\0\1\20"+ + "\4\0\12\20\1\0\12\20\1\213\11\20\3\0\1\20"+ + "\11\0\1\20\1\0\1\20\4\0\12\20\1\0\4\20"+ + "\1\214\17\20\3\0\1\20\21\0\1\215\52\0\1\20"+ + "\1\0\1\20\4\0\12\20\1\0\22\20\1\216\1\20"+ + "\3\0\1\20\11\0\1\20\1\0\1\20\4\0\12\20"+ + "\1\0\22\20\1\217\1\20\3\0\1\20\22\0\1\220"+ + "\51\0\1\20\1\0\1\221\4\0\12\20\1\0\24\20"+ + "\3\0\1\20\11\0\1\20\1\0\1\20\4\0\12\20"+ + "\1\0\7\20\1\222\14\20\3\0\1\20\23\0\1\223"+ + "\50\0\1\20\1\0\1\20\4\0\12\20\1\0\23\20"+ + "\1\224\3\0\1\20\11\0\1\20\1\0\1\20\4\0"+ + "\12\20\1\0\12\20\1\225\11\20\3\0\1\20\24\0"+ + "\1\226\47\0\1\20\1\0\1\20\4\0\12\20\1\0"+ + "\17\20\1\227\4\20\3\0\1\20\11\0\1\20\1\0"+ + "\1\20\4\0\12\20\1\0\22\20\1\230\1\20\3\0"+ + "\1\20\25\0\1\231\46\0\1\20\1\0\1\20\4\0"+ + "\12\20\1\0\10\20\1\232\13\20\3\0\1\20\11\0"+ + "\1\20\1\0\1\233\4\0\12\20\1\0\24\20\3\0"+ + "\1\20\26\0\1\234\45\0\1\20\1\0\1\20\4\0"+ + "\3\20\1\235\6\20\1\0\24\20\3\0\1\20\11\0"+ + "\1\20\1\0\1\20\4\0\12\20\1\0\23\20\1\236"+ + "\3\0\1\20\27\0\1\237\44\0\1\20\1\0\1\20"+ + "\4\0\12\20\1\0\22\20\1\240\1\20\3\0\1\20"+ + "\11\0\1\20\1\0\1\20\4\0\12\20\1\0\17\20"+ + "\1\241\4\20\3\0\1\20\30\0\1\242\43\0\1\20"+ + "\1\0\1\20\4\0\12\20\1\0\16\20\1\243\5\20"+ + "\3\0\1\20\11\0\1\20\1\0\1\20\4\0\12\20"+ + "\1\0\10\20\1\244\13\20\3\0\1\20\31\0\1\245"+ + "\42\0\1\20\1\0\1\20\4\0\12\20\1\0\7\20"+ + "\1\246\14\20\3\0\1\20\11\0\1\20\1\0\1\20"+ + "\4\0\3\20\1\247\6\20\1\0\24\20\3\0\1\20"+ + "\32\0\1\250\41\0\1\20\1\0\1\20\4\0\12\20"+ + "\1\0\22\20\1\251\1\20\3\0\1\20\20\0\1\252"+ + "\53\0\1\20\1\0\1\20\4\0\12\20\1\0\16\20"+ + "\1\253\5\20\3\0\1\20\21\0\1\254\52\0\1\20"+ + "\1\0\1\20\4\0\12\20\1\0\7\20\1\255\14\20"+ + "\3\0\1\20\22\0\1\256\63\0\1\257\63\0\1\260"+ + "\63\0\1\261\63\0\1\262\63\0\1\263\63\0\1\264"+ + "\63\0\1\265\34\0"; + + private static int [] zzUnpackTrans() { + int [] result = new int[7344]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unknown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\3\0\1\1\2\11\1\1\1\11\3\1\3\11\3\1"+ + "\1\11\15\1\3\11\1\1\3\11\1\1\1\11\1\1"+ + "\1\0\1\1\1\0\26\1\1\11\1\0\1\1\1\0"+ + "\100\1\1\0\2\1\1\0\2\1\1\0\2\1\1\0"+ + "\2\1\1\0\2\1\1\0\2\1\1\0\2\1\1\0"+ + "\2\1\1\0\2\1\1\0\2\1\1\0\2\1\1\0"+ + "\1\1\1\0\1\1\1\0\1\1\7\0\1\11"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[181]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** the input device */ + private java.io.Reader zzReader; + + /** the current state of the DFA */ + private int zzState; + + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; + + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** the textposition at the last accepting state */ + private int zzMarkedPos; + + /** the current text position in the buffer */ + private int zzCurrentPos; + + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; + + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; + + /** number of newlines encountered up to the start of the matched text */ + private int yyline; + + /** the number of characters up to the start of the matched text */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; + + /** + * The number of occupied positions in zzBuffer beyond zzEndRead. + * When a lead/high surrogate has been read from the input stream + * into the final zzBuffer position, this will have a value of 1; + * otherwise, it will have a value of 0. + */ + private int zzFinalHighSurrogate = 0; + + /* user code: */ + StringBuilder string = new StringBuilder(); + + private Symbol symbol(int type) { + return new Symbol(type, yyline+1, yycolumn+1); + } + + private Symbol symbol(int type, Object value) { + return new Symbol(type, yyline+1, yycolumn+1, value); + } + + /** + * assumes correct representation of a long value for + * specified radix in scanner buffer from start + * to end + */ + private long parseLong(int start, int end, int radix) { + long result = 0; + long digit; + + for (int i = start; i < end; i++) { + digit = Character.digit(yycharat(i),radix); + result*= radix; + result+= digit; + } + + return result; + } + + + /** + * Creates a new scanner + * + * @param in the java.io.Reader to read input from. + */ + public Scanner(java.io.Reader in) { + this.zzReader = in; + } + + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char [] zzUnpackCMap(String packed) { + char [] map = new char[0x110000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 2626) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + zzEndRead += zzFinalHighSurrogate; + zzFinalHighSurrogate = 0; + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead-zzStartRead); + + /* translate stored positions */ + zzEndRead-= zzStartRead; + zzCurrentPos-= zzStartRead; + zzMarkedPos-= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length - zzFinalHighSurrogate) { + /* if not: blow it up */ + char newBuffer[] = new char[zzBuffer.length*2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + zzEndRead += zzFinalHighSurrogate; + zzFinalHighSurrogate = 0; + } + + /* fill the buffer with new input */ + int requested = zzBuffer.length - zzEndRead; + int numRead = zzReader.read(zzBuffer, zzEndRead, requested); + + /* not supposed to occur according to specification of java.io.Reader */ + if (numRead == 0) { + throw new java.io.IOException("Reader returned 0 characters. See JFlex examples for workaround."); + } + if (numRead > 0) { + zzEndRead += numRead; + /* If numRead == requested, we might have requested to few chars to + encode a full Unicode character. We assume that a Reader would + otherwise never return half characters. */ + if (numRead == requested) { + if (Character.isHighSurrogate(zzBuffer[zzEndRead - 1])) { + --zzEndRead; + zzFinalHighSurrogate = 1; + } + } + /* potentially more input available */ + return false; + } + + /* numRead < 0 ==> end of stream */ + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + * + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * Internal scan buffer is resized down to its initial length, if it has grown. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + zzFinalHighSurrogate = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + if (zzBuffer.length > ZZ_BUFFERSIZE) + zzBuffer = new char[ZZ_BUFFERSIZE]; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); + } + + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead+pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Contains user EOF-code, which will be executed exactly once, + * when the end of file is reached + */ + private void zzDoEOF() throws java.io.IOException { + if (!zzEOFDone) { + zzEOFDone = true; + yyclose(); + } + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public java_cup.runtime.Symbol next_token() throws java.io.IOException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + boolean zzR = false; + int zzCh; + int zzCharCount; + for (zzCurrentPosL = zzStartRead ; + zzCurrentPosL < zzMarkedPosL ; + zzCurrentPosL += zzCharCount ) { + zzCh = Character.codePointAt(zzBufferL, zzCurrentPosL, zzMarkedPosL); + zzCharCount = Character.charCount(zzCh); + switch (zzCh) { + case '\u000B': + case '\u000C': + case '\u0085': + case '\u2028': + case '\u2029': + yyline++; + yycolumn = 0; + zzR = false; + break; + case '\r': + yyline++; + yycolumn = 0; + zzR = true; + break; + case '\n': + if (zzR) + zzR = false; + else { + yyline++; + yycolumn = 0; + } + break; + default: + zzR = false; + yycolumn += zzCharCount; + } + } + + if (zzR) { + // peek one character ahead if it is \n (if we have counted one line too much) + boolean zzPeek; + if (zzMarkedPosL < zzEndReadL) + zzPeek = zzBufferL[zzMarkedPosL] == '\n'; + else if (zzAtEOF) + zzPeek = false; + else { + boolean eof = zzRefill(); + zzEndReadL = zzEndRead; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + if (eof) + zzPeek = false; + else + zzPeek = zzBufferL[zzMarkedPosL] == '\n'; + } + if (zzPeek) yyline--; + } + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + // set up zzAction for empty match case: + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + } + + + zzForAction: { + while (true) { + + if (zzCurrentPosL < zzEndReadL) { + zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL, zzEndReadL); + zzCurrentPosL += Character.charCount(zzInput); + } + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } + else { + zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL, zzEndReadL); + zzCurrentPosL += Character.charCount(zzInput); + } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + zzDoEOF(); + { return symbol(EOF); + } + } + else { + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 1: + { /*Ignore*/ + } + case 45: break; + case 2: + { return symbol(EOL); + } + case 46: break; + case 3: + { return symbol(DIV); + } + case 47: break; + case 4: + { return symbol(MULT); + } + case 48: break; + case 5: + { return symbol(NumLit, new Double(yytext())); + } + case 49: break; + case 6: + { return symbol(DOT); + } + case 50: break; + case 7: + { return symbol(Identifier, yytext()); + } + case 51: break; + case 8: + { return symbol(MINUS); + } + case 52: break; + case 9: + { yybegin(STRING); string.setLength(0); + } + case 53: break; + case 10: + { yybegin(CHARLITERAL); + } + case 54: break; + case 11: + { return symbol(COMMA); + } + case 55: break; + case 12: + { return symbol(LPAREN); + } + case 56: break; + case 13: + { return symbol(RPAREN); + } + case 57: break; + case 14: + { return symbol(COLON); + } + case 58: break; + case 15: + { return symbol(ASSIGN); + } + case 59: break; + case 16: + { return symbol(PLUS); + } + case 60: break; + case 17: + { throw new RuntimeException("Illegal character \""+yytext()+ + "\" at line "+yyline+", column "+yycolumn); + } + case 61: break; + case 18: + { string.append( yytext() ); + } + case 62: break; + case 19: + { yybegin(YYINITIAL); return symbol(StringLit, string.toString()); + } + case 63: break; + case 20: + { /* ignore */ + } + case 64: break; + case 21: + { return symbol(IF); + } + case 65: break; + case 22: + { return symbol(IS); + } + case 66: break; + case 23: + { return symbol(OR); + } + case 67: break; + case 24: + { return symbol(END); + } + case 68: break; + case 25: + { return symbol(NOT); + } + case 69: break; + case 26: + { return symbol(AND); + } + case 70: break; + case 27: + { return symbol(XOR); + } + case 71: break; + case 28: + { return symbol(ELSE); + } + case 72: break; + case 29: + { return symbol(LOAD); + } + case 73: break; + case 30: + { return symbol(HEAR); + } + case 74: break; + case 31: + { return symbol(TRUE); + } + case 75: break; + case 32: + { return symbol(VOID); + } + case 76: break; + case 33: + { return symbol(FALSE); + } + case 77: break; + case 34: + { return symbol(BREAK); + } + case 78: break; + case 35: + { return symbol(UNTIL); + } + case 79: break; + case 36: + { return symbol(SIGNAL); + } + case 80: break; + case 37: + { return symbol(RETURN); + } + case 81: break; + case 38: + { return symbol(REPEAT); + } + case 82: break; + case 39: + { return symbol(FOREVER); + } + case 83: break; + case 40: + { return symbol(LT); + } + case 84: break; + case 41: + { return symbol(GT); + } + case 85: break; + case 42: + { return symbol(LTE); + } + case 86: break; + case 43: + { return symbol(GTE); + } + case 87: break; + case 44: + { return symbol(CoordLit); + } + case 88: break; + default: + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + /** + * Converts an int token code into the name of the + * token by reflection on the cup symbol class/interface sym + * + * This code was contributed by Karl Meissner + */ + private String getTokenName(int token) { + try { + java.lang.reflect.Field [] classFields = sym.class.getFields(); + for (int i = 0; i < classFields.length; i++) { + if (classFields[i].getInt(null) == token) { + return classFields[i].getName(); + } + } + } catch (Exception e) { + e.printStackTrace(System.err); + } + + return "UNKNOWN TOKEN"; + } + + /** + * Same as next_token but also prints the token to standard out + * for debugging. + * + * This code was contributed by Karl Meissner + */ + public java_cup.runtime.Symbol debug_next_token() throws java.io.IOException { + java_cup.runtime.Symbol s = next_token(); + System.out.println( "line:" + (yyline+1) + " col:" + (yycolumn+1) + " --"+ yytext() + "--" + getTokenName(s.sym) + "--"); + return s; + } + + /** + * Runs the scanner on input files. + * + * This main method is the debugging routine for the scanner. + * It prints debugging information about each returned token to + * System.out until the end of file is reached, or an error occured. + * + * @param argv the command line, contains the filenames to run + * the scanner on. + */ + public static void main(String argv[]) { + if (argv.length == 0) { + System.out.println("Usage : java Scanner [ --encoding ] "); + } + else { + int firstFilePos = 0; + String encodingName = "UTF-8"; + if (argv[0].equals("--encoding")) { + firstFilePos = 2; + encodingName = argv[1]; + try { + java.nio.charset.Charset.forName(encodingName); // Side-effect: is encodingName valid? + } catch (Exception e) { + System.out.println("Invalid encoding '" + encodingName + "'"); + return; + } + } + for (int i = firstFilePos; i < argv.length; i++) { + Scanner scanner = null; + try { + java.io.FileInputStream stream = new java.io.FileInputStream(argv[i]); + java.io.Reader reader = new java.io.InputStreamReader(stream, encodingName); + scanner = new Scanner(reader); + while ( !scanner.zzAtEOF ) scanner.debug_next_token(); + } + catch (java.io.FileNotFoundException e) { + System.out.println("File not found : \""+argv[i]+"\""); + } + catch (java.io.IOException e) { + System.out.println("IO error scanning file \""+argv[i]+"\""); + System.out.println(e); + } + catch (Exception e) { + System.out.println("Unexpected exception:"); + e.printStackTrace(); + } + } + } + } + + +} diff --git a/compiler/src/UnicodeEscapes.java b/compiler/src/UnicodeEscapes.java new file mode 100644 index 0000000..5f90c54 --- /dev/null +++ b/compiler/src/UnicodeEscapes.java @@ -0,0 +1,685 @@ +/* The following code was generated by JFlex 1.6.1 */ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright (C) 1998-2015 Gerwin Klein * + * All rights reserved. * + * * + * License: BSD * + * * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + +/* �3.3 of the Java Language Specification : + +UnicodeInputCharacter: + + UnicodeEscape + + RawInputCharacter + + UnicodeEscape: + + \ UnicodeMarker HexDigit HexDigit HexDigit HexDigit + + UnicodeMarker: + + u + + UnicodeMarker u + + RawInputCharacter: + + any Unicode character + + HexDigit: one of + + 0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F + +only an even number of '\' is eligible to start a Unicode escape sequence + +*/ + +import java.io.*; + + +/** + * This class is a scanner generated by + * JFlex 1.6.1 + * from the specification file /Users/Lee/Documents/P4/compiler/src/unicode.flex + */ +public final class UnicodeEscapes extends FilterReader { + + /** This character denotes the end of file */ + public static final int YYEOF = -1; + + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** lexical states */ + public static final int YYINITIAL = 0; + public static final int DIGITS = 2; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0, 1, 1 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\60\0\12\2\7\0\6\2\25\0\1\3\4\0\6\2\16\0\1\1"+ + "\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uff9a\0"; + + /** + * Translates characters to character classes + */ + private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\2\0\1\1\1\2\2\3\1\4\1\5\4\0\1\6"; + + private static int [] zzUnpackAction() { + int [] result = new int[13]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\4\0\10\0\14\0\10\0\20\0\10\0\10"+ + "\0\20\0\24\0\30\0\34\0\10"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[13]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\3\3\1\4\1\5\1\6\2\5\5\0\1\7\1\0"+ + "\1\10\1\0\1\11\1\12\3\0\1\13\3\0\1\14"+ + "\3\0\1\15\1\0"; + + private static int [] zzUnpackTrans() { + int [] result = new int[32]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unknown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\2\0\1\11\1\1\1\11\1\1\2\11\4\0\1\11"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[13]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** the input device */ + private java.io.Reader zzReader; + + /** the current state of the DFA */ + private int zzState; + + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; + + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** the textposition at the last accepting state */ + private int zzMarkedPos; + + /** the current text position in the buffer */ + private int zzCurrentPos; + + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; + + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; + + /** number of newlines encountered up to the start of the matched text */ + private int yyline; + + /** the number of characters up to the start of the matched text */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; + + /** + * The number of occupied positions in zzBuffer beyond zzEndRead. + * When a lead/high surrogate has been read from the input stream + * into the final zzBuffer position, this will have a value of 1; + * otherwise, it will have a value of 0. + */ + private int zzFinalHighSurrogate = 0; + + /* user code: */ + private boolean even; + + private int value() { + int r = 0; + + for (int k = zzMarkedPos-4; k < zzMarkedPos; k++) { + int c = zzBuffer[k]; + + if (c >= 'a') + c-= 'a'-10; + else if (c >= 'A') + c-= 'A'-10; + else + c-= '0'; + + r <<= 4; + r += c; + } + + return r; + } + + public int read(char cbuf[], int off, int len) throws IOException { + if ( !ready() ) return -1; + + len+= off; + + for (int i=off; i 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + zzEndRead += zzFinalHighSurrogate; + zzFinalHighSurrogate = 0; + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead-zzStartRead); + + /* translate stored positions */ + zzEndRead-= zzStartRead; + zzCurrentPos-= zzStartRead; + zzMarkedPos-= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length - zzFinalHighSurrogate) { + /* if not: blow it up */ + char newBuffer[] = new char[zzBuffer.length*2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + zzEndRead += zzFinalHighSurrogate; + zzFinalHighSurrogate = 0; + } + + /* fill the buffer with new input */ + int requested = zzBuffer.length - zzEndRead; + int numRead = zzReader.read(zzBuffer, zzEndRead, requested); + + /* not supposed to occur according to specification of java.io.Reader */ + if (numRead == 0) { + throw new java.io.IOException("Reader returned 0 characters. See JFlex examples for workaround."); + } + if (numRead > 0) { + zzEndRead += numRead; + /* If numRead == requested, we might have requested to few chars to + encode a full Unicode character. We assume that a Reader would + otherwise never return half characters. */ + if (numRead == requested) { + if (Character.isHighSurrogate(zzBuffer[zzEndRead - 1])) { + --zzEndRead; + zzFinalHighSurrogate = 1; + } + } + /* potentially more input available */ + return false; + } + + /* numRead < 0 ==> end of stream */ + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + * + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * Internal scan buffer is resized down to its initial length, if it has grown. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + zzFinalHighSurrogate = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + if (zzBuffer.length > ZZ_BUFFERSIZE) + zzBuffer = new char[ZZ_BUFFERSIZE]; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); + } + + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead+pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public int read() throws java.io.IOException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + // set up zzAction for empty match case: + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + } + + + zzForAction: { + while (true) { + + if (zzCurrentPosL < zzEndReadL) { + zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL, zzEndReadL); + zzCurrentPosL += Character.charCount(zzInput); + } + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } + else { + zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL, zzEndReadL); + zzCurrentPosL += Character.charCount(zzInput); + } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + switch (zzLexicalState) { + case YYINITIAL: { + return -1; + } + case 14: break; + case DIGITS: { + throw new Error("EOF in Unicode escape"); + } + case 15: break; + default: + return YYEOF; + } + } + else { + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 1: + { return zzBuffer[zzStartRead]; + } + case 7: break; + case 2: + { even = false; return '\\'; + } + case 8: break; + case 3: + { throw new Error("incorrect Unicode escape"); + } + case 9: break; + case 4: + // lookahead expression with fixed base length + zzMarkedPos = Character.offsetByCodePoints + (zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzStartRead, 1); + { if (even) { + even = false; + return '\\'; + } + else + yybegin(DIGITS); + } + case 10: break; + case 5: + // lookahead expression with fixed base length + zzMarkedPos = Character.offsetByCodePoints + (zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzStartRead, 1); + { even = !even; return '\\'; + } + case 11: break; + case 6: + { yybegin(YYINITIAL); return value(); + } + case 12: break; + default: + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/compiler/src/build.xml b/compiler/src/build.xml new file mode 100644 index 0000000..c6cfee8 --- /dev/null +++ b/compiler/src/build.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/compiler/src/cancer b/compiler/src/cancer new file mode 100644 index 0000000..0300fd8 --- /dev/null +++ b/compiler/src/cancer @@ -0,0 +1,8 @@ +Robot: +LOAD("kage") + +NUM a = 5 + +VOID START() + +END START \ No newline at end of file diff --git a/compiler/src/cup.jar b/compiler/src/cup.jar new file mode 100644 index 0000000..a39d5b3 Binary files /dev/null and b/compiler/src/cup.jar differ diff --git a/compiler/src/java.flex b/compiler/src/java.flex new file mode 100644 index 0000000..c151a32 --- /dev/null +++ b/compiler/src/java.flex @@ -0,0 +1,160 @@ +import java_cup.runtime.*; + +%% + +%public +%class Scanner +%implements sym + +%unicode + +%line +%column + +%eofval{ + return symbol(EOF); +%eofval} + +%cup +%cupdebug + +%{ + StringBuilder string = new StringBuilder(); + + private Symbol symbol(int type) { + return new Symbol(type, yyline+1, yycolumn+1); + } + + private Symbol symbol(int type, Object value) { + return new Symbol(type, yyline+1, yycolumn+1, value); + } + + /** + * assumes correct representation of a long value for + * specified radix in scanner buffer from start + * to end + */ + private long parseLong(int start, int end, int radix) { + long result = 0; + long digit; + + for (int i = start; i < end; i++) { + digit = Character.digit(yycharat(i),radix); + result*= radix; + result+= digit; + } + + return result; + } +%} + +/* main character classes */ +LineTerminator = \r|\n|\r\n +InputCharacter = [^\r\n] + +WhiteSpace = {LineTerminator} | [ \t\f] + +/*Comments*/ +Comment = {TraditionalComment}|{EndOfLineComment}|{DocumentationComment} +TraditionalComment = "/*" [^*] ~"*/" | "/*" "*"+ "/" +EndOfLineComment = "//" {InputCharacter}* {LineTerminator}? +DocumentationComment = "/*" "*"+ [^/*] ~"*/" + +numLiteral = ({FLit1}|{FLit2}|{FLit3}) {Exponent}? + +FLit1 = [0-9]+ \. [0-9]* +FLit2 = \. [0-9]+ +FLit3 = [0-9]+ +Exponent = [eE] [+-]? [0-9]+ + +/* string and character literals */ +StringCharacter = [^\r\n\"\\] +SingleCharacter = [^\r\n\'\\] + +%state STRING, CHARLITERAL + +coordLiteral = (numLiteral, numLiteral, numLiteral) +Identifier = [:jletter:][:jletterdigit:]* + +%% + { + + /* keywords */ + "IF" { return symbol(IF); } + "END" { return symbol(END); } + "ELSE" { return symbol(ELSE); } + "LOAD" { return symbol(LOAD); } + "HEAR" { return symbol(HEAR); } + "SIGNAL" { return symbol(SIGNAL); } + "BREAK" { return symbol(BREAK); } + "RETURN" { return symbol(RETURN); } + "REPEAT" { return symbol(REPEAT); } + "FOREVER" { return symbol(FOREVER); } + "UNTIL" { return symbol(UNTIL); } + "AND" { return symbol(AND); } + "OR" { return symbol(OR); } + "IS" { return symbol(IS); } + "NOT" { return symbol(NOT); } + "LESS_THAN" { return symbol(LT); } + "GREATER_THAN" { return symbol(GT); } + "LESS_THAN_OR_EQUAL_TO" { return symbol(LTE); } + "GREATER_THAN_OR_EQUAL_TO" { return symbol(GTE); } + + /* Literals */ + "TRUE" { return symbol(TRUE); } + "FALSE" { return symbol(FALSE); } + {coordLiteral} { return symbol(CoordLit); } + "VOID" { return symbol(VOID); } + + /* types and ID's */ + "NUM" { return symbol(NUM); } + "BOOL" { return symbol(BOOL); } + "STRING" { return symbol(STRING); } + "COORD" { return symbol(COORD); } + "LIST" { return symbol(LIST); } + + /* seperators */ + "(" { return symbol(LPAREN); } + ")" { return symbol(RPAREN); } + ":" { return symbol(COLON); } + "." { return symbol(DOT); } + "," { return symbol(COMMA); } + + /* operators */ + "XOR" { return symbol(XOR); } + "=" { return symbol(ASSIGN); } + "\n" { return symbol(EOL);} + "+" { return symbol(PLUS);} + "-" { return symbol(MINUS);} + "*" { return symbol(MULT);} + "/" { return symbol(DIV);} + + /* Identifier */ + {Identifier} { return symbol(Identifier, yytext()); } + + /* string literal */ + \" { yybegin(STRING); string.setLength(0); } + + /* character literal */ + \' { yybegin(CHARLITERAL); } + + /* numeric literals */ + {numLiteral} { return symbol(NumLit, new Double(yytext())); } + + /* comments */ + {Comment} { /* ignore */ } + + /* whitespace */ + {WhiteSpace} { /*Ignore*/ } +} + + { + \" { yybegin(YYINITIAL); return symbol(StringLit, string.toString()); } + {StringCharacter}+ { string.append( yytext() ); } + } + +/* error fallback */ +[~] { throw new RuntimeException("Illegal character \""+yytext()+ + "\" at line "+yyline+", column "+yycolumn); } + +//<> { return symbol(EOF); } diff --git a/compiler/src/java12.cup b/compiler/src/java12.cup new file mode 100644 index 0000000..172b7ae --- /dev/null +++ b/compiler/src/java12.cup @@ -0,0 +1,320 @@ +// Test CUP for P4 +import java_cup.*; + +//Den er ikke glad for EOL på nuværende tidspunkt +//TypeName produktionen virker ikke + +parser code {: + public void report_error(String message, Object info) { + StringBuilder m = new StringBuilder("Error "); + + if (info instanceof java_cup.runtime.Symbol) + m.append( "("+info.toString()+")" ); + + m.append(" : "+message); + + System.out.println(m); + } + + public void report_fatal_error(String message, Object info) { + report_error(message, info); + throw new RuntimeException("Fatal Syntax Error"); + } +:}; + +non terminal Type, ReferenceType, PrimitiveType, TypeName, Program, Load, RoboDcl, + MemberDcl, RoboBodyDcl, FieldDcl, MethodDcl, VariableDclList, VariableDcl, VariableInitializer, + ListInitializer, Expression, Literal, LitList, AssignmentExpression, ConditionalExpression, Assignment, + LeftHandSide, ListOpt, ConditionOrExpression, ConditionAndExpression, XORExpression, EqualityExpression, + EqualityExpressionEnd, RelationalExpression, RelationalExpressionEnd, AdditiveExpression, MultiExpr, + AdditiveExpressionEnd, UnaryExpr, MultiExprEnd, Primary, MethodInvocation, FormalArgs, ArgsList, + ParamsList, Param, MethodHeader, HearDecl, MethodBody, MethodDeclarator, FormalParams, Block, + BlockStmtList, BlockStmt, LocalVariableDcl, Statement, StmtNoSubstmt, IfStmt, LoopStmt, + EmptyStmt, SignalStmt, ExprStmt, BreakStmt, ReturnStmt, StmtExpr, ElseIfStmt, ElseStmt, RepeatStmt, + ForeverStmt, BoolLit; + +//Types and id's +terminal Identifier, NUM, BOOL, STRING, COORD, LIST, NumLit, VOID; + +//Symbols +terminal DOT, COMMA, LPAREN, RPAREN, EOL, COLON, XOR, PLUS, MINUS, MULT, DIV, ASSIGN, + SQUARE_LEFT, SQUARE_RIGHT; + +//Boolean Operators +terminal AND, OR, IS, NOT, LT, GT, LTE, GTE, TRUE, FALSE, StringLit, CoordLit; + +//Keywords +terminal LOAD, END, HEAR, SIGNAL, BREAK, RETURN, IF, ELSE, ELSEIF, REPEAT, FOREVER, UNTIL; + +// Program start +Program +::= RoboDcl Load RoboBodyDcl +; + +Literal +::= NumLit +| BoolLit +| StringLit +| CoordLit +; + +BoolLit +::= TRUE +| FALSE +; + +Type +::= ReferenceType +| PrimitiveType +; +PrimitiveType +::= NUM +| BOOL +; +ReferenceType +::= STRING +| COORD +| LIST +; + +//Name +TypeName +::= Identifier +| TypeName DOT Identifier +; + +Load +::= LOAD LPAREN StringLit RPAREN EOL +| Load LOAD LPAREN StringLit RPAREN EOL +; +RoboDcl +::= Identifier COLON EOL +; + +// Declarations +RoboBodyDcl +::= RoboBodyDcl MemberDcl +| MemberDcl +; +MemberDcl +::= FieldDcl +| MethodDcl +| EOL +; +FieldDcl +::= Type VariableDclList EOL + ; +VariableDclList +::= VariableDcl +| VariableDclList COMMA VariableDcl +; +VariableDcl +::= VariableInitializer +| Identifier ListInitializer +; +VariableInitializer +::= Expression +; +ListInitializer +::= LitList END Identifier +//| // lambda +; +LitList +::= LitList COMMA Primary +| Primary +; + +// Expressions +Expression +::= AssignmentExpression +; +AssignmentExpression +::= ConditionalExpression +| Assignment +; +Assignment +::= LeftHandSide ASSIGN Expression +; +LeftHandSide +::= TypeName ListOpt +; +ListOpt +::= SQUARE_LEFT Expression SQUARE_RIGHT +| //lambda +; +ConditionalExpression +::= ConditionOrExpression +; +ConditionOrExpression +::= ConditionAndExpression +| ConditionOrExpression OR ConditionAndExpression +; +ConditionAndExpression +::= XORExpression +| ConditionAndExpression AND XORExpression +; +XORExpression +::= EqualityExpression +| XORExpression XOR EqualityExpression +; +EqualityExpression +::= RelationalExpression +| EqualityExpression EqualityExpressionEnd +; +EqualityExpressionEnd + ::= IS RelationalExpression + | NOT RelationalExpression + ; +RelationalExpression + ::= AdditiveExpression + | RelationalExpression RelationalExpressionEnd +; +RelationalExpressionEnd + ::= LT AdditiveExpression + | GT AdditiveExpression + | LTE AdditiveExpression + | GTE AdditiveExpression + ; +AdditiveExpression +::= MultiExpr + | AdditiveExpression AdditiveExpressionEnd +; +AdditiveExpressionEnd + ::= PLUS MultiExpr + | MINUS MultiExpr + ; +MultiExpr +::= UnaryExpr + | MultiExpr MultiExprEnd +; +MultiExprEnd + ::= MULT UnaryExpr + | DIV UnaryExpr + ; +UnaryExpr + ::= PLUS UnaryExpr + | MINUS UnaryExpr + | Primary + ; + +// Values and ID’s +Primary + ::= Literal + | LPAREN Expression RPAREN + | MethodInvocation + | TypeName ListOpt + ; +MethodInvocation + ::= TypeName LPAREN FormalArgs RPAREN + ; +FormalArgs +::= ArgsList +| //lambda +; + +// Methods (params, args and declarations) +ArgsList + ::= ArgsList COMMA Expression +| Expression +; + +FormalParams + ::= ParamsList + | // lambda + ; +ParamsList +::= ParamsList COMMA Param + | Param + ; +Param + ::= Type Identifier + ; + +MethodDcl + ::= MethodHeader MethodBody + | HearDecl + ; +MethodHeader + ::= Type MethodDeclarator + | VOID MethodDeclarator + ; +MethodDeclarator + ::= Identifier LPAREN FormalParams RPAREN + ; +MethodBody + ::= Block END Identifier + ; +HearDecl + ::= HEAR Identifier LPAREN FormalParams RPAREN Block END HEAR + ; + +//If, loop and statements +Block + ::= BlockStmtList + | // lambda + ; +BlockStmtList + ::= BlockStmtList BlockStmt + | BlockStmt + ; +BlockStmt + ::= LocalVariableDcl + | Statement + ; +LocalVariableDcl + ::= Type VariableDclList EOL + ; + +Statement + ::= StmtNoSubstmt + | IfStmt + | LoopStmt + ; +StmtNoSubstmt + ::= EmptyStmt + | SignalStmt + | ExprStmt + | BreakStmt + | ReturnStmt + ; +EmptyStmt + ::= EOL + ; +SignalStmt + ::= SIGNAL Identifier LPAREN ArgsList RPAREN EOL + ; +ExprStmt + ::= StmtExpr EOL + ; +StmtExpr + ::= Assignment + | MethodInvocation + ; +BreakStmt + ::= BREAK EOL + ; +ReturnStmt + ::= RETURN Expression EOL + ; + +IfStmt + ::= IF LPAREN Expression RPAREN EOL Block END IF ElseIfStmt ElseStmt + ; +ElseIfStmt +::= ElseIfStmt ELSE IF LPAREN Expression RPAREN EOL Block END ELSEIF +| // lambda +; +ElseStmt +::= ELSE EOL Block END ELSE +| // lambda +; +LoopStmt + ::= RepeatStmt + | ForeverStmt + ; +RepeatStmt + ::= REPEAT UNTIL LPAREN Expression RPAREN EOL Block END REPEAT + ; +ForeverStmt + ::= FOREVER EOL Block END FOREVER + ; diff --git a/compiler/src/java_cup/runtime/ComplexSymbolFactory.java b/compiler/src/java_cup/runtime/ComplexSymbolFactory.java new file mode 100644 index 0000000..aff1678 --- /dev/null +++ b/compiler/src/java_cup/runtime/ComplexSymbolFactory.java @@ -0,0 +1,120 @@ +package java_cup.runtime; + +/** + * Default Implementation for SymbolFactory, creates + * plain old Symbols + * + * @version last updated 27-03-2006 + * @author Michael Petter + */ + +/* ************************************************* + class DefaultSymbolFactory + + interface for creating new symbols + ***************************************************/ +public class ComplexSymbolFactory implements SymbolFactory{ + public static class Location { + private String unit="unknown"; + private int line, column; + public Location(String unit, int line, int column){ + this.unit=unit; + this.line=line; + this.column=column; + } + public Location(int line, int column){ + this.line=line; + this.column=column; + } + public String toString(){ + return unit+":"+line+"/"+column; + } + public int getColumn(){ + return column; + } + public int getLine(){ + return line; + } + public String getUnit(){ + return unit; + } + } + /** + * ComplexSymbol with detailed Location Informations and a Name + */ + public static class ComplexSymbol extends Symbol { + protected String name; + protected Location xleft,xright; + + public ComplexSymbol(String name, int id) { + super(id); + this.name=name; + } + public ComplexSymbol(String name, int id, Object value) { + super(id,value); + this.name=name; + } + public String toString(){ + if (xleft==null || xright==null) return "Symbol: "+name; + return "Symbol: "+name+" ("+xleft+" - "+xright+")"; + } + public ComplexSymbol(String name, int id, int state) { + super(id,state); + this.name=name; + } + public ComplexSymbol(String name, int id, Symbol left, Symbol right) { + super(id,left,right); + this.name=name; + if (left!=null) this.xleft = ((ComplexSymbol)left).xleft; + if (right!=null) this.xright= ((ComplexSymbol)right).xright; + } + public ComplexSymbol(String name, int id, Location left, Location right) { + super(id); + this.name=name; + this.xleft=left; + this.xright=right; + } + public ComplexSymbol(String name, int id, Symbol left, Symbol right, Object value) { + super(id,value); + this.name=name; + if (left!=null) this.xleft = ((ComplexSymbol)left).xleft; + if (right!=null) this.xright= ((ComplexSymbol)right).xright; + } + public ComplexSymbol(String name, int id, Location left, Location right, Object value) { + super(id,value); + this.name=name; + this.xleft=left; + this.xright=right; + } + public Location getLeft(){ + return xleft; + } + public Location getRight(){ + return xright; + } + } + + + // Factory methods + public Symbol newSymbol(String name, int id, Location left, Location right, Object value){ + return new ComplexSymbol(name,id,left,right,value); + } + public Symbol newSymbol(String name, int id, Location left, Location right){ + return new ComplexSymbol(name,id,left,right); + } + public Symbol newSymbol(String name, int id, Symbol left, Symbol right, Object value){ + return new ComplexSymbol(name,id,left,right,value); + } + public Symbol newSymbol(String name, int id, Symbol left, Symbol right){ + return new ComplexSymbol(name,id,left,right); + } + public Symbol newSymbol(String name, int id){ + return new ComplexSymbol(name,id); + } + public Symbol newSymbol(String name, int id, Object value){ + return new ComplexSymbol(name,id,value); + } + public Symbol startSymbol(String name, int id, int state){ + return new ComplexSymbol(name,id,state); + } +} diff --git a/compiler/src/java_cup/runtime/DefaultSymbolFactory.java b/compiler/src/java_cup/runtime/DefaultSymbolFactory.java new file mode 100644 index 0000000..d5bca58 --- /dev/null +++ b/compiler/src/java_cup/runtime/DefaultSymbolFactory.java @@ -0,0 +1,52 @@ +package java_cup.runtime; + +/** + * Default Implementation for SymbolFactory, creates + * plain old Symbols + * + * @version last updated 27-03-2006 + * @author Michael Petter + */ + +/* ************************************************* + class DefaultSymbolFactory + + interface for creating new symbols + ***************************************************/ +public class DefaultSymbolFactory implements SymbolFactory{ + // Factory methods + /** + * DefaultSymbolFactory for CUP. + * Users are strongly encoraged to use ComplexSymbolFactory instead, since + * it offers more detailed information about Symbols in source code. + * Yet since migrating has always been a critical process, You have the + * chance of still using the oldstyle Symbols. + * + * @deprecated as of CUP v11a + * replaced by the new java_cup.runtime.ComplexSymbolFactory + */ + //@deprecated + public DefaultSymbolFactory(){ + } + public Symbol newSymbol(String name ,int id, Symbol left, Symbol right, Object value){ + return new Symbol(id,left,right,value); + } + public Symbol newSymbol(String name, int id, Symbol left, Symbol right){ + return new Symbol(id,left,right); + } + public Symbol newSymbol(String name, int id, int left, int right, Object value){ + return new Symbol(id,left,right,value); + } + public Symbol newSymbol(String name, int id, int left, int right){ + return new Symbol(id,left,right); + } + public Symbol startSymbol(String name, int id, int state){ + return new Symbol(id,state); + } + public Symbol newSymbol(String name, int id){ + return new Symbol(id); + } + public Symbol newSymbol(String name, int id, Object value){ + return new Symbol(id,value); + } +} diff --git a/compiler/src/java_cup/runtime/Scanner.java b/compiler/src/java_cup/runtime/Scanner.java new file mode 100644 index 0000000..3233551 --- /dev/null +++ b/compiler/src/java_cup/runtime/Scanner.java @@ -0,0 +1,25 @@ +package java_cup.runtime; + +/** + * Defines the Scanner interface, which CUP uses in the default + * implementation of lr_parser.scan(). Integration + * of scanners implementing Scanner is facilitated. + * + * @version last updated 23-Jul-1999 + * @author David MacMahon + */ + +/* ************************************************* + Interface Scanner + + Declares the next_token() method that should be + implemented by scanners. This method is typically + called by lr_parser.scan(). End-of-file can be + indicated either by returning + new Symbol(lr_parser.EOF_sym()) or + null. + ***************************************************/ +public interface Scanner { + /** Return the next token, or null on end-of-file. */ + public Symbol next_token() throws java.lang.Exception; +} diff --git a/compiler/src/java_cup/runtime/Symbol.java b/compiler/src/java_cup/runtime/Symbol.java new file mode 100644 index 0000000..c9ce556 --- /dev/null +++ b/compiler/src/java_cup/runtime/Symbol.java @@ -0,0 +1,116 @@ +package java_cup.runtime; + +/** + * Defines the Symbol class, which is used to represent all terminals + * and nonterminals while parsing. The lexer should pass CUP Symbols + * and CUP returns a Symbol. + * + * @version last updated: 7/3/96 + * @author Frank Flannery + */ + +/* **************************************************************** + Class Symbol + what the parser expects to receive from the lexer. + the token is identified as follows: + sym: the symbol type + parse_state: the parse state. + value: is the lexical value of type Object + left : is the left position in the original input file + right: is the right position in the original input file + xleft: is the left position Object in the original input file + xright: is the left position Object in the original input file +******************************************************************/ + +public class Symbol { + +// TUM 20060327: Added new Constructor to provide more flexible way +// for location handling +/******************************* + *******************************/ + public Symbol(int id, Symbol left, Symbol right, Object o){ + this(id,left.left,right.right,o); + } + public Symbol(int id, Symbol left, Symbol right){ + this(id,left.left,right.right); + } +/******************************* + Constructor for l,r values + *******************************/ + + public Symbol(int id, int l, int r, Object o) { + this(id); + left = l; + right = r; + value = o; + } + +/******************************* + Constructor for no l,r values +********************************/ + + public Symbol(int id, Object o) { + this(id, -1, -1, o); + } + +/***************************** + Constructor for no value + ***************************/ + + public Symbol(int id, int l, int r) { + this(id, l, r, null); + } + +/*********************************** + Constructor for no value or l,r +***********************************/ + + public Symbol(int sym_num) { + this(sym_num, -1); + left = -1; + right = -1; + } + +/*********************************** + Constructor to give a start state +***********************************/ + Symbol(int sym_num, int state) + { + sym = sym_num; + parse_state = state; + } + +/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** The symbol number of the terminal or non terminal being represented */ + public int sym; + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** The parse state to be recorded on the parse stack with this symbol. + * This field is for the convenience of the parser and shouldn't be + * modified except by the parser. + */ + public int parse_state; + /** This allows us to catch some errors caused by scanners recycling + * symbols. For the use of the parser only. [CSA, 23-Jul-1999] */ + boolean used_by_parser = false; + +/******************************* + The data passed to parser + *******************************/ + + public int left, right; + public Object value; + + /***************************** + Printing this token out. (Override for pretty-print). + ****************************/ + public String toString() { return "#"+sym; } +} + + + + + + diff --git a/compiler/src/java_cup/runtime/SymbolFactory.java b/compiler/src/java_cup/runtime/SymbolFactory.java new file mode 100644 index 0000000..86bae08 --- /dev/null +++ b/compiler/src/java_cup/runtime/SymbolFactory.java @@ -0,0 +1,33 @@ +package java_cup.runtime; + +/** + * Creates the Symbols interface, which CUP uses as default + * + * @version last updated 27-03-2006 + * @author Michael Petter + */ + +/* ************************************************* + Interface SymbolFactory + + interface for creating new symbols + You can also use this interface for your own callback hooks + Declare Your own factory methods for creation of Objects in Your scanner! + ***************************************************/ +public interface SymbolFactory { + // Factory methods + /** + * Construction with left/right propagation switched on + */ + public Symbol newSymbol(String name, int id, Symbol left, Symbol right, Object value); + public Symbol newSymbol(String name, int id, Symbol left, Symbol right); + /** + * Construction with left/right propagation switched off + */ + public Symbol newSymbol(String name, int id, Object value); + public Symbol newSymbol(String name, int id); + /** + * Construction of start symbol + */ + public Symbol startSymbol(String name, int id, int state); +} diff --git a/compiler/src/java_cup/runtime/lr_parser.java b/compiler/src/java_cup/runtime/lr_parser.java new file mode 100644 index 0000000..990c315 --- /dev/null +++ b/compiler/src/java_cup/runtime/lr_parser.java @@ -0,0 +1,1253 @@ + +package java_cup.runtime; + +import java.util.Stack; + +/** This class implements a skeleton table driven LR parser. In general, + * LR parsers are a form of bottom up shift-reduce parsers. Shift-reduce + * parsers act by shifting input onto a parse stack until the Symbols + * matching the right hand side of a production appear on the top of the + * stack. Once this occurs, a reduce is performed. This involves removing + * the Symbols corresponding to the right hand side of the production + * (the so called "handle") and replacing them with the non-terminal from + * the left hand side of the production.

+ * + * To control the decision of whether to shift or reduce at any given point, + * the parser uses a state machine (the "viable prefix recognition machine" + * built by the parser generator). The current state of the machine is placed + * on top of the parse stack (stored as part of a Symbol object representing + * a terminal or non terminal). The parse action table is consulted + * (using the current state and the current lookahead Symbol as indexes) to + * determine whether to shift or to reduce. When the parser shifts, it + * changes to a new state by pushing a new Symbol (containing a new state) + * onto the stack. When the parser reduces, it pops the handle (right hand + * side of a production) off the stack. This leaves the parser in the state + * it was in before any of those Symbols were matched. Next the reduce-goto + * table is consulted (using the new state and current lookahead Symbol as + * indexes) to determine a new state to go to. The parser then shifts to + * this goto state by pushing the left hand side Symbol of the production + * (also containing the new state) onto the stack.

+ * + * This class actually provides four LR parsers. The methods parse() and + * debug_parse() provide two versions of the main parser (the only difference + * being that debug_parse() emits debugging trace messages as it parses). + * In addition to these main parsers, the error recovery mechanism uses two + * more. One of these is used to simulate "parsing ahead" in the input + * without carrying out actions (to verify that a potential error recovery + * has worked), and the other is used to parse through buffered "parse ahead" + * input in order to execute all actions and re-synchronize the actual parser + * configuration.

+ * + * This is an abstract class which is normally filled out by a subclass + * generated by the JavaCup parser generator. In addition to supplying + * the actual parse tables, generated code also supplies methods which + * invoke various pieces of user supplied code, provide access to certain + * special Symbols (e.g., EOF and error), etc. Specifically, the following + * abstract methods are normally supplied by generated code: + *

+ *
short[][] production_table() + *
Provides a reference to the production table (indicating the index of + * the left hand side non terminal and the length of the right hand side + * for each production in the grammar). + *
short[][] action_table() + *
Provides a reference to the parse action table. + *
short[][] reduce_table() + *
Provides a reference to the reduce-goto table. + *
int start_state() + *
Indicates the index of the start state. + *
int start_production() + *
Indicates the index of the starting production. + *
int EOF_sym() + *
Indicates the index of the EOF Symbol. + *
int error_sym() + *
Indicates the index of the error Symbol. + *
Symbol do_action() + *
Executes a piece of user supplied action code. This always comes at + * the point of a reduce in the parse, so this code also allocates and + * fills in the left hand side non terminal Symbol object that is to be + * pushed onto the stack for the reduce. + *
void init_actions() + *
Code to initialize a special object that encapsulates user supplied + * actions (this object is used by do_action() to actually carry out the + * actions). + *
+ * + * In addition to these routines that must be supplied by the + * generated subclass there are also a series of routines that may + * be supplied. These include: + *
+ *
Symbol scan() + *
Used to get the next input Symbol from the scanner. + *
Scanner getScanner() + *
Used to provide a scanner for the default implementation of + * scan(). + *
int error_sync_size() + *
This determines how many Symbols past the point of an error + * must be parsed without error in order to consider a recovery to + * be valid. This defaults to 3. Values less than 2 are not + * recommended. + *
void report_error(String message, Object info) + *
This method is called to report an error. The default implementation + * simply prints a message to System.err and where the error occurred. + * This method is often replaced in order to provide a more sophisticated + * error reporting mechanism. + *
void report_fatal_error(String message, Object info) + *
This method is called when a fatal error that cannot be recovered from + * is encountered. In the default implementation, it calls + * report_error() to emit a message, then throws an exception. + *
void syntax_error(Symbol cur_token) + *
This method is called as soon as syntax error is detected (but + * before recovery is attempted). In the default implementation it + * invokes: report_error("Syntax error", null); + *
void unrecovered_syntax_error(Symbol cur_token) + *
This method is called if syntax error recovery fails. In the default + * implementation it invokes:
+ * report_fatal_error("Couldn't repair and continue parse", null); + *
+ * + * @see java_cup.runtime.Symbol + * @see java_cup.runtime.Symbol + * @see java_cup.runtime.virtual_parse_stack + * @version last updated: 7/3/96 + * @author Frank Flannery + */ + +public abstract class lr_parser { + /*-----------------------------------------------------------*/ + /*--- Constructor(s) ----------------------------------------*/ + /*-----------------------------------------------------------*/ + + /** + * Simple constructor. + */ + public lr_parser() { + } + + /** + * Constructor that sets the default scanner. [CSA/davidm] + */ + public lr_parser(Scanner s) { + this(s,new DefaultSymbolFactory()); // TUM 20060327 old cup v10 Symbols as default + } + /** + * Constructor that sets the default scanner and a SymbolFactory + */ + public lr_parser(Scanner s, SymbolFactory symfac) { + this(); // in case default constructor someday does something + symbolFactory = symfac; + setScanner(s); + } + public SymbolFactory symbolFactory;// = new DefaultSymbolFactory(); + /** + * Whenever creation of a new Symbol is necessary, one should use this factory. + */ + public SymbolFactory getSymbolFactory(){ + return symbolFactory; + } + /*-----------------------------------------------------------*/ + /*--- (Access to) Static (Class) Variables ------------------*/ + /*-----------------------------------------------------------*/ + + /** The default number of Symbols after an error we much match to consider + * it recovered from. + */ + protected final static int _error_sync_size = 3; + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** The number of Symbols after an error we much match to consider it + * recovered from. + */ + protected int error_sync_size() {return _error_sync_size; } + + /*-----------------------------------------------------------*/ + /*--- (Access to) Instance Variables ------------------------*/ + /*-----------------------------------------------------------*/ + + /** Table of production information (supplied by generated subclass). + * This table contains one entry per production and is indexed by + * the negative-encoded values (reduce actions) in the action_table. + * Each entry has two parts, the index of the non-terminal on the + * left hand side of the production, and the number of Symbols + * on the right hand side. + */ + public abstract short[][] production_table(); + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** The action table (supplied by generated subclass). This table is + * indexed by state and terminal number indicating what action is to + * be taken when the parser is in the given state (i.e., the given state + * is on top of the stack) and the given terminal is next on the input. + * States are indexed using the first dimension, however, the entries for + * a given state are compacted and stored in adjacent index, value pairs + * which are searched for rather than accessed directly (see get_action()). + * The actions stored in the table will be either shifts, reduces, or + * errors. Shifts are encoded as positive values (one greater than the + * state shifted to). Reduces are encoded as negative values (one less + * than the production reduced by). Error entries are denoted by zero. + * + * @see java_cup.runtime.lr_parser#get_action + */ + public abstract short[][] action_table(); + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** The reduce-goto table (supplied by generated subclass). This + * table is indexed by state and non-terminal number and contains + * state numbers. States are indexed using the first dimension, however, + * the entries for a given state are compacted and stored in adjacent + * index, value pairs which are searched for rather than accessed + * directly (see get_reduce()). When a reduce occurs, the handle + * (corresponding to the RHS of the matched production) is popped off + * the stack. The new top of stack indicates a state. This table is + * then indexed by that state and the LHS of the reducing production to + * indicate where to "shift" to. + * + * @see java_cup.runtime.lr_parser#get_reduce + */ + public abstract short[][] reduce_table(); + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** The index of the start state (supplied by generated subclass). */ + public abstract int start_state(); + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** The index of the start production (supplied by generated subclass). */ + public abstract int start_production(); + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** The index of the end of file terminal Symbol (supplied by generated + * subclass). + */ + public abstract int EOF_sym(); + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** The index of the special error Symbol (supplied by generated subclass). */ + public abstract int error_sym(); + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** Internal flag to indicate when parser should quit. */ + protected boolean _done_parsing = false; + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** This method is called to indicate that the parser should quit. This is + * normally called by an accept action, but can be used to cancel parsing + * early in other circumstances if desired. + */ + public void done_parsing() + { + _done_parsing = true; + } + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + /* Global parse state shared by parse(), error recovery, and + * debugging routines */ + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** Indication of the index for top of stack (for use by actions). */ + protected int tos; + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** The current lookahead Symbol. */ + protected Symbol cur_token; + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** The parse stack itself. */ + protected Stack stack = new Stack(); + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** Direct reference to the production table. */ + protected short[][] production_tab; + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** Direct reference to the action table. */ + protected short[][] action_tab; + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** Direct reference to the reduce-goto table. */ + protected short[][] reduce_tab; + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** This is the scanner object used by the default implementation + * of scan() to get Symbols. To avoid name conflicts with existing + * code, this field is private. [CSA/davidm] */ + private Scanner _scanner; + + /** + * Simple accessor method to set the default scanner. + */ + public void setScanner(Scanner s) { _scanner = s; } + + /** + * Simple accessor method to get the default scanner. + */ + public Scanner getScanner() { return _scanner; } + + /*-----------------------------------------------------------*/ + /*--- General Methods ---------------------------------------*/ + /*-----------------------------------------------------------*/ + + /** Perform a bit of user supplied action code (supplied by generated + * subclass). Actions are indexed by an internal action number assigned + * at parser generation time. + * + * @param act_num the internal index of the action to be performed. + * @param parser the parser object we are acting for. + * @param stack the parse stack of that object. + * @param top the index of the top element of the parse stack. + */ + public abstract Symbol do_action( + int act_num, + lr_parser parser, + Stack stack, + int top) + throws java.lang.Exception; + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** User code for initialization inside the parser. Typically this + * initializes the scanner. This is called before the parser requests + * the first Symbol. Here this is just a placeholder for subclasses that + * might need this and we perform no action. This method is normally + * overridden by the generated code using this contents of the "init with" + * clause as its body. + */ + public void user_init() throws java.lang.Exception { } + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** Initialize the action object. This is called before the parser does + * any parse actions. This is filled in by generated code to create + * an object that encapsulates all action code. + */ + protected abstract void init_actions() throws java.lang.Exception; + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** Get the next Symbol from the input (supplied by generated subclass). + * Once end of file has been reached, all subsequent calls to scan + * should return an EOF Symbol (which is Symbol number 0). By default + * this method returns getScanner().next_token(); this implementation + * can be overriden by the generated parser using the code declared in + * the "scan with" clause. Do not recycle objects; every call to + * scan() should return a fresh object. + */ + public Symbol scan() throws java.lang.Exception { + Symbol sym = getScanner().next_token(); + return (sym!=null) ? sym : getSymbolFactory().newSymbol("END_OF_FILE",EOF_sym()); + } + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** Report a fatal error. This method takes a message string and an + * additional object (to be used by specializations implemented in + * subclasses). Here in the base class a very simple implementation + * is provided which reports the error then throws an exception. + * + * @param message an error message. + * @param info an extra object reserved for use by specialized subclasses. + */ + public void report_fatal_error( + String message, + Object info) + throws java.lang.Exception + { + /* stop parsing (not really necessary since we throw an exception, but) */ + done_parsing(); + + /* use the normal error message reporting to put out the message */ + report_error(message, info); + + /* throw an exception */ + throw new Exception("Can't recover from previous error(s)"); + } + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** Report a non fatal error (or warning). This method takes a message + * string and an additional object (to be used by specializations + * implemented in subclasses). Here in the base class a very simple + * implementation is provided which simply prints the message to + * System.err. + * + * @param message an error message. + * @param info an extra object reserved for use by specialized subclasses. + */ + public void report_error(String message, Object info) + { + System.err.print(message); + System.err.flush(); + if (info instanceof Symbol) + if (((Symbol)info).left != -1) + System.err.println(" at character " + ((Symbol)info).left + + " of input"); + else System.err.println(""); + else System.err.println(""); + } + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** This method is called when a syntax error has been detected and recovery + * is about to be invoked. Here in the base class we just emit a + * "Syntax error" error message. + * + * @param cur_token the current lookahead Symbol. + */ + public void syntax_error(Symbol cur_token) + { + report_error("Syntax error", cur_token); + } + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** This method is called if it is determined that syntax error recovery + * has been unsuccessful. Here in the base class we report a fatal error. + * + * @param cur_token the current lookahead Symbol. + */ + public void unrecovered_syntax_error(Symbol cur_token) + throws java.lang.Exception + { + report_fatal_error("Couldn't repair and continue parse", cur_token); + } + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** Fetch an action from the action table. The table is broken up into + * rows, one per state (rows are indexed directly by state number). + * Within each row, a list of index, value pairs are given (as sequential + * entries in the table), and the list is terminated by a default entry + * (denoted with a Symbol index of -1). To find the proper entry in a row + * we do a linear or binary search (depending on the size of the row). + * + * @param state the state index of the action being accessed. + * @param sym the Symbol index of the action being accessed. + */ + protected final short get_action(int state, int sym) + { + short tag; + int first, last, probe; + short[] row = action_tab[state]; + + /* linear search if we are < 10 entries */ + if (row.length < 20) + for (probe = 0; probe < row.length; probe++) + { + /* is this entry labeled with our Symbol or the default? */ + tag = row[probe++]; + if (tag == sym || tag == -1) + { + /* return the next entry */ + return row[probe]; + } + } + /* otherwise binary search */ + else + { + first = 0; + last = (row.length-1)/2 - 1; /* leave out trailing default entry */ + while (first <= last) + { + probe = (first+last)/2; + if (sym == row[probe*2]) + return row[probe*2+1]; + else if (sym > row[probe*2]) + first = probe+1; + else + last = probe-1; + } + + /* not found, use the default at the end */ + return row[row.length-1]; + } + + /* shouldn't happened, but if we run off the end we return the + default (error == 0) */ + return 0; + } + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** Fetch a state from the reduce-goto table. The table is broken up into + * rows, one per state (rows are indexed directly by state number). + * Within each row, a list of index, value pairs are given (as sequential + * entries in the table), and the list is terminated by a default entry + * (denoted with a Symbol index of -1). To find the proper entry in a row + * we do a linear search. + * + * @param state the state index of the entry being accessed. + * @param sym the Symbol index of the entry being accessed. + */ + protected final short get_reduce(int state, int sym) + { + short tag; + short[] row = reduce_tab[state]; + + /* if we have a null row we go with the default */ + if (row == null) + return -1; + + for (int probe = 0; probe < row.length; probe++) + { + /* is this entry labeled with our Symbol or the default? */ + tag = row[probe++]; + if (tag == sym || tag == -1) + { + /* return the next entry */ + return row[probe]; + } + } + /* if we run off the end we return the default (error == -1) */ + return -1; + } + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** This method provides the main parsing routine. It returns only when + * done_parsing() has been called (typically because the parser has + * accepted, or a fatal error has been reported). See the header + * documentation for the class regarding how shift/reduce parsers operate + * and how the various tables are used. + */ + public Symbol parse() throws java.lang.Exception + { + /* the current action code */ + int act; + + /* the Symbol/stack element returned by a reduce */ + Symbol lhs_sym = null; + + /* information about production being reduced with */ + short handle_size, lhs_sym_num; + + /* set up direct reference to tables to drive the parser */ + + production_tab = production_table(); + action_tab = action_table(); + reduce_tab = reduce_table(); + + /* initialize the action encapsulation object */ + init_actions(); + + /* do user initialization */ + user_init(); + + /* get the first token */ + cur_token = scan(); + + /* push dummy Symbol with start state to get us underway */ + stack.removeAllElements(); + stack.push(getSymbolFactory().startSymbol("START", 0, start_state())); + tos = 0; + + /* continue until we are told to stop */ + for (_done_parsing = false; !_done_parsing; ) + { + /* Check current token for freshness. */ + if (cur_token.used_by_parser) + throw new Error("Symbol recycling detected (fix your scanner)."); + + /* current state is always on the top of the stack */ + + /* look up action out of the current state with the current input */ + act = get_action(stack.peek().parse_state, cur_token.sym); + + /* decode the action -- > 0 encodes shift */ + if (act > 0) + { + /* shift to the encoded state by pushing it on the stack */ + cur_token.parse_state = act-1; + cur_token.used_by_parser = true; + stack.push(cur_token); + tos++; + + /* advance to the next Symbol */ + cur_token = scan(); + } + /* if its less than zero, then it encodes a reduce action */ + else if (act < 0) + { + /* perform the action for the reduce */ + lhs_sym = do_action((-act)-1, this, stack, tos); + + /* look up information about the production */ + lhs_sym_num = production_tab[(-act)-1][0]; + handle_size = production_tab[(-act)-1][1]; + + /* pop the handle off the stack */ + for (int i = 0; i < handle_size; i++) + { + stack.pop(); + tos--; + } + + /* look up the state to go to from the one popped back to */ + act = get_reduce(stack.peek().parse_state, lhs_sym_num); + + /* shift to that state */ + lhs_sym.parse_state = act; + lhs_sym.used_by_parser = true; + stack.push(lhs_sym); + tos++; + } + /* finally if the entry is zero, we have an error */ + else if (act == 0) + { + /* call user syntax error reporting routine */ + syntax_error(cur_token); + + /* try to error recover */ + if (!error_recovery(false)) + { + /* if that fails give up with a fatal syntax error */ + unrecovered_syntax_error(cur_token); + + /* just in case that wasn't fatal enough, end parse */ + done_parsing(); + } else { + lhs_sym = stack.peek(); + } + } + } + return lhs_sym; + } + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** Write a debugging message to System.err for the debugging version + * of the parser. + * + * @param mess the text of the debugging message. + */ + public void debug_message(String mess) + { + System.err.println(mess); + } + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** Dump the parse stack for debugging purposes. */ + public void dump_stack() + { + if (stack == null) + { + debug_message("# Stack dump requested, but stack is null"); + return; + } + + debug_message("============ Parse Stack Dump ============"); + + /* dump the stack */ + for (int i=0; i"); + if ((i%3)==2 || (i==(stack.size()-1))) { + debug_message(sb.toString()); + sb = new StringBuilder(" "); + } + } + } + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** Perform a parse with debugging output. This does exactly the + * same things as parse(), except that it calls debug_shift() and + * debug_reduce() when shift and reduce moves are taken by the parser + * and produces various other debugging messages. + */ + public Symbol debug_parse() + throws java.lang.Exception + { + /* the current action code */ + int act; + + /* the Symbol/stack element returned by a reduce */ + Symbol lhs_sym = null; + + /* information about production being reduced with */ + short handle_size, lhs_sym_num; + + /* set up direct reference to tables to drive the parser */ + production_tab = production_table(); + action_tab = action_table(); + reduce_tab = reduce_table(); + + debug_message("# Initializing parser"); + + /* initialize the action encapsulation object */ + init_actions(); + + /* do user initialization */ + user_init(); + + /* the current Symbol */ + cur_token = scan(); + + debug_message("# Current Symbol is #" + cur_token.sym); + + /* push dummy Symbol with start state to get us underway */ + stack.removeAllElements(); + stack.push(getSymbolFactory().startSymbol("START",0, start_state())); + tos = 0; + + /* continue until we are told to stop */ + for (_done_parsing = false; !_done_parsing; ) + { + /* Check current token for freshness. */ + if (cur_token.used_by_parser) + throw new Error("Symbol recycling detected (fix your scanner)."); + + /* current state is always on the top of the stack */ + //debug_stack(); + + /* look up action out of the current state with the current input */ + act = get_action(stack.peek().parse_state, cur_token.sym); + + /* decode the action -- > 0 encodes shift */ + if (act > 0) + { + /* shift to the encoded state by pushing it on the stack */ + cur_token.parse_state = act-1; + cur_token.used_by_parser = true; + debug_shift(cur_token); + stack.push(cur_token); + tos++; + + /* advance to the next Symbol */ + cur_token = scan(); + debug_message("# Current token is " + cur_token); + } + /* if its less than zero, then it encodes a reduce action */ + else if (act < 0) + { + /* perform the action for the reduce */ + lhs_sym = do_action((-act)-1, this, stack, tos); + + /* look up information about the production */ + lhs_sym_num = production_tab[(-act)-1][0]; + handle_size = production_tab[(-act)-1][1]; + + debug_reduce((-act)-1, lhs_sym_num, handle_size); + + /* pop the handle off the stack */ + for (int i = 0; i < handle_size; i++) + { + stack.pop(); + tos--; + } + + /* look up the state to go to from the one popped back to */ + act = get_reduce(stack.peek().parse_state, lhs_sym_num); + debug_message("# Reduce rule: top state " + + stack.peek().parse_state + + ", lhs sym " + lhs_sym_num + " -> state " + act); + + /* shift to that state */ + lhs_sym.parse_state = act; + lhs_sym.used_by_parser = true; + stack.push(lhs_sym); + tos++; + + debug_message("# Goto state #" + act); + } + /* finally if the entry is zero, we have an error */ + else if (act == 0) + { + /* call user syntax error reporting routine */ + syntax_error(cur_token); + + /* try to error recover */ + if (!error_recovery(true)) + { + /* if that fails give up with a fatal syntax error */ + unrecovered_syntax_error(cur_token); + + /* just in case that wasn't fatal enough, end parse */ + done_parsing(); + } else { + lhs_sym = stack.peek(); + } + } + } + return lhs_sym; + } + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + /* Error recovery code */ + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** Attempt to recover from a syntax error. This returns false if recovery + * fails, true if it succeeds. Recovery happens in 4 steps. First we + * pop the parse stack down to a point at which we have a shift out + * of the top-most state on the error Symbol. This represents the + * initial error recovery configuration. If no such configuration is + * found, then we fail. Next a small number of "lookahead" or "parse + * ahead" Symbols are read into a buffer. The size of this buffer is + * determined by error_sync_size() and determines how many Symbols beyond + * the error must be matched to consider the recovery a success. Next, + * we begin to discard Symbols in attempt to get past the point of error + * to a point where we can continue parsing. After each Symbol, we attempt + * to "parse ahead" though the buffered lookahead Symbols. The "parse ahead" + * process simulates that actual parse, but does not modify the real + * parser's configuration, nor execute any actions. If we can parse all + * the stored Symbols without error, then the recovery is considered a + * success. Once a successful recovery point is determined, we do an + * actual parse over the stored input -- modifying the real parse + * configuration and executing all actions. Finally, we return the the + * normal parser to continue with the overall parse. + * + * @param debug should we produce debugging messages as we parse. + */ + protected boolean error_recovery(boolean debug) + throws java.lang.Exception + { + if (debug) debug_message("# Attempting error recovery"); + + /* first pop the stack back into a state that can shift on error and + do that shift (if that fails, we fail) */ + if (!find_recovery_config(debug)) + { + if (debug) debug_message("# Error recovery fails"); + return false; + } + + /* read ahead to create lookahead we can parse multiple times */ + read_lookahead(); + + /* repeatedly try to parse forward until we make it the required dist */ + for (;;) + { + /* try to parse forward, if it makes it, bail out of loop */ + if (debug) debug_message("# Trying to parse ahead"); + if (try_parse_ahead(debug)) + { + break; + } + + /* if we are now at EOF, we have failed */ + if (lookahead[0].sym == EOF_sym()) + { + if (debug) debug_message("# Error recovery fails at EOF"); + return false; + } + + /* otherwise, we consume another Symbol and try again */ + // BUG FIX by Bruce Hutton + // Computer Science Department, University of Auckland, + // Auckland, New Zealand. + // It is the first token that is being consumed, not the one + // we were up to parsing + if (debug) + debug_message("# Consuming Symbol #" + lookahead[ 0 ].sym); + restart_lookahead(); + } + + /* we have consumed to a point where we can parse forward */ + if (debug) debug_message("# Parse-ahead ok, going back to normal parse"); + + /* do the real parse (including actions) across the lookahead */ + parse_lookahead(debug); + + /* we have success */ + return true; + } + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** Determine if we can shift under the special error Symbol out of the + * state currently on the top of the (real) parse stack. + */ + protected boolean shift_under_error() + { + /* is there a shift under error Symbol */ + return get_action(stack.peek().parse_state, error_sym()) > 0; + } + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** Put the (real) parse stack into error recovery configuration by + * popping the stack down to a state that can shift on the special + * error Symbol, then doing the shift. If no suitable state exists on + * the stack we return false + * + * @param debug should we produce debugging messages as we parse. + */ + protected boolean find_recovery_config(boolean debug) + { + Symbol error_token; + int act; + + if (debug) debug_message("# Finding recovery state on stack"); + + /* Remember the right-position of the top symbol on the stack */ + Symbol right = stack.peek();// TUM 20060327 removed .right + Symbol left = right;// TUM 20060327 removed .left + + /* pop down until we can shift under error Symbol */ + while (!shift_under_error()) + { + /* pop the stack */ + if (debug) + debug_message("# Pop stack by one, state was # " + + stack.peek().parse_state); + left = stack.pop(); // TUM 20060327 removed .left + tos--; + + /* if we have hit bottom, we fail */ + if (stack.empty()) + { + if (debug) debug_message("# No recovery state found on stack"); + return false; + } + } + + /* state on top of the stack can shift under error, find the shift */ + act = get_action(stack.peek().parse_state, error_sym()); + if (debug) + { + debug_message("# Recover state found (#" + + stack.peek().parse_state + ")"); + debug_message("# Shifting on error to state #" + (act-1)); + } + + /* build and shift a special error Symbol */ + error_token = getSymbolFactory().newSymbol("ERROR",error_sym(), left, right); + error_token.parse_state = act-1; + error_token.used_by_parser = true; + stack.push(error_token); + tos++; + + return true; + } + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** Lookahead Symbols used for attempting error recovery "parse aheads". */ + protected Symbol lookahead[]; + + /** Position in lookahead input buffer used for "parse ahead". */ + protected int lookahead_pos; + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** Read from input to establish our buffer of "parse ahead" lookahead + * Symbols. + */ + protected void read_lookahead() throws java.lang.Exception + { + /* create the lookahead array */ + lookahead = new Symbol[error_sync_size()]; + + /* fill in the array */ + for (int i = 0; i < error_sync_size(); i++) + { + lookahead[i] = cur_token; + cur_token = scan(); + } + + /* start at the beginning */ + lookahead_pos = 0; + } + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** Return the current lookahead in our error "parse ahead" buffer. */ + protected Symbol cur_err_token() { return lookahead[lookahead_pos]; } + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** Advance to next "parse ahead" input Symbol. Return true if we have + * input to advance to, false otherwise. + */ + protected boolean advance_lookahead() + { + /* advance the input location */ + lookahead_pos++; + + /* return true if we didn't go off the end */ + return lookahead_pos < error_sync_size(); + } + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** Reset the parse ahead input to one Symbol past where we started error + * recovery (this consumes one new Symbol from the real input). + */ + protected void restart_lookahead() throws java.lang.Exception + { + /* move all the existing input over */ + for (int i = 1; i < error_sync_size(); i++) + lookahead[i-1] = lookahead[i]; + + /* read a new Symbol into the last spot */ + // BUG Fix by Bruce Hutton + // Computer Science Department, University of Auckland, + // Auckland, New Zealand. [applied 5-sep-1999 by csa] + // The following two lines were out of order!! + lookahead[error_sync_size()-1] = cur_token; + cur_token = scan(); + + /* reset our internal position marker */ + lookahead_pos = 0; + } + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** Do a simulated parse forward (a "parse ahead") from the current + * stack configuration using stored lookahead input and a virtual parse + * stack. Return true if we make it all the way through the stored + * lookahead input without error. This basically simulates the action of + * parse() using only our saved "parse ahead" input, and not executing any + * actions. + * + * @param debug should we produce debugging messages as we parse. + */ + protected boolean try_parse_ahead(boolean debug) + throws java.lang.Exception + { + int act; + short lhs, rhs_size; + + /* create a virtual stack from the real parse stack */ + virtual_parse_stack vstack = new virtual_parse_stack(stack); + + /* parse until we fail or get past the lookahead input */ + for (;;) + { + /* look up the action from the current state (on top of stack) */ + act = get_action(vstack.top(), cur_err_token().sym); + + /* if its an error, we fail */ + if (act == 0) return false; + + /* > 0 encodes a shift */ + if (act > 0) + { + /* push the new state on the stack */ + vstack.push(act-1); + + if (debug) debug_message("# Parse-ahead shifts Symbol #" + + cur_err_token().sym + " into state #" + (act-1)); + + /* advance simulated input, if we run off the end, we are done */ + if (!advance_lookahead()) return true; + } + /* < 0 encodes a reduce */ + else + { + /* if this is a reduce with the start production we are done */ + if ((-act)-1 == start_production()) + { + if (debug) debug_message("# Parse-ahead accepts"); + return true; + } + + /* get the lhs Symbol and the rhs size */ + lhs = production_tab[(-act)-1][0]; + rhs_size = production_tab[(-act)-1][1]; + + /* pop handle off the stack */ + for (int i = 0; i < rhs_size; i++) + vstack.pop(); + + if (debug) + debug_message("# Parse-ahead reduces: handle size = " + + rhs_size + " lhs = #" + lhs + " from state #" + vstack.top()); + + /* look up goto and push it onto the stack */ + vstack.push(get_reduce(vstack.top(), lhs)); + if (debug) + debug_message("# Goto state #" + vstack.top()); + } + } + } + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** Parse forward using stored lookahead Symbols. In this case we have + * already verified that parsing will make it through the stored lookahead + * Symbols and we are now getting back to the point at which we can hand + * control back to the normal parser. Consequently, this version of the + * parser performs all actions and modifies the real parse configuration. + * This returns once we have consumed all the stored input or we accept. + * + * @param debug should we produce debugging messages as we parse. + */ + protected void parse_lookahead(boolean debug) + throws java.lang.Exception + { + /* the current action code */ + int act; + + /* the Symbol/stack element returned by a reduce */ + Symbol lhs_sym = null; + + /* information about production being reduced with */ + short handle_size, lhs_sym_num; + + /* restart the saved input at the beginning */ + lookahead_pos = 0; + + if (debug) + { + debug_message("# Reparsing saved input with actions"); + debug_message("# Current Symbol is #" + cur_err_token().sym); + debug_message("# Current state is #" + + stack.peek().parse_state); + } + + /* continue until we accept or have read all lookahead input */ + while(!_done_parsing) + { + /* current state is always on the top of the stack */ + + /* look up action out of the current state with the current input */ + act = + get_action(stack.peek().parse_state, cur_err_token().sym); + + /* decode the action -- > 0 encodes shift */ + if (act > 0) + { + /* shift to the encoded state by pushing it on the stack */ + cur_err_token().parse_state = act-1; + cur_err_token().used_by_parser = true; + if (debug) debug_shift(cur_err_token()); + stack.push(cur_err_token()); + tos++; + + /* advance to the next Symbol, if there is none, we are done */ + if (!advance_lookahead()) + { + if (debug) debug_message("# Completed reparse"); + + /* scan next Symbol so we can continue parse */ + // BUGFIX by Chris Harris : + // correct a one-off error by commenting out + // this next line. + /*cur_token = scan();*/ + + /* go back to normal parser */ + return; + } + + if (debug) + debug_message("# Current Symbol is #" + cur_err_token().sym); + } + /* if its less than zero, then it encodes a reduce action */ + else if (act < 0) + { + /* perform the action for the reduce */ + lhs_sym = do_action((-act)-1, this, stack, tos); + + /* look up information about the production */ + lhs_sym_num = production_tab[(-act)-1][0]; + handle_size = production_tab[(-act)-1][1]; + + if (debug) debug_reduce((-act)-1, lhs_sym_num, handle_size); + + /* pop the handle off the stack */ + for (int i = 0; i < handle_size; i++) + { + stack.pop(); + tos--; + } + + /* look up the state to go to from the one popped back to */ + act = get_reduce(stack.peek().parse_state, lhs_sym_num); + + /* shift to that state */ + lhs_sym.parse_state = act; + lhs_sym.used_by_parser = true; + stack.push(lhs_sym); + tos++; + + if (debug) debug_message("# Goto state #" + act); + + } + /* finally if the entry is zero, we have an error + (shouldn't happen here, but...)*/ + else if (act == 0) + { + report_fatal_error("Syntax error", lhs_sym); + return; + } + } + + + } + + /*-----------------------------------------------------------*/ + + /** Utility function: unpacks parse tables from strings */ + protected static short[][] unpackFromStrings(String[] sa) + { + // Concatanate initialization strings. + StringBuilder sb = new StringBuilder(sa[0]); + for (int i=1; i shadowing_stack) throws java.lang.Exception + { + /* sanity check */ + if (shadowing_stack == null) + throw new Exception( + "Internal parser error: attempt to create null virtual stack"); + + /* set up our internals */ + real_stack = shadowing_stack; + vstack = new Stack(); + real_next = 0; + + /* get one element onto the virtual portion of the stack */ + get_from_real(); + } + + /*-----------------------------------------------------------*/ + /*--- (Access to) Instance Variables ------------------------*/ + /*-----------------------------------------------------------*/ + + /** The real stack that we shadow. This is accessed when we move off + * the bottom of the virtual portion of the stack, but is always left + * unmodified. + */ + protected Stack real_stack; + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** Top of stack indicator for where we leave off in the real stack. + * This is measured from top of stack, so 0 would indicate that no + * elements have been "moved" from the real to virtual stack. + */ + protected int real_next; + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** The virtual top portion of the stack. This stack contains Integer + * objects with state numbers. This stack shadows the top portion + * of the real stack within the area that has been modified (via operations + * on the virtual stack). When this portion of the stack becomes empty we + * transfer elements from the underlying stack onto this stack. + */ + protected Stack vstack; + + /*-----------------------------------------------------------*/ + /*--- General Methods ---------------------------------------*/ + /*-----------------------------------------------------------*/ + + /** Transfer an element from the real to the virtual stack. This assumes + * that the virtual stack is currently empty. + */ + protected void get_from_real() + { + Symbol stack_sym; + + /* don't transfer if the real stack is empty */ + if (real_next >= real_stack.size()) return; + + /* get a copy of the first Symbol we have not transfered */ + stack_sym = (Symbol)real_stack.elementAt(real_stack.size()-1-real_next); + + /* record the transfer */ + real_next++; + + /* put the state number from the Symbol onto the virtual stack */ + vstack.push(new Integer(stack_sym.parse_state)); + } + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** Indicate whether the stack is empty. */ + public boolean empty() + { + /* if vstack is empty then we were unable to transfer onto it and + the whole thing is empty. */ + return vstack.empty(); + } + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** Return value on the top of the stack (without popping it). */ + public int top() throws java.lang.Exception + { + if (vstack.empty()) + throw new Exception( + "Internal parser error: top() called on empty virtual stack"); + + return vstack.peek().intValue(); + } + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** Pop the stack. */ + public void pop() throws java.lang.Exception + { + if (vstack.empty()) + throw new Exception( + "Internal parser error: pop from empty virtual stack"); + + /* pop it */ + vstack.pop(); + + /* if we are now empty transfer an element (if there is one) */ + if (vstack.empty()) + get_from_real(); + } + + /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ + + /** Push a state number onto the stack. */ + public void push(int state_num) + { + vstack.push(new Integer(state_num)); + } + + /*-----------------------------------------------------------*/ + +} diff --git a/compiler/src/jflex.jar b/compiler/src/jflex.jar new file mode 100644 index 0000000..43a47a7 Binary files /dev/null and b/compiler/src/jflex.jar differ diff --git a/compiler/src/parser.states b/compiler/src/parser.states new file mode 100644 index 0000000..0dc1a92 --- /dev/null +++ b/compiler/src/parser.states @@ -0,0 +1,3570 @@ +===== Viable Prefix Recognizer ===== +START lalr_state [0]: { + [RoboDcl ::= (*) Identifier COLON EOL , {LOAD }] + [$START ::= (*) Program EOF , {EOF }] + [Program ::= (*) RoboDcl Load RoboBodyDcl , {EOF }] +} +transition on Identifier to state [3] +transition on RoboDcl to state [2] +transition on Program to state [1] + +------------------- +lalr_state [1]: { + [$START ::= Program (*) EOF , {EOF }] +} +transition on EOF to state [224] + +------------------- +lalr_state [2]: { + [Load ::= (*) Load LOAD LPAREN StringLit RPAREN EOL , {NUM BOOL STRING COORD LIST VOID EOL LOAD HEAR }] + [Load ::= (*) LOAD LPAREN StringLit RPAREN EOL , {NUM BOOL STRING COORD LIST VOID EOL LOAD HEAR }] + [Program ::= RoboDcl (*) Load RoboBodyDcl , {EOF }] +} +transition on Load to state [7] +transition on LOAD to state [6] + +------------------- +lalr_state [3]: { + [RoboDcl ::= Identifier (*) COLON EOL , {LOAD }] +} +transition on COLON to state [4] + +------------------- +lalr_state [4]: { + [RoboDcl ::= Identifier COLON (*) EOL , {LOAD }] +} +transition on EOL to state [5] + +------------------- +lalr_state [5]: { + [RoboDcl ::= Identifier COLON EOL (*) , {LOAD }] +} + +------------------- +lalr_state [6]: { + [Load ::= LOAD (*) LPAREN StringLit RPAREN EOL , {NUM BOOL STRING COORD LIST VOID EOL LOAD HEAR }] +} +transition on LPAREN to state [220] + +------------------- +lalr_state [7]: { + [PrimitiveType ::= (*) NUM , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [RoboBodyDcl ::= (*) RoboBodyDcl MemberDcl , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] + [FieldDcl ::= (*) Type VariableDclList EOL , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] + [MethodDcl ::= (*) MethodHeader MethodBody , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] + [Type ::= (*) ReferenceType , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [Load ::= Load (*) LOAD LPAREN StringLit RPAREN EOL , {NUM BOOL STRING COORD LIST VOID EOL LOAD HEAR }] + [ReferenceType ::= (*) COORD , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [MemberDcl ::= (*) MethodDcl , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] + [MethodHeader ::= (*) VOID MethodDeclarator , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [PrimitiveType ::= (*) BOOL , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [RoboBodyDcl ::= (*) MemberDcl , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] + [MethodDcl ::= (*) HearDecl , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] + [HearDecl ::= (*) HEAR Identifier LPAREN FormalParams RPAREN Block END HEAR , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] + [Type ::= (*) PrimitiveType , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [ReferenceType ::= (*) LIST , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [MemberDcl ::= (*) EOL , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] + [ReferenceType ::= (*) STRING , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [MemberDcl ::= (*) FieldDcl , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] + [Program ::= RoboDcl Load (*) RoboBodyDcl , {EOF }] + [MethodHeader ::= (*) Type MethodDeclarator , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on MethodHeader to state [25] +transition on VOID to state [24] +transition on ReferenceType to state [23] +transition on BOOL to state [22] +transition on MemberDcl to state [21] +transition on LOAD to state [20] +transition on MethodDcl to state [19] +transition on RoboBodyDcl to state [18] +transition on STRING to state [17] +transition on NUM to state [16] +transition on EOL to state [15] +transition on PrimitiveType to state [14] +transition on Type to state [13] +transition on HEAR to state [12] +transition on COORD to state [11] +transition on LIST to state [10] +transition on FieldDcl to state [9] +transition on HearDecl to state [8] + +------------------- +lalr_state [8]: { + [MethodDcl ::= HearDecl (*) , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] +} + +------------------- +lalr_state [9]: { + [MemberDcl ::= FieldDcl (*) , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] +} + +------------------- +lalr_state [10]: { + [ReferenceType ::= LIST (*) , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] +} + +------------------- +lalr_state [11]: { + [ReferenceType ::= COORD (*) , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] +} + +------------------- +lalr_state [12]: { + [HearDecl ::= HEAR (*) Identifier LPAREN FormalParams RPAREN Block END HEAR , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] +} +transition on Identifier to state [213] + +------------------- +lalr_state [13]: { + [MethodDeclarator ::= (*) Identifier LPAREN FormalParams RPAREN , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [UnaryExpr ::= (*) Primary , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) AdditiveExpression AdditiveExpressionEnd , {COMMA EOL XOR PLUS MINUS AND OR IS NOT LT GT LTE GTE }] + [ConditionalExpression ::= (*) ConditionOrExpression , {COMMA EOL }] + [Literal ::= (*) CoordLit , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [XORExpression ::= (*) EqualityExpression , {COMMA EOL XOR AND OR }] + [Assignment ::= (*) LeftHandSide ASSIGN Expression , {COMMA EOL }] + [VariableDcl ::= (*) VariableInitializer , {COMMA EOL }] + [Primary ::= (*) Literal , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [ConditionOrExpression ::= (*) ConditionAndExpression , {COMMA EOL OR }] + [TypeName ::= (*) Identifier , {DOT COMMA EOL XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) TRUE , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [XORExpression ::= (*) XORExpression XOR EqualityExpression , {COMMA EOL XOR AND OR }] + [LeftHandSide ::= (*) TypeName ListOpt , {ASSIGN }] + [VariableDcl ::= (*) Identifier ListInitializer , {COMMA EOL }] + [Literal ::= (*) NumLit , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) LPAREN Expression RPAREN , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) AdditiveExpression , {COMMA EOL XOR AND OR IS NOT LT GT LTE GTE }] + [ConditionOrExpression ::= (*) ConditionOrExpression OR ConditionAndExpression , {COMMA EOL OR }] + [Expression ::= (*) AssignmentExpression , {COMMA EOL }] + [FieldDcl ::= Type (*) VariableDclList EOL , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT COMMA EOL XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) FALSE , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [MethodHeader ::= Type (*) MethodDeclarator , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [UnaryExpr ::= (*) PLUS UnaryExpr , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [EqualityExpression ::= (*) RelationalExpression , {COMMA EOL XOR AND OR IS NOT }] + [VariableInitializer ::= (*) Expression , {COMMA EOL }] + [Literal ::= (*) BoolLit , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) TypeName ListOpt , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) UnaryExpr , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) RelationalExpression RelationalExpressionEnd , {COMMA EOL XOR AND OR IS NOT LT GT LTE GTE }] + [ConditionAndExpression ::= (*) XORExpression , {COMMA EOL AND OR }] + [AssignmentExpression ::= (*) ConditionalExpression , {COMMA EOL }] + [VariableDclList ::= (*) VariableDcl , {COMMA EOL }] + [UnaryExpr ::= (*) MINUS UnaryExpr , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) MultiExpr , {COMMA EOL XOR PLUS MINUS AND OR IS NOT LT GT LTE GTE }] + [EqualityExpression ::= (*) EqualityExpression EqualityExpressionEnd , {COMMA EOL XOR AND OR IS NOT }] + [Literal ::= (*) StringLit , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) MultiExpr MultiExprEnd , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [ConditionAndExpression ::= (*) ConditionAndExpression AND XORExpression , {COMMA EOL AND OR }] + [AssignmentExpression ::= (*) Assignment , {COMMA EOL }] + [VariableDclList ::= (*) VariableDclList COMMA VariableDcl , {COMMA EOL }] +} +transition on AssignmentExpression to state [85] +transition on CoordLit to state [84] +transition on Expression to state [136] +transition on StringLit to state [82] +transition on Literal to state [81] +transition on AdditiveExpression to state [80] +transition on MethodDeclarator to state [210] +transition on ConditionAndExpression to state [79] +transition on XORExpression to state [78] +transition on BoolLit to state [77] +transition on FALSE to state [76] +transition on MINUS to state [75] +transition on EqualityExpression to state [74] +transition on ConditionOrExpression to state [73] +transition on VariableDclList to state [209] +transition on RelationalExpression to state [72] +transition on VariableDcl to state [134] +transition on Identifier to state [208] +transition on ConditionalExpression to state [71] +transition on TypeName to state [70] +transition on LeftHandSide to state [29] +transition on LPAREN to state [69] +transition on MultiExpr to state [68] +transition on TRUE to state [67] +transition on VariableInitializer to state [132] +transition on Primary to state [66] +transition on NumLit to state [64] +transition on PLUS to state [63] +transition on Assignment to state [62] +transition on UnaryExpr to state [61] + +------------------- +lalr_state [14]: { + [Type ::= PrimitiveType (*) , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] +} + +------------------- +lalr_state [15]: { + [MemberDcl ::= EOL (*) , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] +} + +------------------- +lalr_state [16]: { + [PrimitiveType ::= NUM (*) , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] +} + +------------------- +lalr_state [17]: { + [ReferenceType ::= STRING (*) , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] +} + +------------------- +lalr_state [18]: { + [PrimitiveType ::= (*) NUM , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [RoboBodyDcl ::= RoboBodyDcl (*) MemberDcl , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] + [FieldDcl ::= (*) Type VariableDclList EOL , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] + [MethodDcl ::= (*) MethodHeader MethodBody , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] + [Type ::= (*) ReferenceType , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [ReferenceType ::= (*) COORD , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [MemberDcl ::= (*) MethodDcl , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] + [MethodHeader ::= (*) VOID MethodDeclarator , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [PrimitiveType ::= (*) BOOL , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [MethodDcl ::= (*) HearDecl , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] + [HearDecl ::= (*) HEAR Identifier LPAREN FormalParams RPAREN Block END HEAR , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] + [Type ::= (*) PrimitiveType , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [ReferenceType ::= (*) LIST , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [MemberDcl ::= (*) EOL , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] + [ReferenceType ::= (*) STRING , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [MemberDcl ::= (*) FieldDcl , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] + [Program ::= RoboDcl Load RoboBodyDcl (*) , {EOF }] + [MethodHeader ::= (*) Type MethodDeclarator , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on MethodDcl to state [19] +transition on HearDecl to state [8] +transition on PrimitiveType to state [14] +transition on LIST to state [10] +transition on FieldDcl to state [9] +transition on MemberDcl to state [207] +transition on STRING to state [17] +transition on VOID to state [24] +transition on MethodHeader to state [25] +transition on COORD to state [11] +transition on EOL to state [15] +transition on BOOL to state [22] +transition on ReferenceType to state [23] +transition on NUM to state [16] +transition on Type to state [13] +transition on HEAR to state [12] + +------------------- +lalr_state [19]: { + [MemberDcl ::= MethodDcl (*) , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] +} + +------------------- +lalr_state [20]: { + [Load ::= Load LOAD (*) LPAREN StringLit RPAREN EOL , {NUM BOOL STRING COORD LIST VOID EOL LOAD HEAR }] +} +transition on LPAREN to state [203] + +------------------- +lalr_state [21]: { + [RoboBodyDcl ::= MemberDcl (*) , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] +} + +------------------- +lalr_state [22]: { + [PrimitiveType ::= BOOL (*) , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] +} + +------------------- +lalr_state [23]: { + [Type ::= ReferenceType (*) , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] +} + +------------------- +lalr_state [24]: { + [MethodDeclarator ::= (*) Identifier LPAREN FormalParams RPAREN , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [MethodHeader ::= VOID (*) MethodDeclarator , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on Identifier to state [193] +transition on MethodDeclarator to state [192] + +------------------- +lalr_state [25]: { + [RepeatStmt ::= (*) REPEAT UNTIL LPAREN Expression RPAREN EOL Block END REPEAT , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [ReferenceType ::= (*) LIST , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [BreakStmt ::= (*) BREAK EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [StmtNoSubstmt ::= (*) SignalStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [BlockStmtList ::= (*) BlockStmtList BlockStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [MethodDcl ::= MethodHeader (*) MethodBody , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] + [Assignment ::= (*) LeftHandSide ASSIGN Expression , {EOL }] + [SignalStmt ::= (*) SIGNAL Identifier LPAREN ArgsList RPAREN EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [PrimitiveType ::= (*) NUM , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [Statement ::= (*) StmtNoSubstmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [MethodBody ::= (*) Block END Identifier , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] + [ForeverStmt ::= (*) FOREVER EOL Block END FOREVER , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [TypeName ::= (*) Identifier , {DOT LPAREN ASSIGN SQUARE_LEFT }] + [ReturnStmt ::= (*) RETURN Expression EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [StmtNoSubstmt ::= (*) ExprStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [BlockStmtList ::= (*) BlockStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LeftHandSide ::= (*) TypeName ListOpt , {ASSIGN }] + [ExprStmt ::= (*) StmtExpr EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [PrimitiveType ::= (*) BOOL , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [Statement ::= (*) IfStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT LPAREN ASSIGN SQUARE_LEFT }] + [IfStmt ::= (*) IF LPAREN Expression RPAREN EOL Block END IF ElseIfStmt ElseStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [StmtNoSubstmt ::= (*) BreakStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [BlockStmt ::= (*) LocalVariableDcl , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LoopStmt ::= (*) RepeatStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [ReferenceType ::= (*) STRING , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [StmtExpr ::= (*) Assignment , {EOL }] + [Statement ::= (*) LoopStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [Block ::= (*) BlockStmtList , {END }] + [StmtNoSubstmt ::= (*) ReturnStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [Type ::= (*) ReferenceType , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [BlockStmt ::= (*) Statement , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LoopStmt ::= (*) ForeverStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [StmtExpr ::= (*) MethodInvocation , {EOL }] + [ReferenceType ::= (*) COORD , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [StmtNoSubstmt ::= (*) EmptyStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [Block ::= (*) , {END }] + [MethodInvocation ::= (*) TypeName LPAREN FormalArgs RPAREN , {EOL }] + [Type ::= (*) PrimitiveType , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [EmptyStmt ::= (*) EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LocalVariableDcl ::= (*) Type VariableDclList EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on Block to state [55] +transition on StmtExpr to state [54] +transition on SIGNAL to state [53] +transition on BreakStmt to state [52] +transition on MethodInvocation to state [51] +transition on STRING to state [17] +transition on Type to state [50] +transition on Statement to state [49] +transition on EmptyStmt to state [48] +transition on LIST to state [10] +transition on Assignment to state [47] +transition on LoopStmt to state [46] +transition on SignalStmt to state [45] +transition on BlockStmtList to state [44] +transition on Identifier to state [43] +transition on IfStmt to state [42] +transition on MethodBody to state [41] +transition on BREAK to state [40] +transition on BlockStmt to state [39] +transition on RETURN to state [38] +transition on FOREVER to state [37] +transition on ReferenceType to state [23] +transition on COORD to state [11] +transition on IF to state [36] +transition on EOL to state [35] +transition on NUM to state [16] +transition on BOOL to state [22] +transition on RepeatStmt to state [34] +transition on LocalVariableDcl to state [33] +transition on REPEAT to state [32] +transition on TypeName to state [31] +transition on ForeverStmt to state [30] +transition on LeftHandSide to state [29] +transition on PrimitiveType to state [14] +transition on ExprStmt to state [28] +transition on StmtNoSubstmt to state [27] +transition on ReturnStmt to state [26] + +------------------- +lalr_state [26]: { + [StmtNoSubstmt ::= ReturnStmt (*) , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} + +------------------- +lalr_state [27]: { + [Statement ::= StmtNoSubstmt (*) , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} + +------------------- +lalr_state [28]: { + [StmtNoSubstmt ::= ExprStmt (*) , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} + +------------------- +lalr_state [29]: { + [Assignment ::= LeftHandSide (*) ASSIGN Expression , {COMMA RPAREN EOL SQUARE_RIGHT }] +} +transition on ASSIGN to state [190] + +------------------- +lalr_state [30]: { + [LoopStmt ::= ForeverStmt (*) , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} + +------------------- +lalr_state [31]: { + [TypeName ::= TypeName (*) DOT Identifier , {DOT LPAREN ASSIGN SQUARE_LEFT }] + [LeftHandSide ::= TypeName (*) ListOpt , {ASSIGN }] + [ListOpt ::= (*) , {ASSIGN }] + [MethodInvocation ::= TypeName (*) LPAREN FormalArgs RPAREN , {EOL }] + [ListOpt ::= (*) SQUARE_LEFT Expression SQUARE_RIGHT , {ASSIGN }] +} +transition on DOT to state [98] +transition on LPAREN to state [186] +transition on SQUARE_LEFT to state [97] +transition on ListOpt to state [185] + +------------------- +lalr_state [32]: { + [RepeatStmt ::= REPEAT (*) UNTIL LPAREN Expression RPAREN EOL Block END REPEAT , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on UNTIL to state [177] + +------------------- +lalr_state [33]: { + [BlockStmt ::= LocalVariableDcl (*) , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} + +------------------- +lalr_state [34]: { + [LoopStmt ::= RepeatStmt (*) , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} + +------------------- +lalr_state [35]: { + [EmptyStmt ::= EOL (*) , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} + +------------------- +lalr_state [36]: { + [IfStmt ::= IF (*) LPAREN Expression RPAREN EOL Block END IF ElseIfStmt ElseStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on LPAREN to state [155] + +------------------- +lalr_state [37]: { + [ForeverStmt ::= FOREVER (*) EOL Block END FOREVER , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on EOL to state [151] + +------------------- +lalr_state [38]: { + [Literal ::= (*) CoordLit , {EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) AdditiveExpression , {EOL XOR AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) UnaryExpr , {EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) Identifier , {DOT EOL XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) MINUS UnaryExpr , {EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [AssignmentExpression ::= (*) ConditionalExpression , {EOL }] + [ConditionAndExpression ::= (*) ConditionAndExpression AND XORExpression , {EOL AND OR }] + [Literal ::= (*) BoolLit , {EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) LPAREN Expression RPAREN , {EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [LeftHandSide ::= (*) TypeName ListOpt , {ASSIGN }] + [ConditionOrExpression ::= (*) ConditionOrExpression OR ConditionAndExpression , {EOL OR }] + [EqualityExpression ::= (*) RelationalExpression , {EOL XOR AND OR IS NOT }] + [BoolLit ::= (*) TRUE , {EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) RelationalExpression RelationalExpressionEnd , {EOL XOR AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) MultiExpr , {EOL XOR PLUS MINUS AND OR IS NOT LT GT LTE GTE }] + [ReturnStmt ::= RETURN (*) Expression EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [MultiExpr ::= (*) MultiExpr MultiExprEnd , {EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT EOL XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) Primary , {EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [AssignmentExpression ::= (*) Assignment , {EOL }] + [ConditionalExpression ::= (*) ConditionOrExpression , {EOL }] + [XORExpression ::= (*) EqualityExpression , {EOL XOR AND OR }] + [Literal ::= (*) StringLit , {EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) PLUS UnaryExpr , {EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) TypeName ListOpt , {EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Expression ::= (*) AssignmentExpression , {EOL }] + [ConditionAndExpression ::= (*) XORExpression , {EOL AND OR }] + [Literal ::= (*) NumLit , {EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [EqualityExpression ::= (*) EqualityExpression EqualityExpressionEnd , {EOL XOR AND OR IS NOT }] + [BoolLit ::= (*) FALSE , {EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) AdditiveExpression AdditiveExpressionEnd , {EOL XOR PLUS MINUS AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) Literal , {EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Assignment ::= (*) LeftHandSide ASSIGN Expression , {EOL }] + [ConditionOrExpression ::= (*) ConditionAndExpression , {EOL OR }] + [XORExpression ::= (*) XORExpression XOR EqualityExpression , {EOL XOR AND OR }] +} +transition on AssignmentExpression to state [85] +transition on CoordLit to state [84] +transition on Expression to state [149] +transition on StringLit to state [82] +transition on Literal to state [81] +transition on AdditiveExpression to state [80] +transition on ConditionAndExpression to state [79] +transition on BoolLit to state [77] +transition on XORExpression to state [78] +transition on MINUS to state [75] +transition on FALSE to state [76] +transition on EqualityExpression to state [74] +transition on ConditionOrExpression to state [73] +transition on RelationalExpression to state [72] +transition on ConditionalExpression to state [71] +transition on Identifier to state [43] +transition on TypeName to state [70] +transition on MultiExpr to state [68] +transition on LPAREN to state [69] +transition on LeftHandSide to state [29] +transition on TRUE to state [67] +transition on Primary to state [66] +transition on NumLit to state [64] +transition on PLUS to state [63] +transition on Assignment to state [62] +transition on UnaryExpr to state [61] + +------------------- +lalr_state [39]: { + [BlockStmtList ::= BlockStmt (*) , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} + +------------------- +lalr_state [40]: { + [BreakStmt ::= BREAK (*) EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on EOL to state [148] + +------------------- +lalr_state [41]: { + [MethodDcl ::= MethodHeader MethodBody (*) , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] +} + +------------------- +lalr_state [42]: { + [Statement ::= IfStmt (*) , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} + +------------------- +lalr_state [43]: { + [TypeName ::= Identifier (*) , {DOT COMMA LPAREN RPAREN EOL XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE END }] +} + +------------------- +lalr_state [44]: { + [RepeatStmt ::= (*) REPEAT UNTIL LPAREN Expression RPAREN EOL Block END REPEAT , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [ReferenceType ::= (*) LIST , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [BreakStmt ::= (*) BREAK EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [BlockStmtList ::= BlockStmtList (*) BlockStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [StmtNoSubstmt ::= (*) SignalStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [Assignment ::= (*) LeftHandSide ASSIGN Expression , {EOL }] + [SignalStmt ::= (*) SIGNAL Identifier LPAREN ArgsList RPAREN EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [PrimitiveType ::= (*) NUM , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [Statement ::= (*) StmtNoSubstmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [ForeverStmt ::= (*) FOREVER EOL Block END FOREVER , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [ReturnStmt ::= (*) RETURN Expression EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [TypeName ::= (*) Identifier , {DOT LPAREN ASSIGN SQUARE_LEFT }] + [StmtNoSubstmt ::= (*) ExprStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LeftHandSide ::= (*) TypeName ListOpt , {ASSIGN }] + [ExprStmt ::= (*) StmtExpr EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [PrimitiveType ::= (*) BOOL , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [Statement ::= (*) IfStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [IfStmt ::= (*) IF LPAREN Expression RPAREN EOL Block END IF ElseIfStmt ElseStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT LPAREN ASSIGN SQUARE_LEFT }] + [StmtNoSubstmt ::= (*) BreakStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [BlockStmt ::= (*) LocalVariableDcl , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LoopStmt ::= (*) RepeatStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [ReferenceType ::= (*) STRING , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [StmtExpr ::= (*) Assignment , {EOL }] + [Block ::= BlockStmtList (*) , {END }] + [Statement ::= (*) LoopStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [StmtNoSubstmt ::= (*) ReturnStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [Type ::= (*) ReferenceType , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [BlockStmt ::= (*) Statement , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LoopStmt ::= (*) ForeverStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [StmtExpr ::= (*) MethodInvocation , {EOL }] + [ReferenceType ::= (*) COORD , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [StmtNoSubstmt ::= (*) EmptyStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [MethodInvocation ::= (*) TypeName LPAREN FormalArgs RPAREN , {EOL }] + [Type ::= (*) PrimitiveType , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [EmptyStmt ::= (*) EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LocalVariableDcl ::= (*) Type VariableDclList EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on EmptyStmt to state [48] +transition on SignalStmt to state [45] +transition on REPEAT to state [32] +transition on IfStmt to state [42] +transition on ReferenceType to state [23] +transition on BOOL to state [22] +transition on BlockStmt to state [147] +transition on Statement to state [49] +transition on FOREVER to state [37] +transition on BreakStmt to state [52] +transition on LoopStmt to state [46] +transition on BREAK to state [40] +transition on RepeatStmt to state [34] +transition on Identifier to state [43] +transition on STRING to state [17] +transition on NUM to state [16] +transition on TypeName to state [31] +transition on ExprStmt to state [28] +transition on PrimitiveType to state [14] +transition on EOL to state [35] +transition on Type to state [50] +transition on LeftHandSide to state [29] +transition on IF to state [36] +transition on StmtNoSubstmt to state [27] +transition on SIGNAL to state [53] +transition on StmtExpr to state [54] +transition on RETURN to state [38] +transition on COORD to state [11] +transition on ForeverStmt to state [30] +transition on LIST to state [10] +transition on LocalVariableDcl to state [33] +transition on Assignment to state [47] +transition on MethodInvocation to state [51] +transition on ReturnStmt to state [26] + +------------------- +lalr_state [45]: { + [StmtNoSubstmt ::= SignalStmt (*) , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} + +------------------- +lalr_state [46]: { + [Statement ::= LoopStmt (*) , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} + +------------------- +lalr_state [47]: { + [StmtExpr ::= Assignment (*) , {EOL }] +} + +------------------- +lalr_state [48]: { + [StmtNoSubstmt ::= EmptyStmt (*) , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} + +------------------- +lalr_state [49]: { + [BlockStmt ::= Statement (*) , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} + +------------------- +lalr_state [50]: { + [UnaryExpr ::= (*) Primary , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) AdditiveExpression AdditiveExpressionEnd , {COMMA EOL XOR PLUS MINUS AND OR IS NOT LT GT LTE GTE }] + [ConditionalExpression ::= (*) ConditionOrExpression , {COMMA EOL }] + [Literal ::= (*) CoordLit , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [XORExpression ::= (*) EqualityExpression , {COMMA EOL XOR AND OR }] + [Assignment ::= (*) LeftHandSide ASSIGN Expression , {COMMA EOL }] + [VariableDcl ::= (*) VariableInitializer , {COMMA EOL }] + [Primary ::= (*) Literal , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [ConditionOrExpression ::= (*) ConditionAndExpression , {COMMA EOL OR }] + [TypeName ::= (*) Identifier , {DOT COMMA EOL XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) TRUE , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [XORExpression ::= (*) XORExpression XOR EqualityExpression , {COMMA EOL XOR AND OR }] + [LeftHandSide ::= (*) TypeName ListOpt , {ASSIGN }] + [VariableDcl ::= (*) Identifier ListInitializer , {COMMA EOL }] + [Literal ::= (*) NumLit , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) LPAREN Expression RPAREN , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) AdditiveExpression , {COMMA EOL XOR AND OR IS NOT LT GT LTE GTE }] + [ConditionOrExpression ::= (*) ConditionOrExpression OR ConditionAndExpression , {COMMA EOL OR }] + [Expression ::= (*) AssignmentExpression , {COMMA EOL }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT COMMA EOL XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) FALSE , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) PLUS UnaryExpr , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [EqualityExpression ::= (*) RelationalExpression , {COMMA EOL XOR AND OR IS NOT }] + [VariableInitializer ::= (*) Expression , {COMMA EOL }] + [Literal ::= (*) BoolLit , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) TypeName ListOpt , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) UnaryExpr , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) RelationalExpression RelationalExpressionEnd , {COMMA EOL XOR AND OR IS NOT LT GT LTE GTE }] + [ConditionAndExpression ::= (*) XORExpression , {COMMA EOL AND OR }] + [AssignmentExpression ::= (*) ConditionalExpression , {COMMA EOL }] + [VariableDclList ::= (*) VariableDcl , {COMMA EOL }] + [UnaryExpr ::= (*) MINUS UnaryExpr , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) MultiExpr , {COMMA EOL XOR PLUS MINUS AND OR IS NOT LT GT LTE GTE }] + [EqualityExpression ::= (*) EqualityExpression EqualityExpressionEnd , {COMMA EOL XOR AND OR IS NOT }] + [Literal ::= (*) StringLit , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) MultiExpr MultiExprEnd , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [ConditionAndExpression ::= (*) ConditionAndExpression AND XORExpression , {COMMA EOL AND OR }] + [AssignmentExpression ::= (*) Assignment , {COMMA EOL }] + [VariableDclList ::= (*) VariableDclList COMMA VariableDcl , {COMMA EOL }] + [LocalVariableDcl ::= Type (*) VariableDclList EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on AssignmentExpression to state [85] +transition on CoordLit to state [84] +transition on Expression to state [136] +transition on StringLit to state [82] +transition on Literal to state [81] +transition on AdditiveExpression to state [80] +transition on ConditionAndExpression to state [79] +transition on XORExpression to state [78] +transition on BoolLit to state [77] +transition on FALSE to state [76] +transition on MINUS to state [75] +transition on EqualityExpression to state [74] +transition on ConditionOrExpression to state [73] +transition on RelationalExpression to state [72] +transition on VariableDclList to state [135] +transition on VariableDcl to state [134] +transition on Identifier to state [133] +transition on ConditionalExpression to state [71] +transition on TypeName to state [70] +transition on LeftHandSide to state [29] +transition on LPAREN to state [69] +transition on MultiExpr to state [68] +transition on TRUE to state [67] +transition on VariableInitializer to state [132] +transition on Primary to state [66] +transition on NumLit to state [64] +transition on PLUS to state [63] +transition on Assignment to state [62] +transition on UnaryExpr to state [61] + +------------------- +lalr_state [51]: { + [StmtExpr ::= MethodInvocation (*) , {EOL }] +} + +------------------- +lalr_state [52]: { + [StmtNoSubstmt ::= BreakStmt (*) , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} + +------------------- +lalr_state [53]: { + [SignalStmt ::= SIGNAL (*) Identifier LPAREN ArgsList RPAREN EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on Identifier to state [59] + +------------------- +lalr_state [54]: { + [ExprStmt ::= StmtExpr (*) EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on EOL to state [58] + +------------------- +lalr_state [55]: { + [MethodBody ::= Block (*) END Identifier , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] +} +transition on END to state [56] + +------------------- +lalr_state [56]: { + [MethodBody ::= Block END (*) Identifier , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] +} +transition on Identifier to state [57] + +------------------- +lalr_state [57]: { + [MethodBody ::= Block END Identifier (*) , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] +} + +------------------- +lalr_state [58]: { + [ExprStmt ::= StmtExpr EOL (*) , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} + +------------------- +lalr_state [59]: { + [SignalStmt ::= SIGNAL Identifier (*) LPAREN ArgsList RPAREN EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on LPAREN to state [60] + +------------------- +lalr_state [60]: { + [UnaryExpr ::= (*) Primary , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) AdditiveExpression AdditiveExpressionEnd , {COMMA RPAREN XOR PLUS MINUS AND OR IS NOT LT GT LTE GTE }] + [ConditionalExpression ::= (*) ConditionOrExpression , {COMMA RPAREN }] + [Literal ::= (*) CoordLit , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [XORExpression ::= (*) EqualityExpression , {COMMA RPAREN XOR AND OR }] + [Assignment ::= (*) LeftHandSide ASSIGN Expression , {COMMA RPAREN }] + [SignalStmt ::= SIGNAL Identifier LPAREN (*) ArgsList RPAREN EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [Primary ::= (*) Literal , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [ConditionOrExpression ::= (*) ConditionAndExpression , {COMMA RPAREN OR }] + [TypeName ::= (*) Identifier , {DOT COMMA RPAREN XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) TRUE , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [XORExpression ::= (*) XORExpression XOR EqualityExpression , {COMMA RPAREN XOR AND OR }] + [LeftHandSide ::= (*) TypeName ListOpt , {ASSIGN }] + [Literal ::= (*) NumLit , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) LPAREN Expression RPAREN , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) AdditiveExpression , {COMMA RPAREN XOR AND OR IS NOT LT GT LTE GTE }] + [ConditionOrExpression ::= (*) ConditionOrExpression OR ConditionAndExpression , {COMMA RPAREN OR }] + [Expression ::= (*) AssignmentExpression , {COMMA RPAREN }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT COMMA RPAREN XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) FALSE , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [ArgsList ::= (*) ArgsList COMMA Expression , {COMMA RPAREN }] + [UnaryExpr ::= (*) PLUS UnaryExpr , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [EqualityExpression ::= (*) RelationalExpression , {COMMA RPAREN XOR AND OR IS NOT }] + [Literal ::= (*) BoolLit , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) TypeName ListOpt , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) UnaryExpr , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) RelationalExpression RelationalExpressionEnd , {COMMA RPAREN XOR AND OR IS NOT LT GT LTE GTE }] + [ConditionAndExpression ::= (*) XORExpression , {COMMA RPAREN AND OR }] + [AssignmentExpression ::= (*) ConditionalExpression , {COMMA RPAREN }] + [ArgsList ::= (*) Expression , {COMMA RPAREN }] + [UnaryExpr ::= (*) MINUS UnaryExpr , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) MultiExpr , {COMMA RPAREN XOR PLUS MINUS AND OR IS NOT LT GT LTE GTE }] + [EqualityExpression ::= (*) EqualityExpression EqualityExpressionEnd , {COMMA RPAREN XOR AND OR IS NOT }] + [Literal ::= (*) StringLit , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) MultiExpr MultiExprEnd , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [ConditionAndExpression ::= (*) ConditionAndExpression AND XORExpression , {COMMA RPAREN AND OR }] + [AssignmentExpression ::= (*) Assignment , {COMMA RPAREN }] +} +transition on AssignmentExpression to state [85] +transition on CoordLit to state [84] +transition on Expression to state [83] +transition on StringLit to state [82] +transition on Literal to state [81] +transition on AdditiveExpression to state [80] +transition on ConditionAndExpression to state [79] +transition on XORExpression to state [78] +transition on BoolLit to state [77] +transition on FALSE to state [76] +transition on MINUS to state [75] +transition on EqualityExpression to state [74] +transition on ConditionOrExpression to state [73] +transition on RelationalExpression to state [72] +transition on Identifier to state [43] +transition on ConditionalExpression to state [71] +transition on TypeName to state [70] +transition on LeftHandSide to state [29] +transition on LPAREN to state [69] +transition on MultiExpr to state [68] +transition on TRUE to state [67] +transition on Primary to state [66] +transition on ArgsList to state [65] +transition on NumLit to state [64] +transition on PLUS to state [63] +transition on Assignment to state [62] +transition on UnaryExpr to state [61] + +------------------- +lalr_state [61]: { + [MultiExpr ::= UnaryExpr (*) , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} + +------------------- +lalr_state [62]: { + [AssignmentExpression ::= Assignment (*) , {COMMA RPAREN EOL SQUARE_RIGHT }] +} + +------------------- +lalr_state [63]: { + [UnaryExpr ::= (*) PLUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) CoordLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) NumLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) TypeName ListOpt , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) Primary , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) FALSE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) StringLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) LPAREN Expression RPAREN , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) MINUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) TRUE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) BoolLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= PLUS (*) UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) Literal , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} +transition on Primary to state [66] +transition on LPAREN to state [69] +transition on BoolLit to state [77] +transition on FALSE to state [76] +transition on StringLit to state [82] +transition on TypeName to state [89] +transition on PLUS to state [63] +transition on Identifier to state [43] +transition on NumLit to state [64] +transition on TRUE to state [67] +transition on UnaryExpr to state [131] +transition on Literal to state [81] +transition on CoordLit to state [84] +transition on MINUS to state [75] + +------------------- +lalr_state [64]: { + [Literal ::= NumLit (*) , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE END }] +} + +------------------- +lalr_state [65]: { + [SignalStmt ::= SIGNAL Identifier LPAREN ArgsList (*) RPAREN EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [ArgsList ::= ArgsList (*) COMMA Expression , {COMMA RPAREN }] +} +transition on RPAREN to state [128] +transition on COMMA to state [127] + +------------------- +lalr_state [66]: { + [UnaryExpr ::= Primary (*) , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} + +------------------- +lalr_state [67]: { + [BoolLit ::= TRUE (*) , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE END }] +} + +------------------- +lalr_state [68]: { + [MultiExprEnd ::= (*) DIV UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExprEnd ::= (*) MULT UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= MultiExpr (*) , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= MultiExpr (*) MultiExprEnd , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} +transition on DIV to state [93] +transition on MULT to state [92] +transition on MultiExprEnd to state [91] + +------------------- +lalr_state [69]: { + [Literal ::= (*) CoordLit , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) AdditiveExpression , {RPAREN XOR AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) UnaryExpr , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) Identifier , {DOT RPAREN XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) MINUS UnaryExpr , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [AssignmentExpression ::= (*) ConditionalExpression , {RPAREN }] + [ConditionAndExpression ::= (*) ConditionAndExpression AND XORExpression , {RPAREN AND OR }] + [Literal ::= (*) BoolLit , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Primary ::= LPAREN (*) Expression RPAREN , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE END }] + [Primary ::= (*) LPAREN Expression RPAREN , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [LeftHandSide ::= (*) TypeName ListOpt , {ASSIGN }] + [ConditionOrExpression ::= (*) ConditionOrExpression OR ConditionAndExpression , {RPAREN OR }] + [EqualityExpression ::= (*) RelationalExpression , {RPAREN XOR AND OR IS NOT }] + [BoolLit ::= (*) TRUE , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) RelationalExpression RelationalExpressionEnd , {RPAREN XOR AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) MultiExpr , {RPAREN XOR PLUS MINUS AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) MultiExpr MultiExprEnd , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT RPAREN XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) Primary , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [AssignmentExpression ::= (*) Assignment , {RPAREN }] + [ConditionalExpression ::= (*) ConditionOrExpression , {RPAREN }] + [XORExpression ::= (*) EqualityExpression , {RPAREN XOR AND OR }] + [Literal ::= (*) StringLit , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) PLUS UnaryExpr , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) TypeName ListOpt , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Expression ::= (*) AssignmentExpression , {RPAREN }] + [ConditionAndExpression ::= (*) XORExpression , {RPAREN AND OR }] + [Literal ::= (*) NumLit , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [EqualityExpression ::= (*) EqualityExpression EqualityExpressionEnd , {RPAREN XOR AND OR IS NOT }] + [BoolLit ::= (*) FALSE , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) AdditiveExpression AdditiveExpressionEnd , {RPAREN XOR PLUS MINUS AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) Literal , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Assignment ::= (*) LeftHandSide ASSIGN Expression , {RPAREN }] + [ConditionOrExpression ::= (*) ConditionAndExpression , {RPAREN OR }] + [XORExpression ::= (*) XORExpression XOR EqualityExpression , {RPAREN XOR AND OR }] +} +transition on AssignmentExpression to state [85] +transition on CoordLit to state [84] +transition on Expression to state [125] +transition on StringLit to state [82] +transition on Literal to state [81] +transition on AdditiveExpression to state [80] +transition on ConditionAndExpression to state [79] +transition on BoolLit to state [77] +transition on XORExpression to state [78] +transition on MINUS to state [75] +transition on FALSE to state [76] +transition on EqualityExpression to state [74] +transition on ConditionOrExpression to state [73] +transition on RelationalExpression to state [72] +transition on ConditionalExpression to state [71] +transition on Identifier to state [43] +transition on TypeName to state [70] +transition on MultiExpr to state [68] +transition on LPAREN to state [69] +transition on LeftHandSide to state [29] +transition on TRUE to state [67] +transition on Primary to state [66] +transition on NumLit to state [64] +transition on PLUS to state [63] +transition on Assignment to state [62] +transition on UnaryExpr to state [61] + +------------------- +lalr_state [70]: { + [Primary ::= TypeName (*) ListOpt , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= TypeName (*) DOT Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [LeftHandSide ::= TypeName (*) ListOpt , {ASSIGN }] + [ListOpt ::= (*) , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV ASSIGN SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [ListOpt ::= (*) SQUARE_LEFT Expression SQUARE_RIGHT , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV ASSIGN SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} +transition on DOT to state [98] +transition on SQUARE_LEFT to state [97] +transition on ListOpt to state [124] + +------------------- +lalr_state [71]: { + [AssignmentExpression ::= ConditionalExpression (*) , {COMMA RPAREN EOL SQUARE_RIGHT }] +} + +------------------- +lalr_state [72]: { + [RelationalExpressionEnd ::= (*) GTE AdditiveExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [RelationalExpressionEnd ::= (*) LT AdditiveExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [EqualityExpression ::= RelationalExpression (*) , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT }] + [RelationalExpressionEnd ::= (*) LTE AdditiveExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= RelationalExpression (*) RelationalExpressionEnd , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [RelationalExpressionEnd ::= (*) GT AdditiveExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} +transition on RelationalExpressionEnd to state [115] +transition on LTE to state [114] +transition on GT to state [113] +transition on GTE to state [112] +transition on LT to state [111] + +------------------- +lalr_state [73]: { + [ConditionOrExpression ::= ConditionOrExpression (*) OR ConditionAndExpression , {COMMA RPAREN EOL SQUARE_RIGHT OR }] + [ConditionalExpression ::= ConditionOrExpression (*) , {COMMA RPAREN EOL SQUARE_RIGHT }] +} +transition on OR to state [122] + +------------------- +lalr_state [74]: { + [EqualityExpression ::= EqualityExpression (*) EqualityExpressionEnd , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT }] + [XORExpression ::= EqualityExpression (*) , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR }] + [EqualityExpressionEnd ::= (*) NOT RelationalExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT }] + [EqualityExpressionEnd ::= (*) IS RelationalExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT }] +} +transition on IS to state [109] +transition on EqualityExpressionEnd to state [108] +transition on NOT to state [107] + +------------------- +lalr_state [75]: { + [UnaryExpr ::= (*) PLUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) CoordLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) NumLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) TypeName ListOpt , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) Primary , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) FALSE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) StringLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= MINUS (*) UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) LPAREN Expression RPAREN , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) MINUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) TRUE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) BoolLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) Literal , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} +transition on Primary to state [66] +transition on LPAREN to state [69] +transition on BoolLit to state [77] +transition on FALSE to state [76] +transition on StringLit to state [82] +transition on TypeName to state [89] +transition on PLUS to state [63] +transition on Identifier to state [43] +transition on NumLit to state [64] +transition on TRUE to state [67] +transition on UnaryExpr to state [121] +transition on Literal to state [81] +transition on CoordLit to state [84] +transition on MINUS to state [75] + +------------------- +lalr_state [76]: { + [BoolLit ::= FALSE (*) , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE END }] +} + +------------------- +lalr_state [77]: { + [Literal ::= BoolLit (*) , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE END }] +} + +------------------- +lalr_state [78]: { + [XORExpression ::= XORExpression (*) XOR EqualityExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR }] + [ConditionAndExpression ::= XORExpression (*) , {COMMA RPAREN EOL SQUARE_RIGHT AND OR }] +} +transition on XOR to state [105] + +------------------- +lalr_state [79]: { + [ConditionAndExpression ::= ConditionAndExpression (*) AND XORExpression , {COMMA RPAREN EOL SQUARE_RIGHT AND OR }] + [ConditionOrExpression ::= ConditionAndExpression (*) , {COMMA RPAREN EOL SQUARE_RIGHT OR }] +} +transition on AND to state [103] + +------------------- +lalr_state [80]: { + [AdditiveExpressionEnd ::= (*) PLUS MultiExpr , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= AdditiveExpression (*) AdditiveExpressionEnd , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpressionEnd ::= (*) MINUS MultiExpr , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= AdditiveExpression (*) , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} +transition on MINUS to state [88] +transition on PLUS to state [87] +transition on AdditiveExpressionEnd to state [86] + +------------------- +lalr_state [81]: { + [Primary ::= Literal (*) , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE END }] +} + +------------------- +lalr_state [82]: { + [Literal ::= StringLit (*) , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE END }] +} + +------------------- +lalr_state [83]: { + [ArgsList ::= Expression (*) , {COMMA RPAREN }] +} + +------------------- +lalr_state [84]: { + [Literal ::= CoordLit (*) , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE END }] +} + +------------------- +lalr_state [85]: { + [Expression ::= AssignmentExpression (*) , {COMMA RPAREN EOL SQUARE_RIGHT }] +} + +------------------- +lalr_state [86]: { + [AdditiveExpression ::= AdditiveExpression AdditiveExpressionEnd (*) , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} + +------------------- +lalr_state [87]: { + [UnaryExpr ::= (*) PLUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpressionEnd ::= PLUS (*) MultiExpr , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) MultiExpr MultiExprEnd , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) CoordLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) NumLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) TypeName ListOpt , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) Primary , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) FALSE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) StringLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) LPAREN Expression RPAREN , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) MINUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) TRUE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) BoolLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) Literal , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} +transition on Primary to state [66] +transition on LPAREN to state [69] +transition on BoolLit to state [77] +transition on FALSE to state [76] +transition on MultiExpr to state [102] +transition on StringLit to state [82] +transition on TypeName to state [89] +transition on PLUS to state [63] +transition on Identifier to state [43] +transition on NumLit to state [64] +transition on TRUE to state [67] +transition on UnaryExpr to state [61] +transition on Literal to state [81] +transition on CoordLit to state [84] +transition on MINUS to state [75] + +------------------- +lalr_state [88]: { + [UnaryExpr ::= (*) PLUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) MultiExpr MultiExprEnd , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) CoordLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) NumLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) TypeName ListOpt , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) Primary , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) FALSE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) StringLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) LPAREN Expression RPAREN , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) MINUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpressionEnd ::= MINUS (*) MultiExpr , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) TRUE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) BoolLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) Literal , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} +transition on Primary to state [66] +transition on LPAREN to state [69] +transition on BoolLit to state [77] +transition on FALSE to state [76] +transition on MultiExpr to state [90] +transition on StringLit to state [82] +transition on TypeName to state [89] +transition on PLUS to state [63] +transition on Identifier to state [43] +transition on NumLit to state [64] +transition on TRUE to state [67] +transition on UnaryExpr to state [61] +transition on Literal to state [81] +transition on CoordLit to state [84] +transition on MINUS to state [75] + +------------------- +lalr_state [89]: { + [TypeName ::= TypeName (*) DOT Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE END }] + [Primary ::= TypeName (*) ListOpt , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE END }] + [ListOpt ::= (*) , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE END }] + [ListOpt ::= (*) SQUARE_LEFT Expression SQUARE_RIGHT , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE END }] +} +transition on DOT to state [98] +transition on SQUARE_LEFT to state [97] +transition on ListOpt to state [96] + +------------------- +lalr_state [90]: { + [MultiExprEnd ::= (*) DIV UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpressionEnd ::= MINUS MultiExpr (*) , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExprEnd ::= (*) MULT UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= MultiExpr (*) MultiExprEnd , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} +transition on DIV to state [93] +transition on MULT to state [92] +transition on MultiExprEnd to state [91] + +------------------- +lalr_state [91]: { + [MultiExpr ::= MultiExpr MultiExprEnd (*) , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} + +------------------- +lalr_state [92]: { + [UnaryExpr ::= (*) PLUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) CoordLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) NumLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) TypeName ListOpt , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) Primary , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) FALSE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) StringLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) LPAREN Expression RPAREN , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExprEnd ::= MULT (*) UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) MINUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) TRUE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) BoolLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) Literal , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} +transition on Primary to state [66] +transition on LPAREN to state [69] +transition on BoolLit to state [77] +transition on FALSE to state [76] +transition on StringLit to state [82] +transition on TypeName to state [89] +transition on PLUS to state [63] +transition on Identifier to state [43] +transition on NumLit to state [64] +transition on TRUE to state [67] +transition on UnaryExpr to state [95] +transition on Literal to state [81] +transition on CoordLit to state [84] +transition on MINUS to state [75] + +------------------- +lalr_state [93]: { + [UnaryExpr ::= (*) PLUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) CoordLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) NumLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) TypeName ListOpt , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExprEnd ::= DIV (*) UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) Primary , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) FALSE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) StringLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) LPAREN Expression RPAREN , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) MINUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) TRUE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) BoolLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) Literal , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} +transition on Primary to state [66] +transition on LPAREN to state [69] +transition on BoolLit to state [77] +transition on FALSE to state [76] +transition on StringLit to state [82] +transition on TypeName to state [89] +transition on PLUS to state [63] +transition on Identifier to state [43] +transition on NumLit to state [64] +transition on TRUE to state [67] +transition on UnaryExpr to state [94] +transition on Literal to state [81] +transition on CoordLit to state [84] +transition on MINUS to state [75] + +------------------- +lalr_state [94]: { + [MultiExprEnd ::= DIV UnaryExpr (*) , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} + +------------------- +lalr_state [95]: { + [MultiExprEnd ::= MULT UnaryExpr (*) , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} + +------------------- +lalr_state [96]: { + [Primary ::= TypeName ListOpt (*) , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE END }] +} + +------------------- +lalr_state [97]: { + [Literal ::= (*) CoordLit , {XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) AdditiveExpression , {XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) UnaryExpr , {XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) Identifier , {DOT XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) MINUS UnaryExpr , {XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AssignmentExpression ::= (*) ConditionalExpression , {SQUARE_RIGHT }] + [ConditionAndExpression ::= (*) ConditionAndExpression AND XORExpression , {SQUARE_RIGHT AND OR }] + [Literal ::= (*) BoolLit , {XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) LPAREN Expression RPAREN , {XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [LeftHandSide ::= (*) TypeName ListOpt , {ASSIGN }] + [ConditionOrExpression ::= (*) ConditionOrExpression OR ConditionAndExpression , {SQUARE_RIGHT OR }] + [EqualityExpression ::= (*) RelationalExpression , {XOR SQUARE_RIGHT AND OR IS NOT }] + [BoolLit ::= (*) TRUE , {XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) RelationalExpression RelationalExpressionEnd , {XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) MultiExpr , {XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) MultiExpr MultiExprEnd , {XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) Primary , {XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AssignmentExpression ::= (*) Assignment , {SQUARE_RIGHT }] + [ConditionalExpression ::= (*) ConditionOrExpression , {SQUARE_RIGHT }] + [XORExpression ::= (*) EqualityExpression , {XOR SQUARE_RIGHT AND OR }] + [Literal ::= (*) StringLit , {XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) PLUS UnaryExpr , {XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) TypeName ListOpt , {XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [ListOpt ::= SQUARE_LEFT (*) Expression SQUARE_RIGHT , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV ASSIGN SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE END }] + [Expression ::= (*) AssignmentExpression , {SQUARE_RIGHT }] + [ConditionAndExpression ::= (*) XORExpression , {SQUARE_RIGHT AND OR }] + [Literal ::= (*) NumLit , {XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [EqualityExpression ::= (*) EqualityExpression EqualityExpressionEnd , {XOR SQUARE_RIGHT AND OR IS NOT }] + [BoolLit ::= (*) FALSE , {XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) AdditiveExpression AdditiveExpressionEnd , {XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) Literal , {XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Assignment ::= (*) LeftHandSide ASSIGN Expression , {SQUARE_RIGHT }] + [ConditionOrExpression ::= (*) ConditionAndExpression , {SQUARE_RIGHT OR }] + [XORExpression ::= (*) XORExpression XOR EqualityExpression , {XOR SQUARE_RIGHT AND OR }] +} +transition on AssignmentExpression to state [85] +transition on CoordLit to state [84] +transition on Expression to state [100] +transition on StringLit to state [82] +transition on Literal to state [81] +transition on AdditiveExpression to state [80] +transition on ConditionAndExpression to state [79] +transition on BoolLit to state [77] +transition on XORExpression to state [78] +transition on MINUS to state [75] +transition on FALSE to state [76] +transition on EqualityExpression to state [74] +transition on ConditionOrExpression to state [73] +transition on RelationalExpression to state [72] +transition on ConditionalExpression to state [71] +transition on Identifier to state [43] +transition on TypeName to state [70] +transition on MultiExpr to state [68] +transition on LPAREN to state [69] +transition on LeftHandSide to state [29] +transition on TRUE to state [67] +transition on Primary to state [66] +transition on NumLit to state [64] +transition on PLUS to state [63] +transition on Assignment to state [62] +transition on UnaryExpr to state [61] + +------------------- +lalr_state [98]: { + [TypeName ::= TypeName DOT (*) Identifier , {DOT COMMA LPAREN RPAREN EOL XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE END }] +} +transition on Identifier to state [99] + +------------------- +lalr_state [99]: { + [TypeName ::= TypeName DOT Identifier (*) , {DOT COMMA LPAREN RPAREN EOL XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE END }] +} + +------------------- +lalr_state [100]: { + [ListOpt ::= SQUARE_LEFT Expression (*) SQUARE_RIGHT , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV ASSIGN SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE END }] +} +transition on SQUARE_RIGHT to state [101] + +------------------- +lalr_state [101]: { + [ListOpt ::= SQUARE_LEFT Expression SQUARE_RIGHT (*) , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV ASSIGN SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE END }] +} + +------------------- +lalr_state [102]: { + [MultiExprEnd ::= (*) DIV UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExprEnd ::= (*) MULT UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= MultiExpr (*) MultiExprEnd , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpressionEnd ::= PLUS MultiExpr (*) , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} +transition on DIV to state [93] +transition on MULT to state [92] +transition on MultiExprEnd to state [91] + +------------------- +lalr_state [103]: { + [Literal ::= (*) CoordLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) AdditiveExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) MINUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [ConditionAndExpression ::= ConditionAndExpression AND (*) XORExpression , {COMMA RPAREN EOL SQUARE_RIGHT AND OR }] + [Literal ::= (*) BoolLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) LPAREN Expression RPAREN , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [EqualityExpression ::= (*) RelationalExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT }] + [BoolLit ::= (*) TRUE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) RelationalExpression RelationalExpressionEnd , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) MultiExpr , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) MultiExpr MultiExprEnd , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) Primary , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [XORExpression ::= (*) EqualityExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR }] + [Literal ::= (*) StringLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) PLUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) TypeName ListOpt , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) NumLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [EqualityExpression ::= (*) EqualityExpression EqualityExpressionEnd , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT }] + [BoolLit ::= (*) FALSE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) AdditiveExpression AdditiveExpressionEnd , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) Literal , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [XORExpression ::= (*) XORExpression XOR EqualityExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR }] +} +transition on CoordLit to state [84] +transition on StringLit to state [82] +transition on Literal to state [81] +transition on AdditiveExpression to state [80] +transition on BoolLit to state [77] +transition on XORExpression to state [104] +transition on MINUS to state [75] +transition on FALSE to state [76] +transition on EqualityExpression to state [74] +transition on RelationalExpression to state [72] +transition on Identifier to state [43] +transition on TypeName to state [89] +transition on MultiExpr to state [68] +transition on LPAREN to state [69] +transition on TRUE to state [67] +transition on Primary to state [66] +transition on NumLit to state [64] +transition on PLUS to state [63] +transition on UnaryExpr to state [61] + +------------------- +lalr_state [104]: { + [ConditionAndExpression ::= ConditionAndExpression AND XORExpression (*) , {COMMA RPAREN EOL SQUARE_RIGHT AND OR }] + [XORExpression ::= XORExpression (*) XOR EqualityExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR }] +} +transition on XOR to state [105] + +------------------- +lalr_state [105]: { + [Literal ::= (*) CoordLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) AdditiveExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) MINUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) BoolLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) LPAREN Expression RPAREN , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [EqualityExpression ::= (*) RelationalExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT }] + [BoolLit ::= (*) TRUE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) RelationalExpression RelationalExpressionEnd , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) MultiExpr , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) MultiExpr MultiExprEnd , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) Primary , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) StringLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) PLUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) TypeName ListOpt , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) NumLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [EqualityExpression ::= (*) EqualityExpression EqualityExpressionEnd , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT }] + [BoolLit ::= (*) FALSE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) AdditiveExpression AdditiveExpressionEnd , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) Literal , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [XORExpression ::= XORExpression XOR (*) EqualityExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR }] +} +transition on CoordLit to state [84] +transition on StringLit to state [82] +transition on Literal to state [81] +transition on AdditiveExpression to state [80] +transition on BoolLit to state [77] +transition on MINUS to state [75] +transition on FALSE to state [76] +transition on EqualityExpression to state [106] +transition on RelationalExpression to state [72] +transition on Identifier to state [43] +transition on TypeName to state [89] +transition on MultiExpr to state [68] +transition on LPAREN to state [69] +transition on TRUE to state [67] +transition on Primary to state [66] +transition on NumLit to state [64] +transition on PLUS to state [63] +transition on UnaryExpr to state [61] + +------------------- +lalr_state [106]: { + [EqualityExpression ::= EqualityExpression (*) EqualityExpressionEnd , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT }] + [EqualityExpressionEnd ::= (*) NOT RelationalExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT }] + [XORExpression ::= XORExpression XOR EqualityExpression (*) , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR }] + [EqualityExpressionEnd ::= (*) IS RelationalExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT }] +} +transition on IS to state [109] +transition on EqualityExpressionEnd to state [108] +transition on NOT to state [107] + +------------------- +lalr_state [107]: { + [RelationalExpression ::= (*) AdditiveExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) CoordLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) MINUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) BoolLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) LPAREN Expression RPAREN , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) TRUE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) RelationalExpression RelationalExpressionEnd , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) MultiExpr , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) MultiExpr MultiExprEnd , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) Primary , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [EqualityExpressionEnd ::= NOT (*) RelationalExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT }] + [Literal ::= (*) StringLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) PLUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) TypeName ListOpt , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) NumLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) FALSE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) AdditiveExpression AdditiveExpressionEnd , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) Literal , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} +transition on Primary to state [66] +transition on LPAREN to state [69] +transition on BoolLit to state [77] +transition on FALSE to state [76] +transition on AdditiveExpression to state [80] +transition on MultiExpr to state [68] +transition on StringLit to state [82] +transition on TypeName to state [89] +transition on Identifier to state [43] +transition on PLUS to state [63] +transition on TRUE to state [67] +transition on NumLit to state [64] +transition on UnaryExpr to state [61] +transition on Literal to state [81] +transition on CoordLit to state [84] +transition on RelationalExpression to state [120] +transition on MINUS to state [75] + +------------------- +lalr_state [108]: { + [EqualityExpression ::= EqualityExpression EqualityExpressionEnd (*) , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT }] +} + +------------------- +lalr_state [109]: { + [RelationalExpression ::= (*) AdditiveExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) CoordLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) MINUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [EqualityExpressionEnd ::= IS (*) RelationalExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT }] + [Literal ::= (*) BoolLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) LPAREN Expression RPAREN , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) TRUE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) RelationalExpression RelationalExpressionEnd , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) MultiExpr , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) MultiExpr MultiExprEnd , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) Primary , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) StringLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) PLUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) TypeName ListOpt , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) NumLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) FALSE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) AdditiveExpression AdditiveExpressionEnd , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) Literal , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} +transition on Primary to state [66] +transition on LPAREN to state [69] +transition on BoolLit to state [77] +transition on FALSE to state [76] +transition on AdditiveExpression to state [80] +transition on MultiExpr to state [68] +transition on StringLit to state [82] +transition on TypeName to state [89] +transition on Identifier to state [43] +transition on PLUS to state [63] +transition on TRUE to state [67] +transition on NumLit to state [64] +transition on UnaryExpr to state [61] +transition on Literal to state [81] +transition on CoordLit to state [84] +transition on RelationalExpression to state [110] +transition on MINUS to state [75] + +------------------- +lalr_state [110]: { + [RelationalExpressionEnd ::= (*) GTE AdditiveExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [RelationalExpressionEnd ::= (*) LT AdditiveExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [RelationalExpressionEnd ::= (*) LTE AdditiveExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= RelationalExpression (*) RelationalExpressionEnd , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [EqualityExpressionEnd ::= IS RelationalExpression (*) , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT }] + [RelationalExpressionEnd ::= (*) GT AdditiveExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} +transition on RelationalExpressionEnd to state [115] +transition on LTE to state [114] +transition on GT to state [113] +transition on GTE to state [112] +transition on LT to state [111] + +------------------- +lalr_state [111]: { + [Literal ::= (*) CoordLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) MINUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) BoolLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) LPAREN Expression RPAREN , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) TRUE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) MultiExpr , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) MultiExpr MultiExprEnd , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) Primary , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) StringLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) PLUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) TypeName ListOpt , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) NumLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [RelationalExpressionEnd ::= LT (*) AdditiveExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) FALSE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) AdditiveExpression AdditiveExpressionEnd , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) Literal , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} +transition on Primary to state [66] +transition on LPAREN to state [69] +transition on BoolLit to state [77] +transition on FALSE to state [76] +transition on MultiExpr to state [68] +transition on StringLit to state [82] +transition on AdditiveExpression to state [119] +transition on TypeName to state [89] +transition on Identifier to state [43] +transition on PLUS to state [63] +transition on TRUE to state [67] +transition on NumLit to state [64] +transition on UnaryExpr to state [61] +transition on Literal to state [81] +transition on CoordLit to state [84] +transition on MINUS to state [75] + +------------------- +lalr_state [112]: { + [Literal ::= (*) CoordLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [RelationalExpressionEnd ::= GTE (*) AdditiveExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) MINUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) BoolLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) LPAREN Expression RPAREN , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) TRUE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) MultiExpr , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) MultiExpr MultiExprEnd , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) Primary , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) StringLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) PLUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) TypeName ListOpt , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) NumLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) FALSE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) AdditiveExpression AdditiveExpressionEnd , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) Literal , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} +transition on Primary to state [66] +transition on LPAREN to state [69] +transition on BoolLit to state [77] +transition on FALSE to state [76] +transition on AdditiveExpression to state [118] +transition on MultiExpr to state [68] +transition on StringLit to state [82] +transition on TypeName to state [89] +transition on Identifier to state [43] +transition on PLUS to state [63] +transition on TRUE to state [67] +transition on NumLit to state [64] +transition on UnaryExpr to state [61] +transition on Literal to state [81] +transition on CoordLit to state [84] +transition on MINUS to state [75] + +------------------- +lalr_state [113]: { + [Literal ::= (*) CoordLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) MINUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) BoolLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [RelationalExpressionEnd ::= GT (*) AdditiveExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) LPAREN Expression RPAREN , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) TRUE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) MultiExpr , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) MultiExpr MultiExprEnd , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) Primary , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) StringLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) PLUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) TypeName ListOpt , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) NumLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) FALSE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) AdditiveExpression AdditiveExpressionEnd , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) Literal , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} +transition on Primary to state [66] +transition on LPAREN to state [69] +transition on BoolLit to state [77] +transition on FALSE to state [76] +transition on AdditiveExpression to state [117] +transition on MultiExpr to state [68] +transition on StringLit to state [82] +transition on TypeName to state [89] +transition on Identifier to state [43] +transition on PLUS to state [63] +transition on TRUE to state [67] +transition on NumLit to state [64] +transition on UnaryExpr to state [61] +transition on Literal to state [81] +transition on CoordLit to state [84] +transition on MINUS to state [75] + +------------------- +lalr_state [114]: { + [Literal ::= (*) CoordLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) MINUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) BoolLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) LPAREN Expression RPAREN , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) TRUE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) MultiExpr , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) MultiExpr MultiExprEnd , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) Primary , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) StringLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [RelationalExpressionEnd ::= LTE (*) AdditiveExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) PLUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) TypeName ListOpt , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Literal ::= (*) NumLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) FALSE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) AdditiveExpression AdditiveExpressionEnd , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) Literal , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} +transition on Primary to state [66] +transition on LPAREN to state [69] +transition on BoolLit to state [77] +transition on FALSE to state [76] +transition on MultiExpr to state [68] +transition on StringLit to state [82] +transition on AdditiveExpression to state [116] +transition on TypeName to state [89] +transition on Identifier to state [43] +transition on PLUS to state [63] +transition on TRUE to state [67] +transition on NumLit to state [64] +transition on UnaryExpr to state [61] +transition on Literal to state [81] +transition on CoordLit to state [84] +transition on MINUS to state [75] + +------------------- +lalr_state [115]: { + [RelationalExpression ::= RelationalExpression RelationalExpressionEnd (*) , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} + +------------------- +lalr_state [116]: { + [AdditiveExpressionEnd ::= (*) PLUS MultiExpr , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= AdditiveExpression (*) AdditiveExpressionEnd , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [RelationalExpressionEnd ::= LTE AdditiveExpression (*) , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpressionEnd ::= (*) MINUS MultiExpr , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} +transition on MINUS to state [88] +transition on PLUS to state [87] +transition on AdditiveExpressionEnd to state [86] + +------------------- +lalr_state [117]: { + [AdditiveExpressionEnd ::= (*) PLUS MultiExpr , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= AdditiveExpression (*) AdditiveExpressionEnd , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpressionEnd ::= (*) MINUS MultiExpr , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [RelationalExpressionEnd ::= GT AdditiveExpression (*) , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} +transition on MINUS to state [88] +transition on PLUS to state [87] +transition on AdditiveExpressionEnd to state [86] + +------------------- +lalr_state [118]: { + [RelationalExpressionEnd ::= GTE AdditiveExpression (*) , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpressionEnd ::= (*) PLUS MultiExpr , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= AdditiveExpression (*) AdditiveExpressionEnd , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpressionEnd ::= (*) MINUS MultiExpr , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} +transition on MINUS to state [88] +transition on PLUS to state [87] +transition on AdditiveExpressionEnd to state [86] + +------------------- +lalr_state [119]: { + [AdditiveExpressionEnd ::= (*) PLUS MultiExpr , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [RelationalExpressionEnd ::= LT AdditiveExpression (*) , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= AdditiveExpression (*) AdditiveExpressionEnd , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpressionEnd ::= (*) MINUS MultiExpr , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} +transition on MINUS to state [88] +transition on PLUS to state [87] +transition on AdditiveExpressionEnd to state [86] + +------------------- +lalr_state [120]: { + [RelationalExpressionEnd ::= (*) GTE AdditiveExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [EqualityExpressionEnd ::= NOT RelationalExpression (*) , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT }] + [RelationalExpressionEnd ::= (*) LT AdditiveExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [RelationalExpressionEnd ::= (*) LTE AdditiveExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= RelationalExpression (*) RelationalExpressionEnd , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [RelationalExpressionEnd ::= (*) GT AdditiveExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} +transition on RelationalExpressionEnd to state [115] +transition on LTE to state [114] +transition on GT to state [113] +transition on GTE to state [112] +transition on LT to state [111] + +------------------- +lalr_state [121]: { + [UnaryExpr ::= MINUS UnaryExpr (*) , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} + +------------------- +lalr_state [122]: { + [Literal ::= (*) CoordLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) AdditiveExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) MINUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [ConditionAndExpression ::= (*) ConditionAndExpression AND XORExpression , {COMMA RPAREN EOL SQUARE_RIGHT AND OR }] + [Literal ::= (*) BoolLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) LPAREN Expression RPAREN , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [ConditionOrExpression ::= ConditionOrExpression OR (*) ConditionAndExpression , {COMMA RPAREN EOL SQUARE_RIGHT OR }] + [EqualityExpression ::= (*) RelationalExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT }] + [BoolLit ::= (*) TRUE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) RelationalExpression RelationalExpressionEnd , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) MultiExpr , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) MultiExpr MultiExprEnd , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) Primary , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [XORExpression ::= (*) EqualityExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR }] + [Literal ::= (*) StringLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) PLUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) TypeName ListOpt , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [ConditionAndExpression ::= (*) XORExpression , {COMMA RPAREN EOL SQUARE_RIGHT AND OR }] + [Literal ::= (*) NumLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [EqualityExpression ::= (*) EqualityExpression EqualityExpressionEnd , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT }] + [BoolLit ::= (*) FALSE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) AdditiveExpression AdditiveExpressionEnd , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) Literal , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [XORExpression ::= (*) XORExpression XOR EqualityExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR }] +} +transition on CoordLit to state [84] +transition on StringLit to state [82] +transition on Literal to state [81] +transition on AdditiveExpression to state [80] +transition on ConditionAndExpression to state [123] +transition on XORExpression to state [78] +transition on BoolLit to state [77] +transition on MINUS to state [75] +transition on FALSE to state [76] +transition on EqualityExpression to state [74] +transition on RelationalExpression to state [72] +transition on Identifier to state [43] +transition on TypeName to state [89] +transition on MultiExpr to state [68] +transition on LPAREN to state [69] +transition on TRUE to state [67] +transition on Primary to state [66] +transition on NumLit to state [64] +transition on PLUS to state [63] +transition on UnaryExpr to state [61] + +------------------- +lalr_state [123]: { + [ConditionOrExpression ::= ConditionOrExpression OR ConditionAndExpression (*) , {COMMA RPAREN EOL SQUARE_RIGHT OR }] + [ConditionAndExpression ::= ConditionAndExpression (*) AND XORExpression , {COMMA RPAREN EOL SQUARE_RIGHT AND OR }] +} +transition on AND to state [103] + +------------------- +lalr_state [124]: { + [LeftHandSide ::= TypeName ListOpt (*) , {ASSIGN }] + [Primary ::= TypeName ListOpt (*) , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} + +------------------- +lalr_state [125]: { + [Primary ::= LPAREN Expression (*) RPAREN , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE END }] +} +transition on RPAREN to state [126] + +------------------- +lalr_state [126]: { + [Primary ::= LPAREN Expression RPAREN (*) , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE END }] +} + +------------------- +lalr_state [127]: { + [Literal ::= (*) CoordLit , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) AdditiveExpression , {COMMA RPAREN XOR AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) UnaryExpr , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) Identifier , {DOT COMMA RPAREN XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) MINUS UnaryExpr , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [AssignmentExpression ::= (*) ConditionalExpression , {COMMA RPAREN }] + [ConditionAndExpression ::= (*) ConditionAndExpression AND XORExpression , {COMMA RPAREN AND OR }] + [Literal ::= (*) BoolLit , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [ArgsList ::= ArgsList COMMA (*) Expression , {COMMA RPAREN }] + [Primary ::= (*) LPAREN Expression RPAREN , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [LeftHandSide ::= (*) TypeName ListOpt , {ASSIGN }] + [ConditionOrExpression ::= (*) ConditionOrExpression OR ConditionAndExpression , {COMMA RPAREN OR }] + [EqualityExpression ::= (*) RelationalExpression , {COMMA RPAREN XOR AND OR IS NOT }] + [BoolLit ::= (*) TRUE , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) RelationalExpression RelationalExpressionEnd , {COMMA RPAREN XOR AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) MultiExpr , {COMMA RPAREN XOR PLUS MINUS AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) MultiExpr MultiExprEnd , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT COMMA RPAREN XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) Primary , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [AssignmentExpression ::= (*) Assignment , {COMMA RPAREN }] + [ConditionalExpression ::= (*) ConditionOrExpression , {COMMA RPAREN }] + [XORExpression ::= (*) EqualityExpression , {COMMA RPAREN XOR AND OR }] + [Literal ::= (*) StringLit , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) PLUS UnaryExpr , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) TypeName ListOpt , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Expression ::= (*) AssignmentExpression , {COMMA RPAREN }] + [ConditionAndExpression ::= (*) XORExpression , {COMMA RPAREN AND OR }] + [Literal ::= (*) NumLit , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [EqualityExpression ::= (*) EqualityExpression EqualityExpressionEnd , {COMMA RPAREN XOR AND OR IS NOT }] + [BoolLit ::= (*) FALSE , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) AdditiveExpression AdditiveExpressionEnd , {COMMA RPAREN XOR PLUS MINUS AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) Literal , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Assignment ::= (*) LeftHandSide ASSIGN Expression , {COMMA RPAREN }] + [ConditionOrExpression ::= (*) ConditionAndExpression , {COMMA RPAREN OR }] + [XORExpression ::= (*) XORExpression XOR EqualityExpression , {COMMA RPAREN XOR AND OR }] +} +transition on AssignmentExpression to state [85] +transition on CoordLit to state [84] +transition on Expression to state [130] +transition on StringLit to state [82] +transition on Literal to state [81] +transition on AdditiveExpression to state [80] +transition on ConditionAndExpression to state [79] +transition on BoolLit to state [77] +transition on XORExpression to state [78] +transition on MINUS to state [75] +transition on FALSE to state [76] +transition on EqualityExpression to state [74] +transition on ConditionOrExpression to state [73] +transition on RelationalExpression to state [72] +transition on ConditionalExpression to state [71] +transition on Identifier to state [43] +transition on TypeName to state [70] +transition on MultiExpr to state [68] +transition on LPAREN to state [69] +transition on LeftHandSide to state [29] +transition on TRUE to state [67] +transition on Primary to state [66] +transition on NumLit to state [64] +transition on PLUS to state [63] +transition on Assignment to state [62] +transition on UnaryExpr to state [61] + +------------------- +lalr_state [128]: { + [SignalStmt ::= SIGNAL Identifier LPAREN ArgsList RPAREN (*) EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on EOL to state [129] + +------------------- +lalr_state [129]: { + [SignalStmt ::= SIGNAL Identifier LPAREN ArgsList RPAREN EOL (*) , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} + +------------------- +lalr_state [130]: { + [ArgsList ::= ArgsList COMMA Expression (*) , {COMMA RPAREN }] +} + +------------------- +lalr_state [131]: { + [UnaryExpr ::= PLUS UnaryExpr (*) , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] +} + +------------------- +lalr_state [132]: { + [VariableDcl ::= VariableInitializer (*) , {COMMA EOL }] +} + +------------------- +lalr_state [133]: { + [ListInitializer ::= (*) LitList END Identifier , {COMMA EOL }] + [Literal ::= (*) CoordLit , {COMMA END }] + [Literal ::= (*) NumLit , {COMMA END }] + [Primary ::= (*) TypeName ListOpt , {COMMA END }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT COMMA SQUARE_LEFT END }] + [LitList ::= (*) Primary , {COMMA END }] + [BoolLit ::= (*) FALSE , {COMMA END }] + [Literal ::= (*) StringLit , {COMMA END }] + [Primary ::= (*) LPAREN Expression RPAREN , {COMMA END }] + [TypeName ::= Identifier (*) , {DOT COMMA EOL XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) Identifier , {DOT COMMA SQUARE_LEFT END }] + [VariableDcl ::= Identifier (*) ListInitializer , {COMMA EOL }] + [LitList ::= (*) LitList COMMA Primary , {COMMA END }] + [BoolLit ::= (*) TRUE , {COMMA END }] + [Literal ::= (*) BoolLit , {COMMA END }] + [Primary ::= (*) Literal , {COMMA END }] +} +transition on Primary to state [142] +transition on LPAREN to state [69] +transition on BoolLit to state [77] +transition on FALSE to state [76] +transition on StringLit to state [82] +transition on ListInitializer to state [141] +transition on TypeName to state [89] +transition on Identifier to state [43] +transition on NumLit to state [64] +transition on TRUE to state [67] +transition on Literal to state [81] +transition on LitList to state [140] +transition on CoordLit to state [84] + +------------------- +lalr_state [134]: { + [VariableDclList ::= VariableDcl (*) , {COMMA EOL }] +} + +------------------- +lalr_state [135]: { + [VariableDclList ::= VariableDclList (*) COMMA VariableDcl , {COMMA EOL }] + [LocalVariableDcl ::= Type VariableDclList (*) EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on EOL to state [138] +transition on COMMA to state [137] + +------------------- +lalr_state [136]: { + [VariableInitializer ::= Expression (*) , {COMMA EOL }] +} + +------------------- +lalr_state [137]: { + [UnaryExpr ::= (*) Primary , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) AdditiveExpression AdditiveExpressionEnd , {COMMA EOL XOR PLUS MINUS AND OR IS NOT LT GT LTE GTE }] + [ConditionalExpression ::= (*) ConditionOrExpression , {COMMA EOL }] + [Literal ::= (*) CoordLit , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [XORExpression ::= (*) EqualityExpression , {COMMA EOL XOR AND OR }] + [Assignment ::= (*) LeftHandSide ASSIGN Expression , {COMMA EOL }] + [VariableDcl ::= (*) VariableInitializer , {COMMA EOL }] + [Primary ::= (*) Literal , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [ConditionOrExpression ::= (*) ConditionAndExpression , {COMMA EOL OR }] + [TypeName ::= (*) Identifier , {DOT COMMA EOL XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) TRUE , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [XORExpression ::= (*) XORExpression XOR EqualityExpression , {COMMA EOL XOR AND OR }] + [LeftHandSide ::= (*) TypeName ListOpt , {ASSIGN }] + [VariableDcl ::= (*) Identifier ListInitializer , {COMMA EOL }] + [Literal ::= (*) NumLit , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) LPAREN Expression RPAREN , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) AdditiveExpression , {COMMA EOL XOR AND OR IS NOT LT GT LTE GTE }] + [ConditionOrExpression ::= (*) ConditionOrExpression OR ConditionAndExpression , {COMMA EOL OR }] + [Expression ::= (*) AssignmentExpression , {COMMA EOL }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT COMMA EOL XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) FALSE , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) PLUS UnaryExpr , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [EqualityExpression ::= (*) RelationalExpression , {COMMA EOL XOR AND OR IS NOT }] + [VariableInitializer ::= (*) Expression , {COMMA EOL }] + [Literal ::= (*) BoolLit , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) TypeName ListOpt , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) UnaryExpr , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) RelationalExpression RelationalExpressionEnd , {COMMA EOL XOR AND OR IS NOT LT GT LTE GTE }] + [ConditionAndExpression ::= (*) XORExpression , {COMMA EOL AND OR }] + [AssignmentExpression ::= (*) ConditionalExpression , {COMMA EOL }] + [UnaryExpr ::= (*) MINUS UnaryExpr , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) MultiExpr , {COMMA EOL XOR PLUS MINUS AND OR IS NOT LT GT LTE GTE }] + [EqualityExpression ::= (*) EqualityExpression EqualityExpressionEnd , {COMMA EOL XOR AND OR IS NOT }] + [Literal ::= (*) StringLit , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) MultiExpr MultiExprEnd , {COMMA EOL XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [VariableDclList ::= VariableDclList COMMA (*) VariableDcl , {COMMA EOL }] + [ConditionAndExpression ::= (*) ConditionAndExpression AND XORExpression , {COMMA EOL AND OR }] + [AssignmentExpression ::= (*) Assignment , {COMMA EOL }] +} +transition on AssignmentExpression to state [85] +transition on CoordLit to state [84] +transition on Expression to state [136] +transition on StringLit to state [82] +transition on Literal to state [81] +transition on AdditiveExpression to state [80] +transition on ConditionAndExpression to state [79] +transition on XORExpression to state [78] +transition on BoolLit to state [77] +transition on FALSE to state [76] +transition on MINUS to state [75] +transition on EqualityExpression to state [74] +transition on ConditionOrExpression to state [73] +transition on RelationalExpression to state [72] +transition on VariableDcl to state [139] +transition on Identifier to state [133] +transition on ConditionalExpression to state [71] +transition on TypeName to state [70] +transition on LeftHandSide to state [29] +transition on LPAREN to state [69] +transition on MultiExpr to state [68] +transition on TRUE to state [67] +transition on VariableInitializer to state [132] +transition on Primary to state [66] +transition on NumLit to state [64] +transition on PLUS to state [63] +transition on Assignment to state [62] +transition on UnaryExpr to state [61] + +------------------- +lalr_state [138]: { + [LocalVariableDcl ::= Type VariableDclList EOL (*) , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} + +------------------- +lalr_state [139]: { + [VariableDclList ::= VariableDclList COMMA VariableDcl (*) , {COMMA EOL }] +} + +------------------- +lalr_state [140]: { + [LitList ::= LitList (*) COMMA Primary , {COMMA END }] + [ListInitializer ::= LitList (*) END Identifier , {COMMA EOL }] +} +transition on END to state [144] +transition on COMMA to state [143] + +------------------- +lalr_state [141]: { + [VariableDcl ::= Identifier ListInitializer (*) , {COMMA EOL }] +} + +------------------- +lalr_state [142]: { + [LitList ::= Primary (*) , {COMMA END }] +} + +------------------- +lalr_state [143]: { + [Literal ::= (*) CoordLit , {COMMA END }] + [Literal ::= (*) NumLit , {COMMA END }] + [Primary ::= (*) TypeName ListOpt , {COMMA END }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT COMMA SQUARE_LEFT END }] + [BoolLit ::= (*) FALSE , {COMMA END }] + [Literal ::= (*) StringLit , {COMMA END }] + [Primary ::= (*) LPAREN Expression RPAREN , {COMMA END }] + [TypeName ::= (*) Identifier , {DOT COMMA SQUARE_LEFT END }] + [LitList ::= LitList COMMA (*) Primary , {COMMA END }] + [BoolLit ::= (*) TRUE , {COMMA END }] + [Literal ::= (*) BoolLit , {COMMA END }] + [Primary ::= (*) Literal , {COMMA END }] +} +transition on Primary to state [146] +transition on LPAREN to state [69] +transition on BoolLit to state [77] +transition on FALSE to state [76] +transition on StringLit to state [82] +transition on TypeName to state [89] +transition on Identifier to state [43] +transition on NumLit to state [64] +transition on TRUE to state [67] +transition on Literal to state [81] +transition on CoordLit to state [84] + +------------------- +lalr_state [144]: { + [ListInitializer ::= LitList END (*) Identifier , {COMMA EOL }] +} +transition on Identifier to state [145] + +------------------- +lalr_state [145]: { + [ListInitializer ::= LitList END Identifier (*) , {COMMA EOL }] +} + +------------------- +lalr_state [146]: { + [LitList ::= LitList COMMA Primary (*) , {COMMA END }] +} + +------------------- +lalr_state [147]: { + [BlockStmtList ::= BlockStmtList BlockStmt (*) , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} + +------------------- +lalr_state [148]: { + [BreakStmt ::= BREAK EOL (*) , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} + +------------------- +lalr_state [149]: { + [ReturnStmt ::= RETURN Expression (*) EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on EOL to state [150] + +------------------- +lalr_state [150]: { + [ReturnStmt ::= RETURN Expression EOL (*) , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} + +------------------- +lalr_state [151]: { + [RepeatStmt ::= (*) REPEAT UNTIL LPAREN Expression RPAREN EOL Block END REPEAT , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [ReferenceType ::= (*) LIST , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [BreakStmt ::= (*) BREAK EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [StmtNoSubstmt ::= (*) SignalStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [BlockStmtList ::= (*) BlockStmtList BlockStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [Assignment ::= (*) LeftHandSide ASSIGN Expression , {EOL }] + [SignalStmt ::= (*) SIGNAL Identifier LPAREN ArgsList RPAREN EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [PrimitiveType ::= (*) NUM , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [Statement ::= (*) StmtNoSubstmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [ForeverStmt ::= FOREVER EOL (*) Block END FOREVER , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [ForeverStmt ::= (*) FOREVER EOL Block END FOREVER , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [TypeName ::= (*) Identifier , {DOT LPAREN ASSIGN SQUARE_LEFT }] + [ReturnStmt ::= (*) RETURN Expression EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [StmtNoSubstmt ::= (*) ExprStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [BlockStmtList ::= (*) BlockStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LeftHandSide ::= (*) TypeName ListOpt , {ASSIGN }] + [ExprStmt ::= (*) StmtExpr EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [PrimitiveType ::= (*) BOOL , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [Statement ::= (*) IfStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [IfStmt ::= (*) IF LPAREN Expression RPAREN EOL Block END IF ElseIfStmt ElseStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT LPAREN ASSIGN SQUARE_LEFT }] + [StmtNoSubstmt ::= (*) BreakStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [BlockStmt ::= (*) LocalVariableDcl , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LoopStmt ::= (*) RepeatStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [ReferenceType ::= (*) STRING , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [StmtExpr ::= (*) Assignment , {EOL }] + [Statement ::= (*) LoopStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [Block ::= (*) BlockStmtList , {END }] + [StmtNoSubstmt ::= (*) ReturnStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [Type ::= (*) ReferenceType , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [BlockStmt ::= (*) Statement , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LoopStmt ::= (*) ForeverStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [StmtExpr ::= (*) MethodInvocation , {EOL }] + [ReferenceType ::= (*) COORD , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [StmtNoSubstmt ::= (*) EmptyStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [Block ::= (*) , {END }] + [MethodInvocation ::= (*) TypeName LPAREN FormalArgs RPAREN , {EOL }] + [Type ::= (*) PrimitiveType , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [EmptyStmt ::= (*) EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LocalVariableDcl ::= (*) Type VariableDclList EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on Block to state [152] +transition on StmtExpr to state [54] +transition on SIGNAL to state [53] +transition on BreakStmt to state [52] +transition on MethodInvocation to state [51] +transition on STRING to state [17] +transition on Type to state [50] +transition on Statement to state [49] +transition on EmptyStmt to state [48] +transition on LIST to state [10] +transition on Assignment to state [47] +transition on LoopStmt to state [46] +transition on SignalStmt to state [45] +transition on BlockStmtList to state [44] +transition on Identifier to state [43] +transition on IfStmt to state [42] +transition on BREAK to state [40] +transition on BlockStmt to state [39] +transition on RETURN to state [38] +transition on FOREVER to state [37] +transition on ReferenceType to state [23] +transition on COORD to state [11] +transition on IF to state [36] +transition on EOL to state [35] +transition on NUM to state [16] +transition on BOOL to state [22] +transition on RepeatStmt to state [34] +transition on LocalVariableDcl to state [33] +transition on REPEAT to state [32] +transition on TypeName to state [31] +transition on ForeverStmt to state [30] +transition on LeftHandSide to state [29] +transition on PrimitiveType to state [14] +transition on ExprStmt to state [28] +transition on StmtNoSubstmt to state [27] +transition on ReturnStmt to state [26] + +------------------- +lalr_state [152]: { + [ForeverStmt ::= FOREVER EOL Block (*) END FOREVER , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on END to state [153] + +------------------- +lalr_state [153]: { + [ForeverStmt ::= FOREVER EOL Block END (*) FOREVER , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on FOREVER to state [154] + +------------------- +lalr_state [154]: { + [ForeverStmt ::= FOREVER EOL Block END FOREVER (*) , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} + +------------------- +lalr_state [155]: { + [Literal ::= (*) CoordLit , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) AdditiveExpression , {RPAREN XOR AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) UnaryExpr , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) Identifier , {DOT RPAREN XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) MINUS UnaryExpr , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [AssignmentExpression ::= (*) ConditionalExpression , {RPAREN }] + [ConditionAndExpression ::= (*) ConditionAndExpression AND XORExpression , {RPAREN AND OR }] + [Literal ::= (*) BoolLit , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) LPAREN Expression RPAREN , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [LeftHandSide ::= (*) TypeName ListOpt , {ASSIGN }] + [ConditionOrExpression ::= (*) ConditionOrExpression OR ConditionAndExpression , {RPAREN OR }] + [EqualityExpression ::= (*) RelationalExpression , {RPAREN XOR AND OR IS NOT }] + [BoolLit ::= (*) TRUE , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) RelationalExpression RelationalExpressionEnd , {RPAREN XOR AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) MultiExpr , {RPAREN XOR PLUS MINUS AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) MultiExpr MultiExprEnd , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT RPAREN XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) Primary , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [AssignmentExpression ::= (*) Assignment , {RPAREN }] + [ConditionalExpression ::= (*) ConditionOrExpression , {RPAREN }] + [XORExpression ::= (*) EqualityExpression , {RPAREN XOR AND OR }] + [Literal ::= (*) StringLit , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) PLUS UnaryExpr , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) TypeName ListOpt , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Expression ::= (*) AssignmentExpression , {RPAREN }] + [ConditionAndExpression ::= (*) XORExpression , {RPAREN AND OR }] + [Literal ::= (*) NumLit , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [EqualityExpression ::= (*) EqualityExpression EqualityExpressionEnd , {RPAREN XOR AND OR IS NOT }] + [BoolLit ::= (*) FALSE , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [IfStmt ::= IF LPAREN (*) Expression RPAREN EOL Block END IF ElseIfStmt ElseStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [AdditiveExpression ::= (*) AdditiveExpression AdditiveExpressionEnd , {RPAREN XOR PLUS MINUS AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) Literal , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Assignment ::= (*) LeftHandSide ASSIGN Expression , {RPAREN }] + [ConditionOrExpression ::= (*) ConditionAndExpression , {RPAREN OR }] + [XORExpression ::= (*) XORExpression XOR EqualityExpression , {RPAREN XOR AND OR }] +} +transition on AssignmentExpression to state [85] +transition on CoordLit to state [84] +transition on Expression to state [156] +transition on StringLit to state [82] +transition on Literal to state [81] +transition on AdditiveExpression to state [80] +transition on ConditionAndExpression to state [79] +transition on BoolLit to state [77] +transition on XORExpression to state [78] +transition on MINUS to state [75] +transition on FALSE to state [76] +transition on EqualityExpression to state [74] +transition on ConditionOrExpression to state [73] +transition on RelationalExpression to state [72] +transition on ConditionalExpression to state [71] +transition on Identifier to state [43] +transition on TypeName to state [70] +transition on MultiExpr to state [68] +transition on LPAREN to state [69] +transition on LeftHandSide to state [29] +transition on TRUE to state [67] +transition on Primary to state [66] +transition on NumLit to state [64] +transition on PLUS to state [63] +transition on Assignment to state [62] +transition on UnaryExpr to state [61] + +------------------- +lalr_state [156]: { + [IfStmt ::= IF LPAREN Expression (*) RPAREN EOL Block END IF ElseIfStmt ElseStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on RPAREN to state [157] + +------------------- +lalr_state [157]: { + [IfStmt ::= IF LPAREN Expression RPAREN (*) EOL Block END IF ElseIfStmt ElseStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on EOL to state [158] + +------------------- +lalr_state [158]: { + [RepeatStmt ::= (*) REPEAT UNTIL LPAREN Expression RPAREN EOL Block END REPEAT , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [ReferenceType ::= (*) LIST , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [BreakStmt ::= (*) BREAK EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [StmtNoSubstmt ::= (*) SignalStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [BlockStmtList ::= (*) BlockStmtList BlockStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [Assignment ::= (*) LeftHandSide ASSIGN Expression , {EOL }] + [SignalStmt ::= (*) SIGNAL Identifier LPAREN ArgsList RPAREN EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [PrimitiveType ::= (*) NUM , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [Statement ::= (*) StmtNoSubstmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [ForeverStmt ::= (*) FOREVER EOL Block END FOREVER , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [TypeName ::= (*) Identifier , {DOT LPAREN ASSIGN SQUARE_LEFT }] + [ReturnStmt ::= (*) RETURN Expression EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [StmtNoSubstmt ::= (*) ExprStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [BlockStmtList ::= (*) BlockStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LeftHandSide ::= (*) TypeName ListOpt , {ASSIGN }] + [ExprStmt ::= (*) StmtExpr EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [PrimitiveType ::= (*) BOOL , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [Statement ::= (*) IfStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [IfStmt ::= IF LPAREN Expression RPAREN EOL (*) Block END IF ElseIfStmt ElseStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [IfStmt ::= (*) IF LPAREN Expression RPAREN EOL Block END IF ElseIfStmt ElseStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT LPAREN ASSIGN SQUARE_LEFT }] + [StmtNoSubstmt ::= (*) BreakStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [BlockStmt ::= (*) LocalVariableDcl , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LoopStmt ::= (*) RepeatStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [ReferenceType ::= (*) STRING , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [StmtExpr ::= (*) Assignment , {EOL }] + [Statement ::= (*) LoopStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [Block ::= (*) BlockStmtList , {END }] + [StmtNoSubstmt ::= (*) ReturnStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [Type ::= (*) ReferenceType , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [BlockStmt ::= (*) Statement , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LoopStmt ::= (*) ForeverStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [StmtExpr ::= (*) MethodInvocation , {EOL }] + [ReferenceType ::= (*) COORD , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [StmtNoSubstmt ::= (*) EmptyStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [Block ::= (*) , {END }] + [MethodInvocation ::= (*) TypeName LPAREN FormalArgs RPAREN , {EOL }] + [Type ::= (*) PrimitiveType , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [EmptyStmt ::= (*) EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LocalVariableDcl ::= (*) Type VariableDclList EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on Block to state [159] +transition on StmtExpr to state [54] +transition on SIGNAL to state [53] +transition on BreakStmt to state [52] +transition on MethodInvocation to state [51] +transition on STRING to state [17] +transition on Type to state [50] +transition on Statement to state [49] +transition on EmptyStmt to state [48] +transition on LIST to state [10] +transition on Assignment to state [47] +transition on LoopStmt to state [46] +transition on SignalStmt to state [45] +transition on BlockStmtList to state [44] +transition on Identifier to state [43] +transition on IfStmt to state [42] +transition on BREAK to state [40] +transition on BlockStmt to state [39] +transition on RETURN to state [38] +transition on FOREVER to state [37] +transition on ReferenceType to state [23] +transition on COORD to state [11] +transition on IF to state [36] +transition on EOL to state [35] +transition on NUM to state [16] +transition on BOOL to state [22] +transition on RepeatStmt to state [34] +transition on LocalVariableDcl to state [33] +transition on REPEAT to state [32] +transition on TypeName to state [31] +transition on ForeverStmt to state [30] +transition on LeftHandSide to state [29] +transition on PrimitiveType to state [14] +transition on ExprStmt to state [28] +transition on StmtNoSubstmt to state [27] +transition on ReturnStmt to state [26] + +------------------- +lalr_state [159]: { + [IfStmt ::= IF LPAREN Expression RPAREN EOL Block (*) END IF ElseIfStmt ElseStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on END to state [160] + +------------------- +lalr_state [160]: { + [IfStmt ::= IF LPAREN Expression RPAREN EOL Block END (*) IF ElseIfStmt ElseStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on IF to state [161] + +------------------- +lalr_state [161]: { + [ElseIfStmt ::= (*) ElseIfStmt ELSE IF LPAREN Expression RPAREN EOL Block END ELSEIF , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF ELSE REPEAT FOREVER }] + [ElseIfStmt ::= (*) , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF ELSE REPEAT FOREVER }] + [IfStmt ::= IF LPAREN Expression RPAREN EOL Block END IF (*) ElseIfStmt ElseStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on ElseIfStmt to state [162] + +------------------- +lalr_state [162]: { + [ElseStmt ::= (*) , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [ElseIfStmt ::= ElseIfStmt (*) ELSE IF LPAREN Expression RPAREN EOL Block END ELSEIF , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF ELSE REPEAT FOREVER }] + [ElseStmt ::= (*) ELSE EOL Block END ELSE , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [IfStmt ::= IF LPAREN Expression RPAREN EOL Block END IF ElseIfStmt (*) ElseStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on ElseStmt to state [164] +transition on ELSE to state [163] + +------------------- +lalr_state [163]: { + [ElseIfStmt ::= ElseIfStmt ELSE (*) IF LPAREN Expression RPAREN EOL Block END ELSEIF , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF ELSE REPEAT FOREVER }] + [ElseStmt ::= ELSE (*) EOL Block END ELSE , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on IF to state [166] +transition on EOL to state [165] + +------------------- +lalr_state [164]: { + [IfStmt ::= IF LPAREN Expression RPAREN EOL Block END IF ElseIfStmt ElseStmt (*) , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} + +------------------- +lalr_state [165]: { + [RepeatStmt ::= (*) REPEAT UNTIL LPAREN Expression RPAREN EOL Block END REPEAT , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [ReferenceType ::= (*) LIST , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [BreakStmt ::= (*) BREAK EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [StmtNoSubstmt ::= (*) SignalStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [BlockStmtList ::= (*) BlockStmtList BlockStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [Assignment ::= (*) LeftHandSide ASSIGN Expression , {EOL }] + [ElseStmt ::= ELSE EOL (*) Block END ELSE , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [SignalStmt ::= (*) SIGNAL Identifier LPAREN ArgsList RPAREN EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [PrimitiveType ::= (*) NUM , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [Statement ::= (*) StmtNoSubstmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [ForeverStmt ::= (*) FOREVER EOL Block END FOREVER , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [TypeName ::= (*) Identifier , {DOT LPAREN ASSIGN SQUARE_LEFT }] + [ReturnStmt ::= (*) RETURN Expression EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [StmtNoSubstmt ::= (*) ExprStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [BlockStmtList ::= (*) BlockStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LeftHandSide ::= (*) TypeName ListOpt , {ASSIGN }] + [ExprStmt ::= (*) StmtExpr EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [PrimitiveType ::= (*) BOOL , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [Statement ::= (*) IfStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [IfStmt ::= (*) IF LPAREN Expression RPAREN EOL Block END IF ElseIfStmt ElseStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT LPAREN ASSIGN SQUARE_LEFT }] + [StmtNoSubstmt ::= (*) BreakStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [BlockStmt ::= (*) LocalVariableDcl , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LoopStmt ::= (*) RepeatStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [ReferenceType ::= (*) STRING , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [StmtExpr ::= (*) Assignment , {EOL }] + [Statement ::= (*) LoopStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [Block ::= (*) BlockStmtList , {END }] + [StmtNoSubstmt ::= (*) ReturnStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [Type ::= (*) ReferenceType , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [BlockStmt ::= (*) Statement , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LoopStmt ::= (*) ForeverStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [StmtExpr ::= (*) MethodInvocation , {EOL }] + [ReferenceType ::= (*) COORD , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [StmtNoSubstmt ::= (*) EmptyStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [Block ::= (*) , {END }] + [MethodInvocation ::= (*) TypeName LPAREN FormalArgs RPAREN , {EOL }] + [Type ::= (*) PrimitiveType , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [EmptyStmt ::= (*) EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LocalVariableDcl ::= (*) Type VariableDclList EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on Block to state [174] +transition on StmtExpr to state [54] +transition on SIGNAL to state [53] +transition on BreakStmt to state [52] +transition on MethodInvocation to state [51] +transition on STRING to state [17] +transition on Type to state [50] +transition on Statement to state [49] +transition on EmptyStmt to state [48] +transition on LIST to state [10] +transition on Assignment to state [47] +transition on LoopStmt to state [46] +transition on SignalStmt to state [45] +transition on BlockStmtList to state [44] +transition on Identifier to state [43] +transition on IfStmt to state [42] +transition on BREAK to state [40] +transition on BlockStmt to state [39] +transition on RETURN to state [38] +transition on FOREVER to state [37] +transition on ReferenceType to state [23] +transition on COORD to state [11] +transition on IF to state [36] +transition on EOL to state [35] +transition on NUM to state [16] +transition on BOOL to state [22] +transition on RepeatStmt to state [34] +transition on LocalVariableDcl to state [33] +transition on REPEAT to state [32] +transition on TypeName to state [31] +transition on ForeverStmt to state [30] +transition on LeftHandSide to state [29] +transition on PrimitiveType to state [14] +transition on ExprStmt to state [28] +transition on StmtNoSubstmt to state [27] +transition on ReturnStmt to state [26] + +------------------- +lalr_state [166]: { + [ElseIfStmt ::= ElseIfStmt ELSE IF (*) LPAREN Expression RPAREN EOL Block END ELSEIF , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF ELSE REPEAT FOREVER }] +} +transition on LPAREN to state [167] + +------------------- +lalr_state [167]: { + [Literal ::= (*) CoordLit , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) AdditiveExpression , {RPAREN XOR AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) UnaryExpr , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) Identifier , {DOT RPAREN XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) MINUS UnaryExpr , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [AssignmentExpression ::= (*) ConditionalExpression , {RPAREN }] + [ElseIfStmt ::= ElseIfStmt ELSE IF LPAREN (*) Expression RPAREN EOL Block END ELSEIF , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF ELSE REPEAT FOREVER }] + [ConditionAndExpression ::= (*) ConditionAndExpression AND XORExpression , {RPAREN AND OR }] + [Literal ::= (*) BoolLit , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) LPAREN Expression RPAREN , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [LeftHandSide ::= (*) TypeName ListOpt , {ASSIGN }] + [ConditionOrExpression ::= (*) ConditionOrExpression OR ConditionAndExpression , {RPAREN OR }] + [EqualityExpression ::= (*) RelationalExpression , {RPAREN XOR AND OR IS NOT }] + [BoolLit ::= (*) TRUE , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) RelationalExpression RelationalExpressionEnd , {RPAREN XOR AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) MultiExpr , {RPAREN XOR PLUS MINUS AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) MultiExpr MultiExprEnd , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT RPAREN XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) Primary , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [AssignmentExpression ::= (*) Assignment , {RPAREN }] + [ConditionalExpression ::= (*) ConditionOrExpression , {RPAREN }] + [XORExpression ::= (*) EqualityExpression , {RPAREN XOR AND OR }] + [Literal ::= (*) StringLit , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) PLUS UnaryExpr , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) TypeName ListOpt , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Expression ::= (*) AssignmentExpression , {RPAREN }] + [ConditionAndExpression ::= (*) XORExpression , {RPAREN AND OR }] + [Literal ::= (*) NumLit , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [EqualityExpression ::= (*) EqualityExpression EqualityExpressionEnd , {RPAREN XOR AND OR IS NOT }] + [BoolLit ::= (*) FALSE , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) AdditiveExpression AdditiveExpressionEnd , {RPAREN XOR PLUS MINUS AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) Literal , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Assignment ::= (*) LeftHandSide ASSIGN Expression , {RPAREN }] + [ConditionOrExpression ::= (*) ConditionAndExpression , {RPAREN OR }] + [XORExpression ::= (*) XORExpression XOR EqualityExpression , {RPAREN XOR AND OR }] +} +transition on AssignmentExpression to state [85] +transition on CoordLit to state [84] +transition on Expression to state [168] +transition on StringLit to state [82] +transition on Literal to state [81] +transition on AdditiveExpression to state [80] +transition on ConditionAndExpression to state [79] +transition on BoolLit to state [77] +transition on XORExpression to state [78] +transition on MINUS to state [75] +transition on FALSE to state [76] +transition on EqualityExpression to state [74] +transition on ConditionOrExpression to state [73] +transition on RelationalExpression to state [72] +transition on ConditionalExpression to state [71] +transition on Identifier to state [43] +transition on TypeName to state [70] +transition on MultiExpr to state [68] +transition on LPAREN to state [69] +transition on LeftHandSide to state [29] +transition on TRUE to state [67] +transition on Primary to state [66] +transition on NumLit to state [64] +transition on PLUS to state [63] +transition on Assignment to state [62] +transition on UnaryExpr to state [61] + +------------------- +lalr_state [168]: { + [ElseIfStmt ::= ElseIfStmt ELSE IF LPAREN Expression (*) RPAREN EOL Block END ELSEIF , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF ELSE REPEAT FOREVER }] +} +transition on RPAREN to state [169] + +------------------- +lalr_state [169]: { + [ElseIfStmt ::= ElseIfStmt ELSE IF LPAREN Expression RPAREN (*) EOL Block END ELSEIF , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF ELSE REPEAT FOREVER }] +} +transition on EOL to state [170] + +------------------- +lalr_state [170]: { + [RepeatStmt ::= (*) REPEAT UNTIL LPAREN Expression RPAREN EOL Block END REPEAT , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [ReferenceType ::= (*) LIST , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [BreakStmt ::= (*) BREAK EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [StmtNoSubstmt ::= (*) SignalStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [BlockStmtList ::= (*) BlockStmtList BlockStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [Assignment ::= (*) LeftHandSide ASSIGN Expression , {EOL }] + [SignalStmt ::= (*) SIGNAL Identifier LPAREN ArgsList RPAREN EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [PrimitiveType ::= (*) NUM , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [Statement ::= (*) StmtNoSubstmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [ForeverStmt ::= (*) FOREVER EOL Block END FOREVER , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [TypeName ::= (*) Identifier , {DOT LPAREN ASSIGN SQUARE_LEFT }] + [ReturnStmt ::= (*) RETURN Expression EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [StmtNoSubstmt ::= (*) ExprStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [BlockStmtList ::= (*) BlockStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LeftHandSide ::= (*) TypeName ListOpt , {ASSIGN }] + [ExprStmt ::= (*) StmtExpr EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [PrimitiveType ::= (*) BOOL , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [Statement ::= (*) IfStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [IfStmt ::= (*) IF LPAREN Expression RPAREN EOL Block END IF ElseIfStmt ElseStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT LPAREN ASSIGN SQUARE_LEFT }] + [StmtNoSubstmt ::= (*) BreakStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [BlockStmt ::= (*) LocalVariableDcl , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LoopStmt ::= (*) RepeatStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [ReferenceType ::= (*) STRING , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [StmtExpr ::= (*) Assignment , {EOL }] + [Statement ::= (*) LoopStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [Block ::= (*) BlockStmtList , {END }] + [ElseIfStmt ::= ElseIfStmt ELSE IF LPAREN Expression RPAREN EOL (*) Block END ELSEIF , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF ELSE REPEAT FOREVER }] + [StmtNoSubstmt ::= (*) ReturnStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [Type ::= (*) ReferenceType , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [BlockStmt ::= (*) Statement , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LoopStmt ::= (*) ForeverStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [StmtExpr ::= (*) MethodInvocation , {EOL }] + [ReferenceType ::= (*) COORD , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [StmtNoSubstmt ::= (*) EmptyStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [Block ::= (*) , {END }] + [MethodInvocation ::= (*) TypeName LPAREN FormalArgs RPAREN , {EOL }] + [Type ::= (*) PrimitiveType , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [EmptyStmt ::= (*) EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LocalVariableDcl ::= (*) Type VariableDclList EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on Block to state [171] +transition on StmtExpr to state [54] +transition on SIGNAL to state [53] +transition on BreakStmt to state [52] +transition on MethodInvocation to state [51] +transition on STRING to state [17] +transition on Type to state [50] +transition on Statement to state [49] +transition on EmptyStmt to state [48] +transition on LIST to state [10] +transition on Assignment to state [47] +transition on LoopStmt to state [46] +transition on SignalStmt to state [45] +transition on BlockStmtList to state [44] +transition on Identifier to state [43] +transition on IfStmt to state [42] +transition on BREAK to state [40] +transition on BlockStmt to state [39] +transition on RETURN to state [38] +transition on FOREVER to state [37] +transition on ReferenceType to state [23] +transition on COORD to state [11] +transition on IF to state [36] +transition on EOL to state [35] +transition on NUM to state [16] +transition on BOOL to state [22] +transition on RepeatStmt to state [34] +transition on LocalVariableDcl to state [33] +transition on REPEAT to state [32] +transition on TypeName to state [31] +transition on ForeverStmt to state [30] +transition on LeftHandSide to state [29] +transition on PrimitiveType to state [14] +transition on ExprStmt to state [28] +transition on StmtNoSubstmt to state [27] +transition on ReturnStmt to state [26] + +------------------- +lalr_state [171]: { + [ElseIfStmt ::= ElseIfStmt ELSE IF LPAREN Expression RPAREN EOL Block (*) END ELSEIF , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF ELSE REPEAT FOREVER }] +} +transition on END to state [172] + +------------------- +lalr_state [172]: { + [ElseIfStmt ::= ElseIfStmt ELSE IF LPAREN Expression RPAREN EOL Block END (*) ELSEIF , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF ELSE REPEAT FOREVER }] +} +transition on ELSEIF to state [173] + +------------------- +lalr_state [173]: { + [ElseIfStmt ::= ElseIfStmt ELSE IF LPAREN Expression RPAREN EOL Block END ELSEIF (*) , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF ELSE REPEAT FOREVER }] +} + +------------------- +lalr_state [174]: { + [ElseStmt ::= ELSE EOL Block (*) END ELSE , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on END to state [175] + +------------------- +lalr_state [175]: { + [ElseStmt ::= ELSE EOL Block END (*) ELSE , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on ELSE to state [176] + +------------------- +lalr_state [176]: { + [ElseStmt ::= ELSE EOL Block END ELSE (*) , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} + +------------------- +lalr_state [177]: { + [RepeatStmt ::= REPEAT UNTIL (*) LPAREN Expression RPAREN EOL Block END REPEAT , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on LPAREN to state [178] + +------------------- +lalr_state [178]: { + [Literal ::= (*) CoordLit , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) AdditiveExpression , {RPAREN XOR AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) UnaryExpr , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) Identifier , {DOT RPAREN XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) MINUS UnaryExpr , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [AssignmentExpression ::= (*) ConditionalExpression , {RPAREN }] + [ConditionAndExpression ::= (*) ConditionAndExpression AND XORExpression , {RPAREN AND OR }] + [Literal ::= (*) BoolLit , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) LPAREN Expression RPAREN , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [LeftHandSide ::= (*) TypeName ListOpt , {ASSIGN }] + [ConditionOrExpression ::= (*) ConditionOrExpression OR ConditionAndExpression , {RPAREN OR }] + [EqualityExpression ::= (*) RelationalExpression , {RPAREN XOR AND OR IS NOT }] + [BoolLit ::= (*) TRUE , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) RelationalExpression RelationalExpressionEnd , {RPAREN XOR AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) MultiExpr , {RPAREN XOR PLUS MINUS AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) MultiExpr MultiExprEnd , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT RPAREN XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) Primary , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [AssignmentExpression ::= (*) Assignment , {RPAREN }] + [ConditionalExpression ::= (*) ConditionOrExpression , {RPAREN }] + [XORExpression ::= (*) EqualityExpression , {RPAREN XOR AND OR }] + [Literal ::= (*) StringLit , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [RepeatStmt ::= REPEAT UNTIL LPAREN (*) Expression RPAREN EOL Block END REPEAT , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [UnaryExpr ::= (*) PLUS UnaryExpr , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) TypeName ListOpt , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Expression ::= (*) AssignmentExpression , {RPAREN }] + [ConditionAndExpression ::= (*) XORExpression , {RPAREN AND OR }] + [Literal ::= (*) NumLit , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [EqualityExpression ::= (*) EqualityExpression EqualityExpressionEnd , {RPAREN XOR AND OR IS NOT }] + [BoolLit ::= (*) FALSE , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) AdditiveExpression AdditiveExpressionEnd , {RPAREN XOR PLUS MINUS AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) Literal , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Assignment ::= (*) LeftHandSide ASSIGN Expression , {RPAREN }] + [ConditionOrExpression ::= (*) ConditionAndExpression , {RPAREN OR }] + [XORExpression ::= (*) XORExpression XOR EqualityExpression , {RPAREN XOR AND OR }] +} +transition on AssignmentExpression to state [85] +transition on CoordLit to state [84] +transition on Expression to state [179] +transition on StringLit to state [82] +transition on Literal to state [81] +transition on AdditiveExpression to state [80] +transition on ConditionAndExpression to state [79] +transition on BoolLit to state [77] +transition on XORExpression to state [78] +transition on MINUS to state [75] +transition on FALSE to state [76] +transition on EqualityExpression to state [74] +transition on ConditionOrExpression to state [73] +transition on RelationalExpression to state [72] +transition on ConditionalExpression to state [71] +transition on Identifier to state [43] +transition on TypeName to state [70] +transition on MultiExpr to state [68] +transition on LPAREN to state [69] +transition on LeftHandSide to state [29] +transition on TRUE to state [67] +transition on Primary to state [66] +transition on NumLit to state [64] +transition on PLUS to state [63] +transition on Assignment to state [62] +transition on UnaryExpr to state [61] + +------------------- +lalr_state [179]: { + [RepeatStmt ::= REPEAT UNTIL LPAREN Expression (*) RPAREN EOL Block END REPEAT , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on RPAREN to state [180] + +------------------- +lalr_state [180]: { + [RepeatStmt ::= REPEAT UNTIL LPAREN Expression RPAREN (*) EOL Block END REPEAT , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on EOL to state [181] + +------------------- +lalr_state [181]: { + [RepeatStmt ::= REPEAT UNTIL LPAREN Expression RPAREN EOL (*) Block END REPEAT , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [RepeatStmt ::= (*) REPEAT UNTIL LPAREN Expression RPAREN EOL Block END REPEAT , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [ReferenceType ::= (*) LIST , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [BreakStmt ::= (*) BREAK EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [StmtNoSubstmt ::= (*) SignalStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [BlockStmtList ::= (*) BlockStmtList BlockStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [Assignment ::= (*) LeftHandSide ASSIGN Expression , {EOL }] + [SignalStmt ::= (*) SIGNAL Identifier LPAREN ArgsList RPAREN EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [PrimitiveType ::= (*) NUM , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [Statement ::= (*) StmtNoSubstmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [ForeverStmt ::= (*) FOREVER EOL Block END FOREVER , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [TypeName ::= (*) Identifier , {DOT LPAREN ASSIGN SQUARE_LEFT }] + [ReturnStmt ::= (*) RETURN Expression EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [StmtNoSubstmt ::= (*) ExprStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [BlockStmtList ::= (*) BlockStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LeftHandSide ::= (*) TypeName ListOpt , {ASSIGN }] + [ExprStmt ::= (*) StmtExpr EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [PrimitiveType ::= (*) BOOL , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [Statement ::= (*) IfStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [IfStmt ::= (*) IF LPAREN Expression RPAREN EOL Block END IF ElseIfStmt ElseStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT LPAREN ASSIGN SQUARE_LEFT }] + [StmtNoSubstmt ::= (*) BreakStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [BlockStmt ::= (*) LocalVariableDcl , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LoopStmt ::= (*) RepeatStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [ReferenceType ::= (*) STRING , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [StmtExpr ::= (*) Assignment , {EOL }] + [Statement ::= (*) LoopStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [Block ::= (*) BlockStmtList , {END }] + [StmtNoSubstmt ::= (*) ReturnStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [Type ::= (*) ReferenceType , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [BlockStmt ::= (*) Statement , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LoopStmt ::= (*) ForeverStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [StmtExpr ::= (*) MethodInvocation , {EOL }] + [ReferenceType ::= (*) COORD , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [StmtNoSubstmt ::= (*) EmptyStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [Block ::= (*) , {END }] + [MethodInvocation ::= (*) TypeName LPAREN FormalArgs RPAREN , {EOL }] + [Type ::= (*) PrimitiveType , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [EmptyStmt ::= (*) EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LocalVariableDcl ::= (*) Type VariableDclList EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on Block to state [182] +transition on StmtExpr to state [54] +transition on SIGNAL to state [53] +transition on BreakStmt to state [52] +transition on MethodInvocation to state [51] +transition on STRING to state [17] +transition on Type to state [50] +transition on Statement to state [49] +transition on EmptyStmt to state [48] +transition on LIST to state [10] +transition on Assignment to state [47] +transition on LoopStmt to state [46] +transition on SignalStmt to state [45] +transition on BlockStmtList to state [44] +transition on Identifier to state [43] +transition on IfStmt to state [42] +transition on BREAK to state [40] +transition on BlockStmt to state [39] +transition on RETURN to state [38] +transition on FOREVER to state [37] +transition on ReferenceType to state [23] +transition on COORD to state [11] +transition on IF to state [36] +transition on EOL to state [35] +transition on NUM to state [16] +transition on BOOL to state [22] +transition on RepeatStmt to state [34] +transition on LocalVariableDcl to state [33] +transition on REPEAT to state [32] +transition on TypeName to state [31] +transition on ForeverStmt to state [30] +transition on LeftHandSide to state [29] +transition on PrimitiveType to state [14] +transition on ExprStmt to state [28] +transition on StmtNoSubstmt to state [27] +transition on ReturnStmt to state [26] + +------------------- +lalr_state [182]: { + [RepeatStmt ::= REPEAT UNTIL LPAREN Expression RPAREN EOL Block (*) END REPEAT , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on END to state [183] + +------------------- +lalr_state [183]: { + [RepeatStmt ::= REPEAT UNTIL LPAREN Expression RPAREN EOL Block END (*) REPEAT , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on REPEAT to state [184] + +------------------- +lalr_state [184]: { + [RepeatStmt ::= REPEAT UNTIL LPAREN Expression RPAREN EOL Block END REPEAT (*) , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} + +------------------- +lalr_state [185]: { + [LeftHandSide ::= TypeName ListOpt (*) , {ASSIGN }] +} + +------------------- +lalr_state [186]: { + [UnaryExpr ::= (*) Primary , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) AdditiveExpression AdditiveExpressionEnd , {COMMA RPAREN XOR PLUS MINUS AND OR IS NOT LT GT LTE GTE }] + [ConditionalExpression ::= (*) ConditionOrExpression , {COMMA RPAREN }] + [Literal ::= (*) CoordLit , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [FormalArgs ::= (*) ArgsList , {RPAREN }] + [XORExpression ::= (*) EqualityExpression , {COMMA RPAREN XOR AND OR }] + [Assignment ::= (*) LeftHandSide ASSIGN Expression , {COMMA RPAREN }] + [Primary ::= (*) Literal , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [ConditionOrExpression ::= (*) ConditionAndExpression , {COMMA RPAREN OR }] + [TypeName ::= (*) Identifier , {DOT COMMA RPAREN XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) TRUE , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [FormalArgs ::= (*) , {RPAREN }] + [XORExpression ::= (*) XORExpression XOR EqualityExpression , {COMMA RPAREN XOR AND OR }] + [LeftHandSide ::= (*) TypeName ListOpt , {ASSIGN }] + [Literal ::= (*) NumLit , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) LPAREN Expression RPAREN , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) AdditiveExpression , {COMMA RPAREN XOR AND OR IS NOT LT GT LTE GTE }] + [ConditionOrExpression ::= (*) ConditionOrExpression OR ConditionAndExpression , {COMMA RPAREN OR }] + [Expression ::= (*) AssignmentExpression , {COMMA RPAREN }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT COMMA RPAREN XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) FALSE , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [ArgsList ::= (*) ArgsList COMMA Expression , {COMMA RPAREN }] + [UnaryExpr ::= (*) PLUS UnaryExpr , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [EqualityExpression ::= (*) RelationalExpression , {COMMA RPAREN XOR AND OR IS NOT }] + [Literal ::= (*) BoolLit , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) TypeName ListOpt , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) UnaryExpr , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) RelationalExpression RelationalExpressionEnd , {COMMA RPAREN XOR AND OR IS NOT LT GT LTE GTE }] + [ConditionAndExpression ::= (*) XORExpression , {COMMA RPAREN AND OR }] + [AssignmentExpression ::= (*) ConditionalExpression , {COMMA RPAREN }] + [ArgsList ::= (*) Expression , {COMMA RPAREN }] + [UnaryExpr ::= (*) MINUS UnaryExpr , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) MultiExpr , {COMMA RPAREN XOR PLUS MINUS AND OR IS NOT LT GT LTE GTE }] + [EqualityExpression ::= (*) EqualityExpression EqualityExpressionEnd , {COMMA RPAREN XOR AND OR IS NOT }] + [Literal ::= (*) StringLit , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [MethodInvocation ::= TypeName LPAREN (*) FormalArgs RPAREN , {EOL }] + [MultiExpr ::= (*) MultiExpr MultiExprEnd , {COMMA RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [ConditionAndExpression ::= (*) ConditionAndExpression AND XORExpression , {COMMA RPAREN AND OR }] + [AssignmentExpression ::= (*) Assignment , {COMMA RPAREN }] +} +transition on AssignmentExpression to state [85] +transition on CoordLit to state [84] +transition on Expression to state [83] +transition on StringLit to state [82] +transition on Literal to state [81] +transition on AdditiveExpression to state [80] +transition on ConditionAndExpression to state [79] +transition on XORExpression to state [78] +transition on BoolLit to state [77] +transition on FALSE to state [76] +transition on MINUS to state [75] +transition on EqualityExpression to state [74] +transition on ConditionOrExpression to state [73] +transition on RelationalExpression to state [72] +transition on Identifier to state [43] +transition on ConditionalExpression to state [71] +transition on TypeName to state [70] +transition on LeftHandSide to state [29] +transition on LPAREN to state [69] +transition on MultiExpr to state [68] +transition on TRUE to state [67] +transition on Primary to state [66] +transition on ArgsList to state [188] +transition on FormalArgs to state [187] +transition on NumLit to state [64] +transition on PLUS to state [63] +transition on Assignment to state [62] +transition on UnaryExpr to state [61] + +------------------- +lalr_state [187]: { + [MethodInvocation ::= TypeName LPAREN FormalArgs (*) RPAREN , {EOL }] +} +transition on RPAREN to state [189] + +------------------- +lalr_state [188]: { + [FormalArgs ::= ArgsList (*) , {RPAREN }] + [ArgsList ::= ArgsList (*) COMMA Expression , {COMMA RPAREN }] +} +transition on COMMA to state [127] + +------------------- +lalr_state [189]: { + [MethodInvocation ::= TypeName LPAREN FormalArgs RPAREN (*) , {EOL }] +} + +------------------- +lalr_state [190]: { + [Literal ::= (*) CoordLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) AdditiveExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) MINUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AssignmentExpression ::= (*) ConditionalExpression , {COMMA RPAREN EOL SQUARE_RIGHT }] + [ConditionAndExpression ::= (*) ConditionAndExpression AND XORExpression , {COMMA RPAREN EOL SQUARE_RIGHT AND OR }] + [Literal ::= (*) BoolLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) LPAREN Expression RPAREN , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [LeftHandSide ::= (*) TypeName ListOpt , {ASSIGN }] + [ConditionOrExpression ::= (*) ConditionOrExpression OR ConditionAndExpression , {COMMA RPAREN EOL SQUARE_RIGHT OR }] + [EqualityExpression ::= (*) RelationalExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT }] + [BoolLit ::= (*) TRUE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) RelationalExpression RelationalExpressionEnd , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) MultiExpr , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) MultiExpr MultiExprEnd , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT COMMA RPAREN EOL XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) Primary , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AssignmentExpression ::= (*) Assignment , {COMMA RPAREN EOL SQUARE_RIGHT }] + [ConditionalExpression ::= (*) ConditionOrExpression , {COMMA RPAREN EOL SQUARE_RIGHT }] + [XORExpression ::= (*) EqualityExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR }] + [Literal ::= (*) StringLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) PLUS UnaryExpr , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) TypeName ListOpt , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Expression ::= (*) AssignmentExpression , {COMMA RPAREN EOL SQUARE_RIGHT }] + [ConditionAndExpression ::= (*) XORExpression , {COMMA RPAREN EOL SQUARE_RIGHT AND OR }] + [Literal ::= (*) NumLit , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [EqualityExpression ::= (*) EqualityExpression EqualityExpressionEnd , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR IS NOT }] + [BoolLit ::= (*) FALSE , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) AdditiveExpression AdditiveExpressionEnd , {COMMA RPAREN EOL XOR PLUS MINUS SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Primary ::= (*) Literal , {COMMA RPAREN EOL XOR PLUS MINUS MULT DIV SQUARE_RIGHT AND OR IS NOT LT GT LTE GTE }] + [Assignment ::= LeftHandSide ASSIGN (*) Expression , {COMMA RPAREN EOL SQUARE_RIGHT }] + [Assignment ::= (*) LeftHandSide ASSIGN Expression , {COMMA RPAREN EOL SQUARE_RIGHT }] + [ConditionOrExpression ::= (*) ConditionAndExpression , {COMMA RPAREN EOL SQUARE_RIGHT OR }] + [XORExpression ::= (*) XORExpression XOR EqualityExpression , {COMMA RPAREN EOL XOR SQUARE_RIGHT AND OR }] +} +transition on AssignmentExpression to state [85] +transition on CoordLit to state [84] +transition on Expression to state [191] +transition on StringLit to state [82] +transition on Literal to state [81] +transition on AdditiveExpression to state [80] +transition on ConditionAndExpression to state [79] +transition on BoolLit to state [77] +transition on XORExpression to state [78] +transition on MINUS to state [75] +transition on FALSE to state [76] +transition on EqualityExpression to state [74] +transition on ConditionOrExpression to state [73] +transition on RelationalExpression to state [72] +transition on ConditionalExpression to state [71] +transition on Identifier to state [43] +transition on TypeName to state [70] +transition on MultiExpr to state [68] +transition on LPAREN to state [69] +transition on LeftHandSide to state [29] +transition on TRUE to state [67] +transition on Primary to state [66] +transition on NumLit to state [64] +transition on PLUS to state [63] +transition on Assignment to state [62] +transition on UnaryExpr to state [61] + +------------------- +lalr_state [191]: { + [Assignment ::= LeftHandSide ASSIGN Expression (*) , {COMMA RPAREN EOL SQUARE_RIGHT }] +} + +------------------- +lalr_state [192]: { + [MethodHeader ::= VOID MethodDeclarator (*) , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} + +------------------- +lalr_state [193]: { + [MethodDeclarator ::= Identifier (*) LPAREN FormalParams RPAREN , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on LPAREN to state [194] + +------------------- +lalr_state [194]: { + [ReferenceType ::= (*) LIST , {Identifier }] + [PrimitiveType ::= (*) BOOL , {Identifier }] + [ParamsList ::= (*) Param , {COMMA RPAREN }] + [FormalParams ::= (*) ParamsList , {RPAREN }] + [Type ::= (*) ReferenceType , {Identifier }] + [ReferenceType ::= (*) COORD , {Identifier }] + [PrimitiveType ::= (*) NUM , {Identifier }] + [ParamsList ::= (*) ParamsList COMMA Param , {COMMA RPAREN }] + [ReferenceType ::= (*) STRING , {Identifier }] + [Param ::= (*) Type Identifier , {COMMA RPAREN }] + [Type ::= (*) PrimitiveType , {Identifier }] + [FormalParams ::= (*) , {RPAREN }] + [MethodDeclarator ::= Identifier LPAREN (*) FormalParams RPAREN , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on PrimitiveType to state [14] +transition on FormalParams to state [198] +transition on LIST to state [10] +transition on STRING to state [17] +transition on ParamsList to state [197] +transition on COORD to state [11] +transition on BOOL to state [22] +transition on ReferenceType to state [23] +transition on NUM to state [16] +transition on Param to state [196] +transition on Type to state [195] + +------------------- +lalr_state [195]: { + [Param ::= Type (*) Identifier , {COMMA RPAREN }] +} +transition on Identifier to state [202] + +------------------- +lalr_state [196]: { + [ParamsList ::= Param (*) , {COMMA RPAREN }] +} + +------------------- +lalr_state [197]: { + [ParamsList ::= ParamsList (*) COMMA Param , {COMMA RPAREN }] + [FormalParams ::= ParamsList (*) , {RPAREN }] +} +transition on COMMA to state [200] + +------------------- +lalr_state [198]: { + [MethodDeclarator ::= Identifier LPAREN FormalParams (*) RPAREN , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on RPAREN to state [199] + +------------------- +lalr_state [199]: { + [MethodDeclarator ::= Identifier LPAREN FormalParams RPAREN (*) , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} + +------------------- +lalr_state [200]: { + [ReferenceType ::= (*) LIST , {Identifier }] + [PrimitiveType ::= (*) BOOL , {Identifier }] + [Type ::= (*) ReferenceType , {Identifier }] + [ParamsList ::= ParamsList COMMA (*) Param , {COMMA RPAREN }] + [ReferenceType ::= (*) COORD , {Identifier }] + [PrimitiveType ::= (*) NUM , {Identifier }] + [ReferenceType ::= (*) STRING , {Identifier }] + [Param ::= (*) Type Identifier , {COMMA RPAREN }] + [Type ::= (*) PrimitiveType , {Identifier }] +} +transition on PrimitiveType to state [14] +transition on LIST to state [10] +transition on STRING to state [17] +transition on COORD to state [11] +transition on BOOL to state [22] +transition on ReferenceType to state [23] +transition on NUM to state [16] +transition on Type to state [195] +transition on Param to state [201] + +------------------- +lalr_state [201]: { + [ParamsList ::= ParamsList COMMA Param (*) , {COMMA RPAREN }] +} + +------------------- +lalr_state [202]: { + [Param ::= Type Identifier (*) , {COMMA RPAREN }] +} + +------------------- +lalr_state [203]: { + [Load ::= Load LOAD LPAREN (*) StringLit RPAREN EOL , {NUM BOOL STRING COORD LIST VOID EOL LOAD HEAR }] +} +transition on StringLit to state [204] + +------------------- +lalr_state [204]: { + [Load ::= Load LOAD LPAREN StringLit (*) RPAREN EOL , {NUM BOOL STRING COORD LIST VOID EOL LOAD HEAR }] +} +transition on RPAREN to state [205] + +------------------- +lalr_state [205]: { + [Load ::= Load LOAD LPAREN StringLit RPAREN (*) EOL , {NUM BOOL STRING COORD LIST VOID EOL LOAD HEAR }] +} +transition on EOL to state [206] + +------------------- +lalr_state [206]: { + [Load ::= Load LOAD LPAREN StringLit RPAREN EOL (*) , {NUM BOOL STRING COORD LIST VOID EOL LOAD HEAR }] +} + +------------------- +lalr_state [207]: { + [RoboBodyDcl ::= RoboBodyDcl MemberDcl (*) , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] +} + +------------------- +lalr_state [208]: { + [MethodDeclarator ::= Identifier (*) LPAREN FormalParams RPAREN , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [ListInitializer ::= (*) LitList END Identifier , {COMMA EOL }] + [Literal ::= (*) CoordLit , {COMMA END }] + [Literal ::= (*) NumLit , {COMMA END }] + [Primary ::= (*) TypeName ListOpt , {COMMA END }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT COMMA SQUARE_LEFT END }] + [LitList ::= (*) Primary , {COMMA END }] + [BoolLit ::= (*) FALSE , {COMMA END }] + [Literal ::= (*) StringLit , {COMMA END }] + [Primary ::= (*) LPAREN Expression RPAREN , {COMMA END }] + [TypeName ::= Identifier (*) , {DOT COMMA EOL XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT AND OR IS NOT LT GT LTE GTE }] + [TypeName ::= (*) Identifier , {DOT COMMA SQUARE_LEFT END }] + [VariableDcl ::= Identifier (*) ListInitializer , {COMMA EOL }] + [LitList ::= (*) LitList COMMA Primary , {COMMA END }] + [BoolLit ::= (*) TRUE , {COMMA END }] + [Literal ::= (*) BoolLit , {COMMA END }] + [Primary ::= (*) Literal , {COMMA END }] +} +transition on Primary to state [142] +transition on LPAREN to state [212] +transition on BoolLit to state [77] +transition on FALSE to state [76] +transition on StringLit to state [82] +transition on ListInitializer to state [141] +transition on TypeName to state [89] +transition on Identifier to state [43] +transition on NumLit to state [64] +transition on TRUE to state [67] +transition on Literal to state [81] +transition on LitList to state [140] +transition on CoordLit to state [84] + +------------------- +lalr_state [209]: { + [VariableDclList ::= VariableDclList (*) COMMA VariableDcl , {COMMA EOL }] + [FieldDcl ::= Type VariableDclList (*) EOL , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] +} +transition on EOL to state [211] +transition on COMMA to state [137] + +------------------- +lalr_state [210]: { + [MethodHeader ::= Type MethodDeclarator (*) , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} + +------------------- +lalr_state [211]: { + [FieldDcl ::= Type VariableDclList EOL (*) , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] +} + +------------------- +lalr_state [212]: { + [FormalParams ::= (*) ParamsList , {RPAREN }] + [UnaryExpr ::= (*) Primary , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) AdditiveExpression AdditiveExpressionEnd , {RPAREN XOR PLUS MINUS AND OR IS NOT LT GT LTE GTE }] + [ConditionalExpression ::= (*) ConditionOrExpression , {RPAREN }] + [ReferenceType ::= (*) LIST , {Identifier }] + [Literal ::= (*) CoordLit , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [XORExpression ::= (*) EqualityExpression , {RPAREN XOR AND OR }] + [Assignment ::= (*) LeftHandSide ASSIGN Expression , {RPAREN }] + [PrimitiveType ::= (*) NUM , {Identifier }] + [FormalParams ::= (*) , {RPAREN }] + [Primary ::= (*) Literal , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [ConditionOrExpression ::= (*) ConditionAndExpression , {RPAREN OR }] + [TypeName ::= (*) Identifier , {DOT RPAREN XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) TRUE , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [XORExpression ::= (*) XORExpression XOR EqualityExpression , {RPAREN XOR AND OR }] + [LeftHandSide ::= (*) TypeName ListOpt , {ASSIGN }] + [PrimitiveType ::= (*) BOOL , {Identifier }] + [Literal ::= (*) NumLit , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [ParamsList ::= (*) ParamsList COMMA Param , {COMMA RPAREN }] + [Primary ::= LPAREN (*) Expression RPAREN , {COMMA END }] + [Primary ::= (*) LPAREN Expression RPAREN , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) AdditiveExpression , {RPAREN XOR AND OR IS NOT LT GT LTE GTE }] + [ConditionOrExpression ::= (*) ConditionOrExpression OR ConditionAndExpression , {RPAREN OR }] + [Expression ::= (*) AssignmentExpression , {RPAREN }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT RPAREN XOR PLUS MINUS MULT DIV ASSIGN SQUARE_LEFT AND OR IS NOT LT GT LTE GTE }] + [BoolLit ::= (*) FALSE , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [UnaryExpr ::= (*) PLUS UnaryExpr , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [EqualityExpression ::= (*) RelationalExpression , {RPAREN XOR AND OR IS NOT }] + [ReferenceType ::= (*) STRING , {Identifier }] + [Literal ::= (*) BoolLit , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [ParamsList ::= (*) Param , {COMMA RPAREN }] + [Primary ::= (*) TypeName ListOpt , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [MultiExpr ::= (*) UnaryExpr , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [RelationalExpression ::= (*) RelationalExpression RelationalExpressionEnd , {RPAREN XOR AND OR IS NOT LT GT LTE GTE }] + [ConditionAndExpression ::= (*) XORExpression , {RPAREN AND OR }] + [AssignmentExpression ::= (*) ConditionalExpression , {RPAREN }] + [Type ::= (*) ReferenceType , {Identifier }] + [UnaryExpr ::= (*) MINUS UnaryExpr , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [AdditiveExpression ::= (*) MultiExpr , {RPAREN XOR PLUS MINUS AND OR IS NOT LT GT LTE GTE }] + [EqualityExpression ::= (*) EqualityExpression EqualityExpressionEnd , {RPAREN XOR AND OR IS NOT }] + [ReferenceType ::= (*) COORD , {Identifier }] + [Literal ::= (*) StringLit , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [Param ::= (*) Type Identifier , {COMMA RPAREN }] + [MultiExpr ::= (*) MultiExpr MultiExprEnd , {RPAREN XOR PLUS MINUS MULT DIV AND OR IS NOT LT GT LTE GTE }] + [ConditionAndExpression ::= (*) ConditionAndExpression AND XORExpression , {RPAREN AND OR }] + [AssignmentExpression ::= (*) Assignment , {RPAREN }] + [Type ::= (*) PrimitiveType , {Identifier }] + [MethodDeclarator ::= Identifier LPAREN (*) FormalParams RPAREN , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on RelationalExpression to state [72] +transition on Param to state [196] +transition on FALSE to state [76] +transition on XORExpression to state [78] +transition on Type to state [195] +transition on STRING to state [17] +transition on Expression to state [125] +transition on StringLit to state [82] +transition on LIST to state [10] +transition on Assignment to state [62] +transition on NumLit to state [64] +transition on ConditionAndExpression to state [79] +transition on FormalParams to state [198] +transition on Identifier to state [43] +transition on EqualityExpression to state [74] +transition on ConditionalExpression to state [71] +transition on AssignmentExpression to state [85] +transition on TRUE to state [67] +transition on ConditionOrExpression to state [73] +transition on ReferenceType to state [23] +transition on UnaryExpr to state [61] +transition on COORD to state [11] +transition on PLUS to state [63] +transition on NUM to state [16] +transition on BOOL to state [22] +transition on CoordLit to state [84] +transition on Primary to state [66] +transition on AdditiveExpression to state [80] +transition on MINUS to state [75] +transition on LPAREN to state [69] +transition on TypeName to state [70] +transition on ParamsList to state [197] +transition on LeftHandSide to state [29] +transition on PrimitiveType to state [14] +transition on BoolLit to state [77] +transition on Literal to state [81] +transition on MultiExpr to state [68] + +------------------- +lalr_state [213]: { + [HearDecl ::= HEAR Identifier (*) LPAREN FormalParams RPAREN Block END HEAR , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] +} +transition on LPAREN to state [214] + +------------------- +lalr_state [214]: { + [ReferenceType ::= (*) LIST , {Identifier }] + [PrimitiveType ::= (*) BOOL , {Identifier }] + [ParamsList ::= (*) Param , {COMMA RPAREN }] + [FormalParams ::= (*) ParamsList , {RPAREN }] + [Type ::= (*) ReferenceType , {Identifier }] + [HearDecl ::= HEAR Identifier LPAREN (*) FormalParams RPAREN Block END HEAR , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] + [ReferenceType ::= (*) COORD , {Identifier }] + [PrimitiveType ::= (*) NUM , {Identifier }] + [ParamsList ::= (*) ParamsList COMMA Param , {COMMA RPAREN }] + [ReferenceType ::= (*) STRING , {Identifier }] + [Param ::= (*) Type Identifier , {COMMA RPAREN }] + [Type ::= (*) PrimitiveType , {Identifier }] + [FormalParams ::= (*) , {RPAREN }] +} +transition on FormalParams to state [215] +transition on PrimitiveType to state [14] +transition on LIST to state [10] +transition on ParamsList to state [197] +transition on STRING to state [17] +transition on COORD to state [11] +transition on BOOL to state [22] +transition on ReferenceType to state [23] +transition on NUM to state [16] +transition on Param to state [196] +transition on Type to state [195] + +------------------- +lalr_state [215]: { + [HearDecl ::= HEAR Identifier LPAREN FormalParams (*) RPAREN Block END HEAR , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] +} +transition on RPAREN to state [216] + +------------------- +lalr_state [216]: { + [RepeatStmt ::= (*) REPEAT UNTIL LPAREN Expression RPAREN EOL Block END REPEAT , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [ReferenceType ::= (*) LIST , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [BreakStmt ::= (*) BREAK EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [StmtNoSubstmt ::= (*) SignalStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [BlockStmtList ::= (*) BlockStmtList BlockStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [Assignment ::= (*) LeftHandSide ASSIGN Expression , {EOL }] + [SignalStmt ::= (*) SIGNAL Identifier LPAREN ArgsList RPAREN EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [PrimitiveType ::= (*) NUM , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [Statement ::= (*) StmtNoSubstmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [ForeverStmt ::= (*) FOREVER EOL Block END FOREVER , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [TypeName ::= (*) Identifier , {DOT LPAREN ASSIGN SQUARE_LEFT }] + [ReturnStmt ::= (*) RETURN Expression EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [StmtNoSubstmt ::= (*) ExprStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [BlockStmtList ::= (*) BlockStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [HearDecl ::= HEAR Identifier LPAREN FormalParams RPAREN (*) Block END HEAR , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] + [LeftHandSide ::= (*) TypeName ListOpt , {ASSIGN }] + [ExprStmt ::= (*) StmtExpr EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [PrimitiveType ::= (*) BOOL , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [Statement ::= (*) IfStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [IfStmt ::= (*) IF LPAREN Expression RPAREN EOL Block END IF ElseIfStmt ElseStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [TypeName ::= (*) TypeName DOT Identifier , {DOT LPAREN ASSIGN SQUARE_LEFT }] + [StmtNoSubstmt ::= (*) BreakStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [BlockStmt ::= (*) LocalVariableDcl , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LoopStmt ::= (*) RepeatStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [ReferenceType ::= (*) STRING , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [StmtExpr ::= (*) Assignment , {EOL }] + [Statement ::= (*) LoopStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [Block ::= (*) BlockStmtList , {END }] + [StmtNoSubstmt ::= (*) ReturnStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [Type ::= (*) ReferenceType , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [BlockStmt ::= (*) Statement , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LoopStmt ::= (*) ForeverStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [StmtExpr ::= (*) MethodInvocation , {EOL }] + [ReferenceType ::= (*) COORD , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [StmtNoSubstmt ::= (*) EmptyStmt , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [Block ::= (*) , {END }] + [MethodInvocation ::= (*) TypeName LPAREN FormalArgs RPAREN , {EOL }] + [Type ::= (*) PrimitiveType , {Identifier NumLit LPAREN PLUS MINUS TRUE FALSE StringLit CoordLit }] + [EmptyStmt ::= (*) EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] + [LocalVariableDcl ::= (*) Type VariableDclList EOL , {Identifier NUM BOOL STRING COORD LIST EOL END SIGNAL BREAK RETURN IF REPEAT FOREVER }] +} +transition on Block to state [217] +transition on StmtExpr to state [54] +transition on SIGNAL to state [53] +transition on BreakStmt to state [52] +transition on MethodInvocation to state [51] +transition on STRING to state [17] +transition on Type to state [50] +transition on Statement to state [49] +transition on EmptyStmt to state [48] +transition on LIST to state [10] +transition on Assignment to state [47] +transition on LoopStmt to state [46] +transition on SignalStmt to state [45] +transition on BlockStmtList to state [44] +transition on Identifier to state [43] +transition on IfStmt to state [42] +transition on BREAK to state [40] +transition on BlockStmt to state [39] +transition on RETURN to state [38] +transition on FOREVER to state [37] +transition on ReferenceType to state [23] +transition on COORD to state [11] +transition on IF to state [36] +transition on EOL to state [35] +transition on NUM to state [16] +transition on BOOL to state [22] +transition on RepeatStmt to state [34] +transition on LocalVariableDcl to state [33] +transition on REPEAT to state [32] +transition on TypeName to state [31] +transition on ForeverStmt to state [30] +transition on LeftHandSide to state [29] +transition on PrimitiveType to state [14] +transition on ExprStmt to state [28] +transition on StmtNoSubstmt to state [27] +transition on ReturnStmt to state [26] + +------------------- +lalr_state [217]: { + [HearDecl ::= HEAR Identifier LPAREN FormalParams RPAREN Block (*) END HEAR , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] +} +transition on END to state [218] + +------------------- +lalr_state [218]: { + [HearDecl ::= HEAR Identifier LPAREN FormalParams RPAREN Block END (*) HEAR , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] +} +transition on HEAR to state [219] + +------------------- +lalr_state [219]: { + [HearDecl ::= HEAR Identifier LPAREN FormalParams RPAREN Block END HEAR (*) , {EOF NUM BOOL STRING COORD LIST VOID EOL HEAR }] +} + +------------------- +lalr_state [220]: { + [Load ::= LOAD LPAREN (*) StringLit RPAREN EOL , {NUM BOOL STRING COORD LIST VOID EOL LOAD HEAR }] +} +transition on StringLit to state [221] + +------------------- +lalr_state [221]: { + [Load ::= LOAD LPAREN StringLit (*) RPAREN EOL , {NUM BOOL STRING COORD LIST VOID EOL LOAD HEAR }] +} +transition on RPAREN to state [222] + +------------------- +lalr_state [222]: { + [Load ::= LOAD LPAREN StringLit RPAREN (*) EOL , {NUM BOOL STRING COORD LIST VOID EOL LOAD HEAR }] +} +transition on EOL to state [223] + +------------------- +lalr_state [223]: { + [Load ::= LOAD LPAREN StringLit RPAREN EOL (*) , {NUM BOOL STRING COORD LIST VOID EOL LOAD HEAR }] +} + +------------------- +lalr_state [224]: { + [$START ::= Program EOF (*) , {EOF }] +} + +------------------- +------- CUP v0.11b 20140611 (SVN rev 31) Parser Generation Summary ------- + 0 errors and 0 warnings + 48 terminals, 65 non-terminals, and 120 productions declared, + producing 225 unique parse states. + 0 terminals declared but not used. + 0 non-terminals declared but not used. + 0 productions never reduced. + 0 conflicts detected (0 expected). + Code written to "parser.java", and "sym.java". +---------------------------------------------------- (CUP v0.11b 20140611 (SVN rev 31)) diff --git a/compiler/src/unicode.flex b/compiler/src/unicode.flex new file mode 100644 index 0000000..94ed9c2 --- /dev/null +++ b/compiler/src/unicode.flex @@ -0,0 +1,137 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright (C) 1998-2015 Gerwin Klein * + * All rights reserved. * + * * + * License: BSD * + * * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + +/* �3.3 of the Java Language Specification : + +UnicodeInputCharacter: + + UnicodeEscape + + RawInputCharacter + + UnicodeEscape: + + \ UnicodeMarker HexDigit HexDigit HexDigit HexDigit + + UnicodeMarker: + + u + + UnicodeMarker u + + RawInputCharacter: + + any Unicode character + + HexDigit: one of + + 0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F + +only an even number of '\' is eligible to start a Unicode escape sequence + +*/ + +import java.io.*; + +%% + +%public +%final +%class UnicodeEscapes +%extends FilterReader + +%int +%function read + +%16bit + +UnicodeEscape = {UnicodeMarker} {HexDigit} {4} +UnicodeMarker = "u"+ +HexDigit = [0-9a-fA-F] + +%state DIGITS + +%init{ + super(in); +%init} + +%{ + private boolean even; + + private int value() { + int r = 0; + + for (int k = zzMarkedPos-4; k < zzMarkedPos; k++) { + int c = zzBuffer[k]; + + if (c >= 'a') + c-= 'a'-10; + else if (c >= 'A') + c-= 'A'-10; + else + c-= '0'; + + r <<= 4; + r += c; + } + + return r; + } + + public int read(char cbuf[], int off, int len) throws IOException { + if ( !ready() ) return -1; + + len+= off; + + for (int i=off; i { + \\ { even = false; return '\\'; } + \\ / \\ { even = !even; return '\\'; } + \\ / "u" { + if (even) { + even = false; + return '\\'; + } + else + yybegin(DIGITS); + } + [^] { return zzBuffer[zzStartRead]; } + + <> { return -1; } +} + + { + {UnicodeEscape} { yybegin(YYINITIAL); return value(); } + [^] { throw new Error("incorrect Unicode escape"); } + + <> { throw new Error("EOF in Unicode escape"); } +} diff --git a/src/main/java/com/P4/init/CodeBook.java b/src/main/java/com/P4/init/CodeBook.java new file mode 100644 index 0000000..ced6b19 --- /dev/null +++ b/src/main/java/com/P4/init/CodeBook.java @@ -0,0 +1,7 @@ +package com.P4.init; + +/** + * Created by Lee on 08/02/16. + */ +public class CodeBook { +}