Commits

Joey E committed da6f19b Merge

Merge branch 'joey' into compiler

  • Participants
  • Parent commits 2c11556, eda36f2

Comments (0)

Files changed (14)

File ca.usask.cs/giraffe/compiler/AbstractValue.java

 	}
 	
 	@Override
-	public Value arrayElem(Value that) throws InvalidTypeException
-	{
+	public void setArrayElement(int index, Value val)
+			throws ExecutionErrorException
+			{
 		throw new InvalidTypeException("Cannot treat "  + this.type() + " as an array");
-	}
+			}
+
 	
 	
 }

File ca.usask.cs/giraffe/compiler/ArrayValue.java

 			throw new ExecutionErrorException("" + that + " is not a valid index on an array of size " + this.size);
 		}
 	}
+	
+	@Override
+	public void setArrayElement(int index, Value val)
+			throws ExecutionErrorException
+		{
+		//Just set the array element
+			try
+			{
+				this.elements[index] = val;
+			} catch (ArrayIndexOutOfBoundsException e)
+			{
+				throw new ExecutionErrorException("Can't access index " + index + " for an array of size " + this.size);
+			}
+		}
 
 }

File ca.usask.cs/giraffe/compiler/C.jj

 //TODO make expression?
 void CoutStatement() : {}
 {
-	(  <COUT> ("<<" Expression())*  ";" )
+	(  <COUT> (LOOKAHEAD(2) "<<" Expression())*  ";" )
 }
 
 void CinStatement() : {}
 
 void ShiftExpression() : {}
 {
-	AdditiveExpression() [ ( "<<" | ">>" ) ShiftExpression() ]
+//TODO put back?
+//Bitwise shifts not allowed in our grammar
+//TODO resolve conflict with cin
+	AdditiveExpression() //[ ( "<<" | ">>" ) ShiftExpression() ]
 }
 
 void AdditiveExpression() : {}

File ca.usask.cs/giraffe/compiler/ConcreteInterpreter.java

 
 	@Override
 	public Value getVar(LValue lv)
-			throws NameNotFoundException
+			throws ExecutionErrorException
 	{
-		//TODO don't assume lvalue is string
-		//return this.env().getValue(lv.getName());
-		return null;
+		if (lv.isName())
+		{
+			return this.getSimpleVar(lv.getName());
+		}
+		//If not primitive, recursively evaluate
+		else if (lv.isArray())
+		{
+			Value sub = this.getVar(lv.getSub());
+			return sub.arrayElem(lv.getIndex());
+		}
+		else
+		{
+			Value sub = this.getVar(lv.getSub());
+			return sub.structElem(lv.getMember());
+		}
 		
 	}
 	
 	//TODO do we ever signal things here?
 	@Override
 	public void setVar(LValue lv, Value val) 
-		throws InvalidTypeException, NameNotFoundException
+		throws ExecutionErrorException
 	{
 		if (lv.isName())
 		{
 			this.setSimpleVar(lv.getName(), val);
 		}
+		else if (lv.isArray())
+		{
+			//Get result of sub lvalue, then apply to it
+			Value sub = this.getVar(lv.getSub());
+			this.setArrayElement(sub, lv.getIndex(), val);
+		}
 		//TODO struct and array
 
 		
 	public void doAssignment(LValue lv, Value val)
 			throws InvalidTypeException, NameNotFoundException
 	{
-		this.setVar(lv,  val);
+		//this.setVar(lv,  val);
+		//TODO do something here?
 	}
 
 	@Override
 	}
 
 	@Override
-	public void setArrayElement(String name, int index, Value val) {
-		// TODO Auto-generated method stub
+	public void setArrayElement(Value arr, int index, Value val)
+		throws ExecutionErrorException
+	{
+		arr.setArrayElement(index, val);
+		
 		
 	}
 
 	 */
 	public static void main(String args[])
 	{
+		GiraffeLogger.setLogLevel(GiraffeLogger.LEVEL.INFO);
 		String s = 
 					"int main()\n"+
-					"{ int x[3]; }\n";
+					"{ int x[3]; x[0] = 1; x[1] = 2; x[2] = 3;  int i;for ( i = 0; i < 3; i = i + 1) { \n" + 
+					"cout << x[i] ; } }\n";
 		ConcreteInterpreter interp = new ConcreteInterpreter(null);
 		try
 		{

File ca.usask.cs/giraffe/compiler/DictEnvironment.java

 	}
 	
 	@Override
+	public Type getType(String id)
+			throws NameNotFoundException
+		{
+			//If we can't find it here, check in the parent environment
+			if (!this.types.containsKey(id))
+			{
+				if (this.parent == null)
+				{
+					throw new NameNotFoundException("There is no variable named " + id + " in this scope.");
+				}
+				else return this.parent.getType(id);
+			}
+			
+			//If var is here, just return its value
+			return this.types.get(id);
+		}
+	
+	@Override
 	public void extendEnv(String id, Type t)
 		throws DuplicateNameException
 	{
 				this.parent.assignValue(id, v);
 			}
 		}
-		else if (! this.types.get(id).equals(v.type()))
+		else if (! this.getType(id).equals(v.type()))
 		{
 			throw new InvalidTypeException("Cannot assign value of type " + v.type() 
 					+" to variable of type " + this.types.get(id));

File ca.usask.cs/giraffe/compiler/Environment.java

 	 * Get the value of the given variable name
 	 * @param id the name to lookup
 	 * @return The value stored in that variable
+	 * @throws NameNotFoundException
 	 */
 	public Value getValue(String id)
 			throws NameNotFoundException;
 	 */
 	public Set<String> oneLevelNames();
 	
+	/**
+	 * Return the type associated with the given id in this environment or its parent
+	 * @param id the name to lookup
+	 * @return The type of that variable
+	 * @throws NameNotFoundException
+	 */
+	public Type getType(String id)
+			throws NameNotFoundException;
+	
 
 }

File ca.usask.cs/giraffe/compiler/IntValue.java

 		{
 			return new IntValue(this.asInt() + that.asInt());
 		}
-		else if (that.type() == Type.Float())
+		else if (that.type().equals(Type.Float()))
 		{
 			return new FloatValue(this.asFloat() + that.asFloat());
 		}
 	@Override
 	public Value minus(Value that) throws ExecutionErrorException
 	{
-		if (that.type() == Type.Int() || that.type() == Type.Char())
+		if (that.type().equals(Type.Int()) || that.type().equals(Type.Char()))
 		{
 			return new IntValue(this.asInt() - that.asInt());
 		}
-		else if (that.type() == Type.Float())
+		else if (that.type().equals(Type.Float()))
 		{
 			return new FloatValue(this.asFloat() - that.asFloat());
 		}
 	@Override
 	public Value mult(Value that) throws ExecutionErrorException
 	{
-		if (that.type() == Type.Int() || that.type() == Type.Char())
+		if (that.type().equals(Type.Int()) || that.type().equals(Type.Char()))
 		{
 			return new IntValue(this.asInt() * that.asInt());
 		}
-		else if (that.type() == Type.Float())
+		else if (that.type().equals(Type.Float()))
 		{
 			return new FloatValue(this.asFloat() * that.asFloat());
 		}
 	@Override
 	public Value div(Value that) throws ExecutionErrorException
 	{
-		if (that.type() == Type.Int() || that.type() == Type.Char())
+		if (that.type().equals(Type.Int()) || that.type().equals(Type.Char()))
 		{
 			return new IntValue(this.asInt() / that.asInt());
 		}
-		else if (that.type() == Type.Float())
+		else if (that.type().equals(Type.Float()))
 		{
 			return new FloatValue(this.asFloat() / that.asFloat());
 		}
 	@Override
 	public Value mod(Value that) throws ExecutionErrorException
 	{
-		if (that.type() == Type.Int() || that.type() == Type.Char())
+		if (that.type().equals(Type.Int()) || that.type().equals(Type.Char()))
 		{
 			return new IntValue(this.asInt() % that.asInt());
 		}
 	@Override
 	public Value compEq(Value that) throws ExecutionErrorException
 	{
-		if (that.type() == Type.Int() || that.type() == Type.Char())
+		if (that.type().equals(Type.Int()) || that.type().equals(Type.Char()))
 		{
 			return new BoolValue(this.asInt() == that.asInt());
 		}
 	@Override
 	public Value compLess(Value that) throws ExecutionErrorException
 	{
-		if (that.type() == Type.Int() || that.type() == Type.Char())
+		if (that.type().equals(Type.Int()) || that.type().equals(Type.Char()))
 		{
 			return new BoolValue(this.asInt() < that.asInt());
 		}
-		if (that.type() == Type.Float())
+		if (that.type().equals(Type.Float()))
 		{
 			return new BoolValue(this.asInt() < that.asFloat());
 		}
 	@Override
 	public Value compGreater(Value that) throws ExecutionErrorException
 	{
-		if (that.type() == Type.Int() || that.type() == Type.Char())
+		if (that.type().equals(Type.Int()) || that.type().equals(Type.Char()))
 		{
 			return new BoolValue(this.asInt() > that.asInt());
 		}
-		if (that.type() == Type.Float())
+		if (that.type().equals(Type.Float()))
 		{
 			return new BoolValue(this.asInt() > that.asFloat());
 		}
 	@Override
 	public Value compLeq(Value that) throws ExecutionErrorException
 	{
-		if (that.type() == Type.Int() || that.type() == Type.Char())
+		if (that.type().equals(Type.Int()) || that.type().equals(Type.Char()))
 		{
 			return new BoolValue(this.asInt() <= that.asInt());
 		}
-		if (that.type() == Type.Float())
+		if (that.type().equals(Type.Float()))
 		{
 			return new BoolValue(this.asInt() <= that.asFloat());
 		}
 	@Override
 	public Value compGeq(Value that) throws ExecutionErrorException
 	{
-		if (that.type() == Type.Int() || that.type() == Type.Char())
+		if (that.type().equals(Type.Int()) || that.type().equals(Type.Char()))
 		{
 			return new BoolValue(this.asInt() >= that.asInt());
 		}
-		if (that.type() == Type.Float())
+		if (that.type().equals(Type.Float()))
 		{
 			return new BoolValue(this.asInt() >= that.asFloat());
 		}

File ca.usask.cs/giraffe/compiler/Interpreter.java

 	 * i.e. foo.bar.baz[3] is an LValue
 	 */
 	public Value getVar(LValue lv)
-		throws NameNotFoundException;
+		throws ExecutionErrorException;
 	
 	//TODO doc
 	public Value getSimpleVar(String name)
 	 * i.e. foo.bar.baz[3] is an LValue
 	 */
 	public void setVar(LValue lv, Value val)
-		throws NameNotFoundException, InvalidTypeException;
+		throws ExecutionErrorException;
 	
 	/**
 	 * Same as setVar, but has different animation side-effect
 	
 	/**
 	 * Set the nth element of an array
-	 * @param name name of the array to access
+	 * @param arr the array to access
 	 * @param index element within the array to set
 	 * @param val the value stored at the array index
 	 */
-	public void setArrayElement(String name, int index, Value val )
-			throws NameNotFoundException, InvalidTypeException;
+	public void setArrayElement(Value arr, int index, Value val )
+			throws ExecutionErrorException;
 	
 	/**
 	 * Set the named member of a struct to a value

File ca.usask.cs/giraffe/compiler/NodeVisitor.java

             throws ExecutionErrorException{
          GiraffeLogger.log("Visiting node of class " + node.getClass());
 
+         Node lnode = node.getChild(0);
+         
 		//TODO return before or after increment?
 		Value ret = node.getChild(2).jjtAccept(this, new VoidValue());
 		//Set the current accumulator value
 		//TODO line numbers
 		this.appendDelta( new SetAccumDelta(ret.toString(), cstart(node), cend(node)));
 		
+		LValue lv = null;
 		
 		//TODO account for complex lvalues
-		String idName = ((IDENTIFIER)node.getChild(0)).getRawText();
+		if (lnode.getId() == CConstants.POSTFIXEXPRESSION)
+		{
+			String idName = ((IDENTIFIER)lnode.getChild(0)).getRawText();
+			
+			//Case for array values
+			//TODO nesting?
+			if (lnode.getChild(1).getId() == CConstants.ARRBOXPOSTFIX)
+			{
+				int index = lnode.getChild(1).jjtAccept(this, data).asInt();
+				lv = new LValue(new LValue(idName), index);
+			}
+		}
+		else
+		{
+			//case where lvalue is just simple name
+		String idName = ((IDENTIFIER)lnode).getRawText();
 		//TODO parse node
-		LValue lv = new LValue(idName);
+		lv = new LValue(idName);
 
-			this.interpreter.setVar(lv, ret);
-			//TODO charPosition
-			this.appendDelta(new SetVarToAccumDelta(lv, cstart(node), cend(node)));
+			
+		}
 
+		this.interpreter.setVar(lv, ret);
+		//TODO charPosition
+		this.appendDelta(new SetVarToAccumDelta(lv, cstart(node), cend(node)));
 
 		return ret;
 	}
 	@Override
 	public Value visit(RelationalExpression node, Value data) 
             throws ExecutionErrorException{
-         GiraffeLogger.log("Visiting node of class " + node.getClass());
+			//Check if addition or subtraction sign in middle
+			//TODO better way to check without cast?
+			//TODO constant names for integers
+			Node leftNode = node.getChild(0);
+			Node rightNode = node.getChild(2);
+			Value ret;
+			//Recursively get values of left and right sides of expr
+			Value vleft = leftNode.jjtAccept(this, data);
+			//TODO signal accum here, or just at return?
+			this.signalAccum(vleft, leftNode);
+			Value vright = rightNode.jjtAccept(this, data);
+			this.signalAccum(vright, rightNode);
+
+				if ( node.getChild(1).toString().equals("<"))
+				{
+					ret = vleft.compLess(vright);
+				}
+				else if (node.getChild(1).toString().equals("<="))
+				{
+					ret = vleft.compLeq(vright);
+				}
+				else if (node.getChild(1).toString().equals(">"))
+				{
+					ret = vleft.compGreater(vright);
+				}
+				else if (node.getChild(1).toString().equals(">="))
+				{
+					ret = vleft.compGeq(vright);
+				}
+				else
+				{
+					throw new RuntimeException("Fatal error: additive expression contained operator " 
+				+ node.getChild(1).toString());
+				}
+			
+
+				
+			this.signalAccum(ret, node);
+			return ret;
 
-		// TODO Auto-generated method stub
-		return null;
 	}
 
 	@Override
         		 current = current.call(args);
         		 break;
         		 
+        	 case CConstants.ARRBOXPOSTFIX: 
+        		 //get value of index to be accessed
+        		 //Ignore first and last, are array brackets
+        		 //TODO which array function?
+        		 int index = postfix.getChild(1).jjtAccept(this, data).asInt();
+        		 current = current.arrayElem(index);
+        		 break;
+        		 
         		 default: throw new RuntimeException("Unsupported postfix " + postfix.toString() + "! Check the parser for errors");
         	 
         	 }
             throws ExecutionErrorException{
          GiraffeLogger.log("Visiting node of class " + node.getClass());
 
-		// TODO Auto-generated method stub
-		return null;
+         Node testNode;
+ 		Node whileNode;
+ 		//Children are if, (, test, ), body, else, body
+ 		//Extract condition node and body node
+ 		testNode = node.getChild(2);
+ 		whileNode = node.getChild(4);
+ 		Value testVal = testNode.jjtAccept(this, data);
+ 		//TODO update accum with test value?
+ 		//Execute first or (optionally) second body based on value
+
+ 			while (testVal.asBool())
+ 			{
+ 				whileNode.jjtAccept(this, data);
+ 				//Re-execute condition to check its value
+ 				testVal = testNode.jjtAccept(this, data);
+ 			}
+ 			
+ 			//TODO infinite loop checking?
+
+ 		
+ 		return new VoidValue();
 	}
 
 	@Override
 		return null;
 	}
 
+	//TODO how to deal with empty parts?
 	@Override
 	public Value visit(ForStatement node, Value data) 
             throws ExecutionErrorException{
          GiraffeLogger.log("Visiting node of class " + node.getClass());
+         
+         Node initNode = node.getChild(2);
+         Node testNode = node.getChild(4);
+         Node stepNode = node.getChild(6);
+         Node bodyNode = node.getChild(8);
+         
+         //Push scope so that if init is a statement (int i = 3 or somethign)
+         //then it will be in the right scope
+         this.interpreter.pushScope();
+         
+         //first, execute init statement
+         initNode.jjtAccept(this, data);
+         
+         //Get the initial test value, to see if we run at all
+         Value testValue = testNode.jjtAccept(this, data);
+         while (testValue.asBool())
+         {
+        	 //Execute body
+        	 bodyNode.jjtAccept(this, data);
+        	 //Execute step
+        	 stepNode.jjtAccept(this, data);
+        	 //Re-evaluate test
+        	 testValue = testNode.jjtAccept(this, data);
+         }
+         
+         
+         //Pop back into scope from before
+         this.interpreter.pushScope();
 
 		// TODO Auto-generated method stub
-		return null;
+		return new VoidValue();
 	}
 
 	@Override
             throws ExecutionErrorException{
          GiraffeLogger.log("Visiting node of class " + node.getClass());
 
-		// TODO Auto-generated method stub
-		return null;
+         //If is an array access, the "value" is the index of the array being accessed
+
+        	 return node.getChild(1).jjtAccept(this, data);
+         
 	}
 
 	@Override
             throws ExecutionErrorException{
          GiraffeLogger.log("Visiting node of class " + node.getClass());
 
-		// TODO Auto-generated method stub
-		return null;
+         //Values to output alternate with << symbol
+         for (int i = 2; i < node.getChildCount(); i += 2)
+         {
+        	 Value toPrint = node.getChild(i).jjtAccept(this, data);
+        	 GiraffeLogger.log("COUT << " + toPrint.toString());
+        	 //TODO send to GUI
+         }
+         
+         //TODO endl
+         
+		// TODO Return actual value
+		return new VoidValue();
 	}
 
 	@Override

File ca.usask.cs/giraffe/compiler/UnInitValue.java

 		throw new UnInitializedException("You haven't set the value of this variable yet!");
 	}
 	
-	@Override
-	public Value arrayElem(Value that) throws InvalidTypeException
-	{
-		throw new UnInitializedException("You haven't set the value of this variable yet!");
-	}
 	
 	@Override
 	public Value structElem(String field) throws InvalidTypeException

File ca.usask.cs/giraffe/compiler/Value.java

 			throws ExecutionErrorException;
 	
 	/**
-	 * Treat the value as an array and get its value at the given index
-	 * @return the that'th member of the function
-	 * @throws InvalidTypeException if this is not an array or that can't be converted to an integer
+	 * Set the value of an array element
+	 * @param index element to set
+	 * @param val value to set the element to
 	 */
-	public Value arrayElem(Value that) throws InvalidTypeException;
+	public void setArrayElement(int index, Value val)
+			throws ExecutionErrorException;
+	
+	
+
 	
 	
 	

File ca.usask.cs/giraffe/compiler/parser/CConstants.java

    */
     int DEFAULT=0;
     int PREPROCESSOR_OUTPUT=1;
-    String[] tokenImage={"<EOF>","\" \"","\"\\t\"","\"\\n\"","\"\\r\"","<5>","<6>","\"#\"","\"\\n\"","\"\\\\\\n\"","\"\\\\\\r\\n\"","<11>","<INTEGER_LITERAL>","<BOOL_LITERAL>","<DECIMAL_LITERAL>","<HEX_LITERAL>","<OCTAL_LITERAL>","<FLOATING_POINT_LITERAL>","<EXPONENT>","<CHARACTER_LITERAL>","<STRING_LITERAL>","\"continue\"","\"volatile\"","\"register\"","\"unsigned\"","\"typedef\"","\"default\"","\"double\"","\"sizeof\"","\"switch\"","\"return\"","\"extern\"","\"struct\"","\"static\"","\"signed\"","\"while\"","\"break\"","\"union\"","\"const\"","\"float\"","\"short\"","\"else\"","\"case\"","\"long\"","\"enum\"","\"auto\"","\"void\"","\"char\"","\"goto\"","\"for\"","\"int\"","\"if\"","\"do\"","\"bool\"","\"cin\"","\"cout\"","<IDENTIFIER>","<LETTER>","<DIGIT>","\";\"","\"{\"","\"}\"","\",\"","\"=\"","\":\"","\"(\"","\")\"","\"[\"","\"]\"","\"*\"","\"...\"","\"<<\"","\"*=\"","\"/=\"","\"%=\"","\"+=\"","\"-=\"","\"<<=\"","\">>=\"","\"&=\"","\"^=\"","\"|=\"","\"?\"","\"||\"","\"&&\"","\"|\"","\"^\"","\"&\"","\"==\"","\"!=\"","\"<\"","\">\"","\"<=\"","\">=\"","\">>\"","\"+\"","\"-\"","\"/\"","\"%\"","\"++\"","\"--\"","\"~\"","\"!\"","\".\"","\"->\"",};
+    String[] tokenImage={"<EOF>","\" \"","\"\\t\"","\"\\n\"","\"\\r\"","<5>","<6>","\"#\"","\"\\n\"","\"\\\\\\n\"","\"\\\\\\r\\n\"","<11>","<INTEGER_LITERAL>","<BOOL_LITERAL>","<DECIMAL_LITERAL>","<HEX_LITERAL>","<OCTAL_LITERAL>","<FLOATING_POINT_LITERAL>","<EXPONENT>","<CHARACTER_LITERAL>","<STRING_LITERAL>","\"continue\"","\"volatile\"","\"register\"","\"unsigned\"","\"typedef\"","\"default\"","\"double\"","\"sizeof\"","\"switch\"","\"return\"","\"extern\"","\"struct\"","\"static\"","\"signed\"","\"while\"","\"break\"","\"union\"","\"const\"","\"float\"","\"short\"","\"else\"","\"case\"","\"long\"","\"enum\"","\"auto\"","\"void\"","\"char\"","\"goto\"","\"for\"","\"int\"","\"if\"","\"do\"","\"bool\"","\"cin\"","\"cout\"","<IDENTIFIER>","<LETTER>","<DIGIT>","\";\"","\"{\"","\"}\"","\",\"","\"=\"","\":\"","\"(\"","\")\"","\"[\"","\"]\"","\"*\"","\"...\"","\"<<\"","\"*=\"","\"/=\"","\"%=\"","\"+=\"","\"-=\"","\"<<=\"","\">>=\"","\"&=\"","\"^=\"","\"|=\"","\"?\"","\"||\"","\"&&\"","\"|\"","\"^\"","\"&\"","\"==\"","\"!=\"","\"<\"","\">\"","\"<=\"","\">=\"","\"+\"","\"-\"","\"/\"","\"%\"","\"++\"","\"--\"","\"~\"","\"!\"","\".\"","\"->\"",};
     String[] nodeNames={"EOF","INTEGER_LITERAL","BOOL_LITERAL","DECIMAL_LITERAL","HEX_LITERAL","OCTAL_LITERAL","FLOATING_POINT_LITERAL","EXPONENT","CHARACTER_LITERAL","STRING_LITERAL","CONTINUE","VOLATILE","REGISTER","UNSIGNED","TYPEDEF","DFLT","DOUBLE","SIZEOF","SWITCH","RETURN","EXTERN","STRUCT","STATIC","SIGNED","WHILE","BREAK","UNION","CONST","FLOAT","SHORT","ELSE","CASE","LONG","ENUM","AUTO","VOID","CHAR","GOTO","FOR","INT","IF","DO","BOOL","CIN","COUT","IDENTIFIER","LETTER","DIGIT","TranslationUnit","ExternalDeclaration","FunctionDefinition","Declaration","DeclarationList","DeclarationSpecifiers","StorageClassSpecifier","TypeSpecifier","VoidType","CharType","ShortType","IntType","LongType","FloatType","DoubleType","SignedType","UnsignedType","BoolType","TypeQualifier","ConstQualifier","VolatileQualifier","StructOrUnionSpecifier","StructOrUnion","StructSpec","UnionSpec","StructDeclarationList","InitDeclaratorList","InitDeclarator","StructDeclaration","SpecifierQualifierList","StructDeclaratorList","StructDeclarator","EnumSpecifier","EnumeratorList","Enumerator","Declarator","DirectDeclarator","Pointer","TypeQualifierList","ParameterTypeList","ParameterList","ParameterDeclaration","IdentifierList","Initializer","InitializerList","TypeName","AbstractDeclarator","DirectAbstractDeclarator","TypedefName","Statement","LabeledStatement","GotoLabelStatement","CaseStatement","DefaultStatement","ExpressionStatement","CompoundStatement","StatementList","SelectionStatement","IfStatement","SwitchStatement","IterationStatement","WhileStatement","DoStatement","ForStatement","JumpStatement","GotoStatement","ContinueStatement","BreakStatement","ReturnStatement","CoutStatement","CinStatement","Expression","AssignmentExpression","AssignmentOperator","ConditionalExpression","ConstantExpression","LogicalORExpression","LogicalANDExpression","InclusiveORExpression","ExclusiveORExpression","ANDExpression","EqualityExpression","RelationalExpression","ShiftExpression","AdditiveExpression","MultiplicativeExpression","CastExpression","UnaryExpression","UnaryOpExpression","PrePPExpression","PreMMExpression","SizeofExpression","AddrOfExpression","DerefExpression","PosExpression","NegExpression","BitwiseNotExpression","NotExpression","PostfixExpression","Postfix","PostfixList","ArrBoxPostfix","FnCallPostfix","DotMemberPostfix","ArrowMemberPostfix","PPPostfix","MMPostfix","ParenExpression","PrimaryExpression","VariableExpression","ArgumentExpressionList","Constant","IntLiteralExpression","FloatLiteralExpression","CharLiteralExpression","StringLiteralExpression","BoolLiteralExpression",};
 }

File ca.usask.cs/giraffe/compiler/parser/CLexer.java

 
     static final String[] lexStateNames={"DEFAULT","PREPROCESSOR_OUTPUT",};
     /** Lex State array. */
-    public static final int[] jjnewLexState={-1,-1,-1,-1,-1,-1,-1,1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,};
+    public static final int[] jjnewLexState={-1,-1,-1,-1,-1,-1,-1,1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,};
     // Bit vector for TOKEN
-    static final long[] jjtoToken={0xf9fffffffffa3001L,0x1ffffffffffL,};
+    static final long[] jjtoToken={0xf9fffffffffa3001L,0xffffffffffL,};
     // Bit vector for SKIP
     static final long[] jjtoSkip={0x1feL,0x0L,};
     // Bit vector for MORE
                 jjmatchedKind=56;
                 return 5;
             }
-            if ((active1&0x8000000040L)!=0L) return 12;
+            if ((active1&0x4000000040L)!=0L) return 12;
             if ((active0&0xfdff7ffde00000L)!=0L) {
                 jjmatchedKind=56;
                 return 38;
             }
-            if ((active1&0x200000200L)!=0L) return 59;
+            if ((active1&0x100000200L)!=0L) return 59;
             return-1;
             case 1:
             if ((active0&0x18000008000000L)!=0L) return 38;
     private int jjMoveStringLiteralDfa0() {
         switch(curChar) {
             case 33:
-            jjmatchedKind=102;
+            jjmatchedKind=101;
             return jjMoveStringLiteralDfa1(0x0L,0x2000000L);
             case 35:
             return jjStopAtPos(0,7);
             case 37:
-            jjmatchedKind=98;
+            jjmatchedKind=97;
             return jjMoveStringLiteralDfa1(0x0L,0x400L);
             case 38:
             jjmatchedKind=87;
             jjmatchedKind=69;
             return jjMoveStringLiteralDfa1(0x0L,0x100L);
             case 43:
-            jjmatchedKind=95;
-            return jjMoveStringLiteralDfa1(0x0L,0x800000800L);
+            jjmatchedKind=94;
+            return jjMoveStringLiteralDfa1(0x0L,0x400000800L);
             case 44:
             return jjStopAtPos(0,62);
             case 45:
-            jjmatchedKind=96;
-            return jjMoveStringLiteralDfa1(0x0L,0x11000001000L);
+            jjmatchedKind=95;
+            return jjMoveStringLiteralDfa1(0x0L,0x8800001000L);
             case 46:
-            jjmatchedKind=103;
+            jjmatchedKind=102;
             return jjMoveStringLiteralDfa1(0x0L,0x40L);
             case 47:
-            jjmatchedKind=97;
+            jjmatchedKind=96;
             return jjMoveStringLiteralDfa1(0x0L,0x200L);
             case 58:
             return jjStopAtPos(0,64);
             return jjMoveStringLiteralDfa1(0x0L,0x1000000L);
             case 62:
             jjmatchedKind=91;
-            return jjMoveStringLiteralDfa1(0x0L,0x60004000L);
+            return jjMoveStringLiteralDfa1(0x0L,0x20004000L);
             case 63:
             return jjStopAtPos(0,82);
             case 91:
             case 125:
             return jjStopAtPos(0,61);
             case 126:
-            return jjStopAtPos(0,101);
+            return jjStopAtPos(0,100);
             default:
             return jjMoveNfa(0,0);
         }
             if ((active1&0x100000L)!=0L) return jjStopAtPos(1,84);
             break;
             case 43:
-            if ((active1&0x800000000L)!=0L) return jjStopAtPos(1,99);
+            if ((active1&0x400000000L)!=0L) return jjStopAtPos(1,98);
             break;
             case 45:
-            if ((active1&0x1000000000L)!=0L) return jjStopAtPos(1,100);
+            if ((active1&0x800000000L)!=0L) return jjStopAtPos(1,99);
             break;
             case 46:
             return jjMoveStringLiteralDfa2(active0,0x0L,active1,0x40L);
             else if ((active1&0x20000000L)!=0L) return jjStopAtPos(1,93);
             break;
             case 62:
-            if ((active1&0x40000000L)!=0L) {
-                jjmatchedKind=94;
-                jjmatchedPos=1;
-            }
-            else if ((active1&0x10000000000L)!=0L) return jjStopAtPos(1,104);
+            if ((active1&0x8000000000L)!=0L) return jjStopAtPos(1,103);
             return jjMoveStringLiteralDfa2(active0,0x0L,active1,0x4000L);
             case 97:
             return jjMoveStringLiteralDfa2(active0,0x40000000000L,active1,0x0L);

File ca.usask.cs/giraffe/compiler/parser/CParser.java

     private boolean jj_lookingAhead=false;
     private boolean jj_semLA;
     private int jj_gen;
-    final private int[] jj_la1=new int[83];
+    final private int[] jj_la1=new int[80];
     static private int[] jj_la1_0;
     static private int[] jj_la1_1;
     static private int[] jj_la1_2;
         jj_la1_init_3();
     }
     private static void jj_la1_init_0() {
-        jj_la1_0=new int[]{0x0,0x82800000,0x400000,0x82800000,0x9000000,0x400000,0x0,0x0,0x0,0x0,0x0,0x400000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x101a3000,0x0,0x0,0x0,0x400000,0x0,0x400000,0x0,0x0,0x0,0x0,0x101a3000,0x0,0x0,0x0,0x101a3000,0x0,0x0,0x101a3000,0x0,0x301a3000,0x40200000,0x4000000,0x101a3000,0x20000000,0x0,0x101a3000,0x101a3000,0x101a3000,0x40200000,0x101a3000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x101a3000,0x10000000,0x0,0x0,0x0,0x0,0x1a3000,0x1a3000,0x0,0x1a3000};
+        jj_la1_0=new int[]{0x0,0x82800000,0x400000,0x82800000,0x9000000,0x400000,0x0,0x0,0x0,0x0,0x0,0x400000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x101a3000,0x0,0x0,0x0,0x400000,0x0,0x400000,0x0,0x0,0x0,0x0,0x101a3000,0x0,0x0,0x0,0x101a3000,0x0,0x0,0x101a3000,0x0,0x301a3000,0x40200000,0x4000000,0x101a3000,0x20000000,0x0,0x101a3000,0x101a3000,0x101a3000,0x40200000,0x101a3000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x101a3000,0x10000000,0x0,0x0,0x0,0x0,0x1a3000,0x1a3000,0x0,0x1a3000};
     }
 
     private static void jj_la1_init_1() {
-        jj_la1_1=new int[]{0x1000000,0x2002,0x40,0x2002,0x24d9a5,0x40,0x1000000,0x1000000,0x21,0x40000000,0x80000000,0x40,0x40000000,0x1000000,0x1000000,0x1000000,0x1000000,0x40000000,0x80000000,0x0,0x1000000,0x0,0x1000000,0x1000000,0x0,0x0,0x40,0x0,0x40,0x40000000,0x0,0x40000000,0x40000000,0x11000000,0x0,0x0,0x0,0x1000000,0x0,0x0,0x1000000,0x0,0x191a0008,0xc10010,0x10400,0x1000000,0x80000,0x120008,0x1000000,0x1000000,0x1000000,0x10010,0x1000000,0x0,0x0,0x40000000,0x80000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1000000,0x0,0x0,0x0,0x0,0x0,0x1000000,0x1000000,0x40000000,0x0};
+        jj_la1_1=new int[]{0x1000000,0x2002,0x40,0x2002,0x24d9a5,0x40,0x1000000,0x1000000,0x21,0x40000000,0x80000000,0x40,0x40000000,0x1000000,0x1000000,0x1000000,0x1000000,0x40000000,0x80000000,0x0,0x1000000,0x0,0x1000000,0x1000000,0x0,0x0,0x40,0x0,0x40,0x40000000,0x0,0x40000000,0x40000000,0x11000000,0x0,0x0,0x0,0x1000000,0x0,0x0,0x1000000,0x0,0x191a0008,0xc10010,0x10400,0x1000000,0x80000,0x120008,0x1000000,0x1000000,0x1000000,0x10010,0x1000000,0x0,0x40000000,0x80000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1000000,0x0,0x0,0x0,0x0,0x0,0x1000000,0x1000000,0x40000000,0x0};
     }
 
     private static void jj_la1_init_2() {
-        jj_la1_2=new int[]{0x22,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x22,0x23,0x0,0x0,0x0,0x0,0x20,0x2,0xa,0x80800022,0x0,0x8,0x2,0x0,0x20,0x0,0x0,0x2a,0x0,0x0,0x80800022,0x2a,0x20,0x2a,0x80800022,0xa,0xa,0x80800022,0xa,0x80800022,0x0,0x0,0x80800022,0x0,0x0,0x80800022,0x80800022,0x80800022,0x0,0x80800022,0x80,0x80,0x0,0x3ff00,0x40000,0x80000,0x100000,0x200000,0x400000,0x800000,0x3000000,0x3000000,0x3c000000,0x3c000000,0x40000080,0x40000080,0x80000000,0x80000000,0x20,0x20,0x80800020,0x80800020,0x80800020,0x2,0xa,0xa,0x2,0x0,0x0,0x0};
+        jj_la1_2=new int[]{0x22,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x22,0x23,0x0,0x0,0x0,0x0,0x20,0x2,0xa,0xc0800022,0x0,0x8,0x2,0x0,0x20,0x0,0x0,0x2a,0x0,0x0,0xc0800022,0x2a,0x20,0x2a,0xc0800022,0xa,0xa,0xc0800022,0xa,0xc0800022,0x0,0x0,0xc0800022,0x0,0x0,0xc0800022,0xc0800022,0xc0800022,0x0,0xc0800022,0x80,0x0,0x3ff00,0x40000,0x80000,0x100000,0x200000,0x400000,0x800000,0x3000000,0x3000000,0x3c000000,0x3c000000,0xc0000000,0xc0000000,0x20,0x20,0xc0800020,0xc0800020,0xc0800020,0x2,0xa,0xa,0x2,0x0,0x0,0x0};
     }
 
     private static void jj_la1_init_3() {
-        jj_la1_3=new int[]{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x79,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x79,0x0,0x0,0x0,0x79,0x0,0x0,0x79,0x0,0x79,0x0,0x0,0x79,0x0,0x0,0x79,0x79,0x79,0x0,0x79,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x1,0x6,0x6,0x79,0x79,0x61,0x0,0x198,0x198,0x0,0x0,0x0,0x0};
+        jj_la1_3=new int[]{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3c,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3c,0x0,0x0,0x0,0x3c,0x0,0x0,0x3c,0x0,0x3c,0x0,0x0,0x3c,0x0,0x0,0x3c,0x3c,0x3c,0x0,0x3c,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3,0x3,0x3c,0x3c,0x30,0x0,0xcc,0xcc,0x0,0x0,0x0,0x0};
     }
 
-    final private JJCalls[] jj_2_rtns=new JJCalls[35];
+    final private JJCalls[] jj_2_rtns=new JJCalls[36];
     private boolean jj_rescan=false;
     private int jj_gc=0;
     public CParser(java.io.Reader stream) {
         current_token=new Token();
         jj_ntk=-1;
         for(int i=0; 
-        i<83; 
+        i<80; 
         i++) jj_la1[i]=-1; 
         for(int i=0; 
         i<jj_2_rtns.length; 
         current_token=new Token();
         jj_ntk=-1;
         for(int i=0; 
-        i<83; 
+        i<80; 
         i++) jj_la1[i]=-1; 
         for(int i=0; 
         i<jj_2_rtns.length; 
 
     public ParseException generateParseException() {
         jj_expentries.clear();
-        boolean[] la1tokens=new boolean[105];
+        boolean[] la1tokens=new boolean[104];
         if (jj_kind>=0) {
             la1tokens[jj_kind]=true;
             jj_kind=-1;
         }
         for(int i=0; 
-        i<83; 
+        i<80; 
         i++) {
             if (jj_la1[i]==jj_gen) {
                 for(int j=0; 
             }
         }
         for(int i=0; 
-        i<105; 
+        i<104; 
         i++) {
             if (la1tokens[i]) {
                 jj_expentry=new int[1];
     private void jj_rescan_token() {
         jj_rescan=true;
         for(int i=0; 
-        i<35; 
+        i<36; 
         i++) {
             try {
                 JJCalls p=jj_2_rtns[i];
                             case 34:
                             jj_3_35();
                             break;
+                            case 35:
+                            jj_3_36();
+                            break;
                         }
                     }
                     p=p.next;
                     // C.jj, line 464
                     int int12=(jj_ntk==-1)?jj_ntk():
                     jj_ntk;
-                    if (int12==INTEGER_LITERAL||int12==BOOL_LITERAL||int12==FLOATING_POINT_LITERAL||int12==CHARACTER_LITERAL||int12==STRING_LITERAL||int12==SIZEOF||int12==IDENTIFIER||int12==65||int12==69||int12==87||int12==95||int12==96||int12==99||int12==100||int12==101||int12==102) {
+                    if (int12==INTEGER_LITERAL||int12==BOOL_LITERAL||int12==FLOATING_POINT_LITERAL||int12==CHARACTER_LITERAL||int12==STRING_LITERAL||int12==SIZEOF||int12==IDENTIFIER||int12==65||int12==69||int12==87||int12==94||int12==95||int12==98||int12==99||int12==100||int12==101) {
                         // C.jj, line 464
                         // C.jj, line 464
                         ConstantExpression();
                 case 65:
                 case 69:
                 case 87:
+                case 94:
                 case 95:
-                case 96:
+                case 98:
                 case 99:
                 case 100:
                 case 101:
-                case 102:
                 // C.jj, line 502
                 // C.jj, line 502
                 AssignmentExpression();
                     // C.jj, line 526
                     int int23=(jj_ntk==-1)?jj_ntk():
                     jj_ntk;
-                    if (int23==INTEGER_LITERAL||int23==BOOL_LITERAL||int23==FLOATING_POINT_LITERAL||int23==CHARACTER_LITERAL||int23==STRING_LITERAL||int23==SIZEOF||int23==IDENTIFIER||int23==65||int23==69||int23==87||int23==95||int23==96||int23==99||int23==100||int23==101||int23==102) {
+                    if (int23==INTEGER_LITERAL||int23==BOOL_LITERAL||int23==FLOATING_POINT_LITERAL||int23==CHARACTER_LITERAL||int23==STRING_LITERAL||int23==SIZEOF||int23==IDENTIFIER||int23==65||int23==69||int23==87||int23==94||int23==95||int23==98||int23==99||int23==100||int23==101) {
                         // C.jj, line 526
                         // C.jj, line 526
                         ConstantExpression();
                     // C.jj, line 529
                     int int25=(jj_ntk==-1)?jj_ntk():
                     jj_ntk;
-                    if (int25==INTEGER_LITERAL||int25==BOOL_LITERAL||int25==FLOATING_POINT_LITERAL||int25==CHARACTER_LITERAL||int25==STRING_LITERAL||int25==SIZEOF||int25==IDENTIFIER||int25==65||int25==69||int25==87||int25==95||int25==96||int25==99||int25==100||int25==101||int25==102) {
+                    if (int25==INTEGER_LITERAL||int25==BOOL_LITERAL||int25==FLOATING_POINT_LITERAL||int25==CHARACTER_LITERAL||int25==STRING_LITERAL||int25==SIZEOF||int25==IDENTIFIER||int25==65||int25==69||int25==87||int25==94||int25==95||int25==98||int25==99||int25==100||int25==101) {
                         // C.jj, line 529
                         // C.jj, line 529
                         ConstantExpression();
                     case 65:
                     case 69:
                     case 87:
+                    case 94:
                     case 95:
-                    case 96:
+                    case 98:
                     case 99:
                     case 100:
                     case 101:
-                    case 102:
                     // C.jj, line 544
                     // C.jj, line 544
                     ExpressionStatement();
             // C.jj, line 580
             int int26=(jj_ntk==-1)?jj_ntk():
             jj_ntk;
-            if (int26==INTEGER_LITERAL||int26==BOOL_LITERAL||int26==FLOATING_POINT_LITERAL||int26==CHARACTER_LITERAL||int26==STRING_LITERAL||int26==SIZEOF||int26==IDENTIFIER||int26==65||int26==69||int26==87||int26==95||int26==96||int26==99||int26==100||int26==101||int26==102) {
+            if (int26==INTEGER_LITERAL||int26==BOOL_LITERAL||int26==FLOATING_POINT_LITERAL||int26==CHARACTER_LITERAL||int26==STRING_LITERAL||int26==SIZEOF||int26==IDENTIFIER||int26==65||int26==69||int26==87||int26==94||int26==95||int26==98||int26==99||int26==100||int26==101) {
                 // C.jj, line 580
                 // C.jj, line 580
                 Expression();
             // C.jj, line 636
             int int27=(jj_ntk==-1)?jj_ntk():
             jj_ntk;
-            if (int27==INTEGER_LITERAL||int27==BOOL_LITERAL||int27==FLOATING_POINT_LITERAL||int27==CHARACTER_LITERAL||int27==STRING_LITERAL||int27==SIZEOF||int27==IDENTIFIER||int27==65||int27==69||int27==87||int27==95||int27==96||int27==99||int27==100||int27==101||int27==102) {
+            if (int27==INTEGER_LITERAL||int27==BOOL_LITERAL||int27==FLOATING_POINT_LITERAL||int27==CHARACTER_LITERAL||int27==STRING_LITERAL||int27==SIZEOF||int27==IDENTIFIER||int27==65||int27==69||int27==87||int27==94||int27==95||int27==98||int27==99||int27==100||int27==101) {
                 // C.jj, line 636
                 // C.jj, line 636
                 Expression();
             // C.jj, line 636
             int int28=(jj_ntk==-1)?jj_ntk():
             jj_ntk;
-            if (int28==INTEGER_LITERAL||int28==BOOL_LITERAL||int28==FLOATING_POINT_LITERAL||int28==CHARACTER_LITERAL||int28==STRING_LITERAL||int28==SIZEOF||int28==IDENTIFIER||int28==65||int28==69||int28==87||int28==95||int28==96||int28==99||int28==100||int28==101||int28==102) {
+            if (int28==INTEGER_LITERAL||int28==BOOL_LITERAL||int28==FLOATING_POINT_LITERAL||int28==CHARACTER_LITERAL||int28==STRING_LITERAL||int28==SIZEOF||int28==IDENTIFIER||int28==65||int28==69||int28==87||int28==94||int28==95||int28==98||int28==99||int28==100||int28==101) {
                 // C.jj, line 636
                 // C.jj, line 636
                 Expression();
             // C.jj, line 636
             int int29=(jj_ntk==-1)?jj_ntk():
             jj_ntk;
-            if (int29==INTEGER_LITERAL||int29==BOOL_LITERAL||int29==FLOATING_POINT_LITERAL||int29==CHARACTER_LITERAL||int29==STRING_LITERAL||int29==SIZEOF||int29==IDENTIFIER||int29==65||int29==69||int29==87||int29==95||int29==96||int29==99||int29==100||int29==101||int29==102) {
+            if (int29==INTEGER_LITERAL||int29==BOOL_LITERAL||int29==FLOATING_POINT_LITERAL||int29==CHARACTER_LITERAL||int29==STRING_LITERAL||int29==SIZEOF||int29==IDENTIFIER||int29==65||int29==69||int29==87||int29==94||int29==95||int29==98||int29==99||int29==100||int29==101) {
                 // C.jj, line 636
                 // C.jj, line 636
                 Expression();
             // C.jj, line 665
             int int30=(jj_ntk==-1)?jj_ntk():
             jj_ntk;
-            if (int30==INTEGER_LITERAL||int30==BOOL_LITERAL||int30==FLOATING_POINT_LITERAL||int30==CHARACTER_LITERAL||int30==STRING_LITERAL||int30==SIZEOF||int30==IDENTIFIER||int30==65||int30==69||int30==87||int30==95||int30==96||int30==99||int30==100||int30==101||int30==102) {
+            if (int30==INTEGER_LITERAL||int30==BOOL_LITERAL||int30==FLOATING_POINT_LITERAL||int30==CHARACTER_LITERAL||int30==STRING_LITERAL||int30==SIZEOF||int30==IDENTIFIER||int30==65||int30==69||int30==87||int30==94||int30==95||int30==98||int30==99||int30==100||int30==101) {
                 // C.jj, line 665
                 // C.jj, line 665
                 Expression();
             // C.jj, line 671
             label_14:
             while (true) {
-                int int31=(jj_ntk==-1)?jj_ntk():
-                jj_ntk;
-                if (!(int31==71)) {
-                    jj_la1[53]=jj_gen;
+                if (!(jj_2_30(2))) {
                     break label_14;
                 }
                 // C.jj, line 671
             // C.jj, line 676
             label_15:
             while (true) {
-                int int32=(jj_ntk==-1)?jj_ntk():
+                int int31=(jj_ntk==-1)?jj_ntk():
                 jj_ntk;
-                if (!(int32==71)) {
-                    jj_la1[54]=jj_gen;
+                if (!(int31==71)) {
+                    jj_la1[53]=jj_gen;
                     break label_15;
                 }
                 // C.jj, line 676
             // C.jj, line 682
             label_16:
             while (true) {
-                int int33=(jj_ntk==-1)?jj_ntk():
+                int int32=(jj_ntk==-1)?jj_ntk():
                 jj_ntk;
-                if (!(int33==62)) {
-                    jj_la1[55]=jj_gen;
+                if (!(int32==62)) {
+                    jj_la1[54]=jj_gen;
                     break label_16;
                 }
                 // C.jj, line 682
         }
         boolean hitException73=false;
         try {
-            if (jj_2_30(2147483647)) {
+            if (jj_2_31(2147483647)) {
                 // C.jj, line 687
                 // C.jj, line 687
                 UnaryExpression();
                 // C.jj, line 687
                 AssignmentExpression();
             }
-            else if (jj_2_31(3)) {
+            else if (jj_2_32(3)) {
                 // C.jj, line 688
                 // C.jj, line 688
                 ConditionalExpression();
                 jj_consume_token(81);
                 break;
                 default:
-                jj_la1[56]=jj_gen;
+                jj_la1[55]=jj_gen;
                 jj_consume_token(-1);
                 throw new ParseException();
             }
             // C.jj, line 698
             LogicalORExpression();
             // C.jj, line 698
-            int int34=(jj_ntk==-1)?jj_ntk():
+            int int33=(jj_ntk==-1)?jj_ntk():
             jj_ntk;
-            if (int34==82) {
+            if (int33==82) {
                 // C.jj, line 698
                 // C.jj, line 698
                 jj_consume_token(82);
                 ConditionalExpression();
             }
             else {
-                jj_la1[57]=jj_gen;
+                jj_la1[56]=jj_gen;
             }
         }
         catch(Exception e75) {
             // C.jj, line 708
             LogicalANDExpression();
             // C.jj, line 708
-            int int35=(jj_ntk==-1)?jj_ntk():
+            int int34=(jj_ntk==-1)?jj_ntk():
             jj_ntk;
-            if (int35==83) {
+            if (int34==83) {
                 // C.jj, line 708
                 // C.jj, line 708
                 jj_consume_token(83);
                 LogicalORExpression();
             }
             else {
-                jj_la1[58]=jj_gen;
+                jj_la1[57]=jj_gen;
             }
         }
         catch(Exception e77) {
             // C.jj, line 713
             InclusiveORExpression();
             // C.jj, line 713
-            int int36=(jj_ntk==-1)?jj_ntk():
+            int int35=(jj_ntk==-1)?jj_ntk():
             jj_ntk;
-            if (int36==84) {
+            if (int35==84) {
                 // C.jj, line 713
                 // C.jj, line 713
                 jj_consume_token(84);
                 LogicalANDExpression();
             }
             else {
-                jj_la1[59]=jj_gen;
+                jj_la1[58]=jj_gen;
             }
         }
         catch(Exception e78) {
             // C.jj, line 718
             ExclusiveORExpression();
             // C.jj, line 718
-            int int37=(jj_ntk==-1)?jj_ntk():
+            int int36=(jj_ntk==-1)?jj_ntk():
             jj_ntk;
-            if (int37==85) {
+            if (int36==85) {
                 // C.jj, line 718
                 // C.jj, line 718
                 jj_consume_token(85);
                 InclusiveORExpression();
             }
             else {
-                jj_la1[60]=jj_gen;
+                jj_la1[59]=jj_gen;
             }
         }
         catch(Exception e79) {
             // C.jj, line 723
             ANDExpression();
             // C.jj, line 723
-            int int38=(jj_ntk==-1)?jj_ntk():
+            int int37=(jj_ntk==-1)?jj_ntk():
             jj_ntk;
-            if (int38==86) {
+            if (int37==86) {
                 // C.jj, line 723
                 // C.jj, line 723
                 jj_consume_token(86);
                 ExclusiveORExpression();
             }
             else {
-                jj_la1[61]=jj_gen;
+                jj_la1[60]=jj_gen;
             }
         }
         catch(Exception e80) {
             // C.jj, line 728
             EqualityExpression();
             // C.jj, line 728
-            int int39=(jj_ntk==-1)?jj_ntk():
+            int int38=(jj_ntk==-1)?jj_ntk():
             jj_ntk;
-            if (int39==87) {
+            if (int38==87) {
                 // C.jj, line 728
                 // C.jj, line 728
                 jj_consume_token(87);
                 ANDExpression();
             }
             else {
-                jj_la1[62]=jj_gen;
+                jj_la1[61]=jj_gen;
             }
         }
         catch(Exception e81) {
             // C.jj, line 733
             RelationalExpression();
             // C.jj, line 733
-            int int40=(jj_ntk==-1)?jj_ntk():
+            int int39=(jj_ntk==-1)?jj_ntk():
             jj_ntk;
-            if (int40==88||int40==89) {
+            if (int39==88||int39==89) {
                 // C.jj, line 733
                 // C.jj, line 733
                 switch((jj_ntk==-1)?jj_ntk():
                     jj_consume_token(89);
                     break;
                     default:
-                    jj_la1[63]=jj_gen;
+                    jj_la1[62]=jj_gen;
                     jj_consume_token(-1);
                     throw new ParseException();
                 }
                 EqualityExpression();
             }
             else {
-                jj_la1[64]=jj_gen;
+                jj_la1[63]=jj_gen;
             }
         }
         catch(Exception e82) {
             // C.jj, line 738
             ShiftExpression();
             // C.jj, line 738
-            int int41=(jj_ntk==-1)?jj_ntk():
+            int int40=(jj_ntk==-1)?jj_ntk():
             jj_ntk;
-            if (int41==90||int41==91||int41==92||int41==93) {
+            if (int40==90||int40==91||int40==92||int40==93) {
                 // C.jj, line 738
                 // C.jj, line 738
                 switch((jj_ntk==-1)?jj_ntk():
                     jj_consume_token(93);
                     break;
                     default:
-                    jj_la1[65]=jj_gen;
+                    jj_la1[64]=jj_gen;
                     jj_consume_token(-1);
                     throw new ParseException();
                 }
                 RelationalExpression();
             }
             else {
-                jj_la1[66]=jj_gen;
+                jj_la1[65]=jj_gen;
             }
         }
         catch(Exception e83) {
 
     // C.jj, line 741
     final public void ShiftExpression() throws ParseException {
-        // C.jj, line 743
+        // C.jj, line 746
         ShiftExpression node84=null;
         if (buildTree) {
             node84=new ShiftExpression();
         }
         boolean hitException84=false;
         try {
-            // C.jj, line 743
+            // C.jj, line 746
             AdditiveExpression();
-            // C.jj, line 743
-            int int42=(jj_ntk==-1)?jj_ntk():
-            jj_ntk;
-            if (int42==71||int42==94) {
-                // C.jj, line 743
-                // C.jj, line 743
-                switch((jj_ntk==-1)?jj_ntk():
-                jj_ntk) {
-                    case 71:
-                    // C.jj, line 743
-                    // C.jj, line 743
-                    jj_consume_token(71);
-                    break;
-                    case 94:
-                    // C.jj, line 743
-                    // C.jj, line 743
-                    jj_consume_token(94);
-                    break;
-                    default:
-                    jj_la1[67]=jj_gen;
-                    jj_consume_token(-1);
-                    throw new ParseException();
-                }
-                // C.jj, line 743
-                ShiftExpression();
-            }
-            else {
-                jj_la1[68]=jj_gen;
-            }
         }
         catch(Exception e84) {
             hitException84=false;
         }
     }
 
-    // C.jj, line 746
+    // C.jj, line 749
     final public void AdditiveExpression() throws ParseException {
-        // C.jj, line 748
+        // C.jj, line 751
         AdditiveExpression node85=null;
         if (buildTree) {
             node85=new AdditiveExpression();
         }
         boolean hitException85=false;
         try {
-            // C.jj, line 748
+            // C.jj, line 751
             MultiplicativeExpression();
-            // C.jj, line 748
-            int int43=(jj_ntk==-1)?jj_ntk():
+            // C.jj, line 751
+            int int41=(jj_ntk==-1)?jj_ntk():
             jj_ntk;
-            if (int43==95||int43==96) {
-                // C.jj, line 748
-                // C.jj, line 748
+            if (int41==94||int41==95) {
+                // C.jj, line 751
+                // C.jj, line 751
                 switch((jj_ntk==-1)?jj_ntk():
                 jj_ntk) {
+                    case 94:
+                    // C.jj, line 751
+                    // C.jj, line 751
+                    jj_consume_token(94);
+                    break;
                     case 95:
-                    // C.jj, line 748
-                    // C.jj, line 748
+                    // C.jj, line 751
+                    // C.jj, line 751
                     jj_consume_token(95);
                     break;
-                    case 96:
-                    // C.jj, line 748
-                    // C.jj, line 748
-                    jj_consume_token(96);
-                    break;
                     default:
-                    jj_la1[69]=jj_gen;
+                    jj_la1[66]=jj_gen;
                     jj_consume_token(-1);
                     throw new ParseException();
                 }
-                // C.jj, line 748
+                // C.jj, line 751
                 AdditiveExpression();
             }
             else {
-                jj_la1[70]=jj_gen;
+                jj_la1[67]=jj_gen;
             }
         }
         catch(Exception e85) {
         }
     }
 
-    // C.jj, line 751
+    // C.jj, line 754
     final public void MultiplicativeExpression() throws ParseException {
-        // C.jj, line 753
+        // C.jj, line 756
         MultiplicativeExpression node86=null;
         if (buildTree) {
             node86=new MultiplicativeExpression();
         }
         boolean hitException86=false;
         try {
-            // C.jj, line 753
+            // C.jj, line 756
             CastExpression();
-            // C.jj, line 753
-            int int44=(jj_ntk==-1)?jj_ntk():
+            // C.jj, line 756
+            int int42=(jj_ntk==-1)?jj_ntk():
             jj_ntk;
-            if (int44==69||int44==97||int44==98) {
-                // C.jj, line 753
-                // C.jj, line 753
+            if (int42==69||int42==96||int42==97) {
+                // C.jj, line 756
+                // C.jj, line 756
                 switch((jj_ntk==-1)?jj_ntk():
                 jj_ntk) {
                     case 69:
-                    // C.jj, line 753
-                    // C.jj, line 753
+                    // C.jj, line 756
+                    // C.jj, line 756
                     jj_consume_token(69);
                     break;
+                    case 96:
+                    // C.jj, line 756
+                    // C.jj, line 756
+                    jj_consume_token(96);
+                    break;
                     case 97:
-                    // C.jj, line 753
-                    // C.jj, line 753
+                    // C.jj, line 756
+                    // C.jj, line 756
                     jj_consume_token(97);
                     break;
-                    case 98:
-                    // C.jj, line 753
-                    // C.jj, line 753
-                    jj_consume_token(98);
-                    break;
                     default:
-                    jj_la1[71]=jj_gen;
+                    jj_la1[68]=jj_gen;
                     jj_consume_token(-1);
                     throw new ParseException();
                 }
-                // C.jj, line 753
+                // C.jj, line 756
                 MultiplicativeExpression();
             }
             else {
-                jj_la1[72]=jj_gen;
+                jj_la1[69]=jj_gen;
             }
         }
         catch(Exception e86) {
         }
     }
 
-    // C.jj, line 756
+    // C.jj, line 759
     final public void CastExpression() throws ParseException {
-        // C.jj, line 758
+        // C.jj, line 761
         CastExpression node87=null;
         if (buildTree) {
             node87=new CastExpression();
         }
         boolean hitException87=false;
         try {
-            // C.jj, line 758
-            if (jj_2_32(2147483647)) {
-                // C.jj, line 758
-                // C.jj, line 758
+            // C.jj, line 761
+            if (jj_2_33(2147483647)) {
+                // C.jj, line 761
+                // C.jj, line 761
                 jj_consume_token(65);
-                // C.jj, line 758
+                // C.jj, line 761
                 TypeName();
-                // C.jj, line 758
+                // C.jj, line 761
                 jj_consume_token(66);
-                // C.jj, line 758
+                // C.jj, line 761
                 CastExpression();
             }
             else {
                     case IDENTIFIER:
                     case 69:
                     case 87:
+                    case 94:
                     case 95:
-                    case 96:
+                    case 98:
                     case 99:
                     case 100:
                     case 101:
-                    case 102:
-                    // C.jj, line 759
-                    // C.jj, line 759
+                    // C.jj, line 762
+                    // C.jj, line 762
                     UnaryExpression();
                     break;
                     default:
-                    jj_la1[73]=jj_gen;
+                    jj_la1[70]=jj_gen;
                     jj_consume_token(-1);
                     throw new ParseException();
                 }
         }
     }
 
-    // C.jj, line 762
+    // C.jj, line 765
     final public void UnaryExpression() throws ParseException {
-        // C.jj, line 764
+        // C.jj, line 767
         UnaryExpression node88=null;
         if (buildTree) {
             node88=new UnaryExpression();
         }
         boolean hitException88=false;
         try {
-            // C.jj, line 764
-            if (jj_2_33(3)) {
-                // C.jj, line 764
-                // C.jj, line 764
+            // C.jj, line 767
+            if (jj_2_34(3)) {
+                // C.jj, line 767
+                // C.jj, line 767
                 PostfixExpression();
             }
             else {
                 switch((jj_ntk==-1)?jj_ntk():
                 jj_ntk) {
-                    case 99:
-                    // C.jj, line 765
-                    // C.jj, line 765
+                    case 98:
+                    // C.jj, line 768
+                    // C.jj, line 768
                     PrePPExpression();
                     break;
-                    case 100:
-                    // C.jj, line 766
-                    // C.jj, line 766
+                    case 99:
+                    // C.jj, line 769
+                    // C.jj, line 769
                     PreMMExpression();
                     break;
                     case 69:
                     case 87:
+                    case 94:
                     case 95:
-                    case 96:
+                    case 100:
                     case 101:
-                    case 102:
-                    // C.jj, line 768
-                    // C.jj, line 768
+                    // C.jj, line 771
+                    // C.jj, line 771
                     UnaryOpExpression();
                     break;
                     case SIZEOF:
-                    // C.jj, line 769
-                    // C.jj, line 769
+                    // C.jj, line 772
+                    // C.jj, line 772
                     SizeofExpression();
                     break;
                     default:
-                    jj_la1[74]=jj_gen;
+                    jj_la1[71]=jj_gen;
                     jj_consume_token(-1);
                     throw new ParseException();
                 }
         }
     }
 
-    // C.jj, line 782
+    // C.jj, line 785
     final public void UnaryOpExpression() throws ParseException {
-        // C.jj, line 784
+        // C.jj, line 787
         UnaryOpExpression node89=null;
         if (buildTree) {
             node89=new UnaryOpExpression();
         }
         boolean hitException89=false;
         try {
-            // C.jj, line 784
+            // C.jj, line 787
             switch((jj_ntk==-1)?jj_ntk():
             jj_ntk) {
                 case 87:
-                // C.jj, line 784
-                // C.jj, line 784
+                // C.jj, line 787
+                // C.jj, line 787
                 AddrOfExpression();
                 break;
                 case 69:
-                // C.jj, line 785
-                // C.jj, line 785
+                // C.jj, line 788
+                // C.jj, line 788
                 DerefExpression();
                 break;
-                case 95:
-                // C.jj, line 786
-                // C.jj, line 786
+                case 94:
+                // C.jj, line 789
+                // C.jj, line 789
                 PosExpression();
                 break;
-                case 96:
-                // C.jj, line 787
-                // C.jj, line 787
+                case 95:
+                // C.jj, line 790
+                // C.jj, line 790
                 NegExpression();
                 break;
-                case 101:
-                // C.jj, line 788
-                // C.jj, line 788
+                case 100:
+                // C.jj, line 791
+                // C.jj, line 791
                 BitwiseNotExpression();
                 break;
-                case 102:
-                // C.jj, line 789
-                // C.jj, line 789
+                case 101:
+                // C.jj, line 792
+                // C.jj, line 792
                 NotExpression();
                 break;
                 default:
-                jj_la1[75]=jj_gen;
+                jj_la1[72]=jj_gen;
                 jj_consume_token(-1);
                 throw new ParseException();
             }
     }
 
     //TODO special case for unary operator
-    // C.jj, line 794
+    // C.jj, line 797
     final public void PrePPExpression() throws ParseException {
-        // C.jj, line 796
+        // C.jj, line 799
         PrePPExpression node90=null;
         if (buildTree) {
             node90=new PrePPExpression();
         }
         boolean hitException90=false;
         try {
-            // C.jj, line 796
-            // C.jj, line 796
-            jj_consume_token(99);
-            // C.jj, line 796
+            // C.jj, line 799
+            // C.jj, line 799
+            jj_consume_token(98);
+            // C.jj, line 799
             UnaryExpression();
         }
         catch(Exception e90) {
         }
     }
 
-    // C.jj, line 799
+    // C.jj, line 802
     final public void PreMMExpression() throws ParseException {
-        // C.jj, line 801
+        // C.jj, line 804
         PreMMExpression node91=null;
         if (buildTree) {
             node91=new PreMMExpression();
         }
         boolean hitException91=false;
         try {
-            // C.jj, line 801
-            // C.jj, line 801
-            jj_consume_token(100);
-            // C.jj, line 801
+            // C.jj, line 804
+            // C.jj, line 804
+            jj_consume_token(99);
+            // C.jj, line 804
             UnaryExpression();
         }
         catch(Exception e91) {
         }
     }
 
-    // C.jj, line 804
+    // C.jj, line 807
     final public void SizeofExpression() throws ParseException {
-        // C.jj, line 806
+        // C.jj, line 809
         SizeofExpression node92=null;
         if (buildTree) {
             node92=new SizeofExpression();
         }
         boolean hitException92=false;
         try {
-            // C.jj, line 806
+            // C.jj, line 809
             jj_consume_token(SIZEOF);
-            // C.jj, line 806
-            if (jj_2_34(2147483647)) {
-                // C.jj, line 806
-                // C.jj, line 806
+            // C.jj, line 809
+            if (jj_2_35(2147483647)) {
+                // C.jj, line 809
+                // C.jj, line 809
                 UnaryExpression();
             }
             else {
                 switch((jj_ntk==-1)?jj_ntk():
                 jj_ntk) {
                     case 65:
-                    // C.jj, line 806
-                    // C.jj, line 806
+                    // C.jj, line 809
+                    // C.jj, line 809
                     jj_consume_token(65);
-                    // C.jj, line 806
+                    // C.jj, line 809
                     TypeName();
-                    // C.jj, line 806
+                    // C.jj, line 809
                     jj_consume_token(66);
                     break;
                     default:
-                    jj_la1[76]=jj_gen;
+                    jj_la1[73]=jj_gen;
                     jj_consume_token(-1);
                     throw new ParseException();
                 }
         }
     }
 
-    // C.jj, line 809
+    // C.jj, line 812
     final public void AddrOfExpression() throws ParseException {
-        // C.jj, line 811
+        // C.jj, line 814
         AddrOfExpression node93=null;
         if (buildTree) {
             node93=new AddrOfExpression();
         }
         boolean hitException93=false;
         try {
-            // C.jj, line 811
-            // C.jj, line 811
+            // C.jj, line 814
+            // C.jj, line 814
             jj_consume_token(87);
-            // C.jj, line 811
+            // C.jj, line 814
             CastExpression();
         }
         catch(Exception e93) {
         }
     }
 
-    // C.jj, line 814
+    // C.jj, line 817
     final public void DerefExpression() throws ParseException {
-        // C.jj, line 816
+        // C.jj, line 819
         DerefExpression node94=null;
         if (buildTree) {
             node94=new DerefExpression();
         }
         boolean hitException94=false;
         try {
-            // C.jj, line 816
-            // C.jj, line 816
+            // C.jj, line 819
+            // C.jj, line 819
             jj_consume_token(69);
-            // C.jj, line 816
+            // C.jj, line 819
             CastExpression();
         }
         catch(Exception e94) {
         }
     }
 
-    // C.jj, line 819
+    // C.jj, line 822
     final public void PosExpression() throws ParseException {
-        // C.jj, line 821
+        // C.jj, line 824
         PosExpression node95=null;
         if (buildTree) {
             node95=new PosExpression();
         }
         boolean hitException95=false;
         try {
-            // C.jj, line 821
-            // C.jj, line 821
-            jj_consume_token(95);
-            // C.jj, line 821
+            // C.jj, line 824
+            // C.jj, line 824
+            jj_consume_token(94);
+            // C.jj, line 824
             CastExpression();
         }
         catch(Exception e95) {
         }
     }
 
-    // C.jj, line 824
+    // C.jj, line 827
     final public void NegExpression() throws ParseException {
-        // C.jj, line 826
+        // C.jj, line 829
         NegExpression node96=null;
         if (buildTree) {
             node96=new NegExpression();
         }
         boolean hitException96=false;
         try {
-            // C.jj, line 826
-            // C.jj, line 826
-            jj_consume_token(96);
-            // C.jj, line 826
+            // C.jj, line 829
+            // C.jj, line 829
+            jj_consume_token(95);
+            // C.jj, line 829
             CastExpression();
         }
         catch(Exception e96) {
         }
     }
 
-    // C.jj, line 829
+    // C.jj, line 832
     final public void BitwiseNotExpression() throws ParseException {
-        // C.jj, line 831
+        // C.jj, line 834
         BitwiseNotExpression node97=null;
         if (buildTree) {
             node97=new BitwiseNotExpression();
         }
         boolean hitException97=false;
         try {
-            // C.jj, line 831
-            // C.jj, line 831
-            jj_consume_token(101);
-            // C.jj, line 831
+            // C.jj, line 834
+            // C.jj, line 834
+            jj_consume_token(100);
+            // C.jj, line 834
             CastExpression();
         }
         catch(Exception e97) {
         }
     }
 
-    // C.jj, line 834
+    // C.jj, line 837
     final public void NotExpression() throws ParseException {
-        // C.jj, line 836
+        // C.jj, line 839
         NotExpression node98=null;
         if (buildTree) {
             node98=new NotExpression();
         }
         boolean hitException98=false;
         try {
-            // C.jj, line 836
-            // C.jj, line 836
-            jj_consume_token(102);
-            // C.jj, line 836
+            // C.jj, line 839
+            // C.jj, line 839
+            jj_consume_token(101);
+            // C.jj, line 839
             CastExpression();
         }
         catch(Exception e98) {
 }
 */
     //Split Up for Giraffe
-    // C.jj, line 848
+    // C.jj, line 851
     final public void PostfixExpression() throws ParseException {
-        // C.jj, line 850
+        // C.jj, line 853