Commits

Michael Ludwig committed a717602

Layout relatively complete grammar for GLSL 1.10

Comments (0)

Files changed (64)

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/ArrayAccess.java

+package com.ferox.resource.shader.grammar;
+
+public class ArrayAccess implements PostfixExpression {
+    private final PostfixExpression array;
+    private final Expression index; // int_expression
+
+    public ArrayAccess(PostfixExpression array, Expression index) {
+        this.array = array;
+        this.index = index;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/ArrayIdentifierDeclaration.java

+package com.ferox.resource.shader.grammar;
+
+public class ArrayIdentifierDeclaration implements SingleDeclaration {
+    private final FullySpecifiedType type;
+    private final String identifier;
+    private final ConstantExpression bracketExpression;
+
+    public ArrayIdentifierDeclaration(FullySpecifiedType type, String identifier,
+                                      ConstantExpression bracketExpression) {
+        this.type = type;
+        this.identifier = identifier;
+        this.bracketExpression = bracketExpression;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/AssignmentExpression.java

+package com.ferox.resource.shader.grammar;
+
+public interface AssignmentExpression extends Expression {
+
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/AssignmentOperatorExpression.java

+package com.ferox.resource.shader.grammar;
+
+public class AssignmentOperatorExpression implements AssignmentExpression {
+    public static enum AssignmentOperator {
+        EQUAL,
+        MUL_ASSIGN,
+        DIV_ASSIGN,
+        MOD_ASSIGN,
+        ADD_ASSIGN,
+        SUB_ASSIGN
+    }
+
+    private final UnaryExpression lvalue;
+    private final AssignmentOperator operator;
+    private final AssignmentExpression rvalue;
+
+    public AssignmentOperatorExpression(UnaryExpression lvalue,
+                                        AssignmentOperator operator,
+                                        AssignmentExpression rvalue) {
+        this.lvalue = lvalue;
+        this.rvalue = rvalue;
+        this.operator = operator;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/BinaryExpression.java

+package com.ferox.resource.shader.grammar;
+
+public interface BinaryExpression extends ConditionalExpression {
+
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/BinaryOperatorExpression.java

+package com.ferox.resource.shader.grammar;
+
+public class BinaryOperatorExpression implements BinaryExpression {
+    public static enum BinaryOperator {
+        MULTIPLY,
+        DIVIDE,
+        MODULO,
+        ADD,
+        SUBTRACT,
+        LEFT_SHIFT,
+        RIGHT_SHIFT,
+        LESS_THAN,
+        GREATER_THAN,
+        LESS_THAN_OR_EQUAL,
+        GREATER_THAN_OR_EQUAL,
+        EQUAL,
+        NOT_EQUAL,
+        LOGICAL_AND,
+        LOGICAL_XOR,
+        LOGICAL_OR
+        // FIXME insert bitwise AND, XOR, and OR
+    }
+
+    private final BinaryExpression left;
+    private final BinaryOperator operator;
+    private final UnaryExpression right;
+
+    public BinaryOperatorExpression(BinaryExpression left, BinaryOperator operator,
+                                    UnaryExpression right) {
+        this.left = left;
+        this.right = right;
+        this.operator = operator;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/BoolConstant.java

+package com.ferox.resource.shader.grammar;
+
+public class BoolConstant implements PrimaryExpression {
+    private final boolean value;
+
+    public BoolConstant(boolean value) {
+        this.value = value;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/BreakStatement.java

+package com.ferox.resource.shader.grammar;
+
+public class BreakStatement implements JumpStatement {
+
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/CompoundStatement.java

+package com.ferox.resource.shader.grammar;
+
+public class CompoundStatement implements Statement {
+    private final Statement[] statements;
+
+    public CompoundStatement(Statement... statements) {
+        this.statements = statements;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/ConditionalExpression.java

+package com.ferox.resource.shader.grammar;
+
+public interface ConditionalExpression extends AssignmentExpression, ConstantExpression {
+
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/ConditionalSelectExpression.java

+package com.ferox.resource.shader.grammar;
+
+public class ConditionalSelectExpression implements ConditionalExpression {
+    private final BinaryExpression condition;
+    private final Expression onTrue;
+    private final ConditionalExpression onFalse;
+
+    public ConditionalSelectExpression(BinaryExpression condition, Expression onTrue,
+                                       ConditionalExpression onFalse) {
+        this.condition = condition;
+        this.onTrue = onTrue;
+        this.onFalse = onFalse;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/ConstantExpression.java

+package com.ferox.resource.shader.grammar;
+
+public interface ConstantExpression {
+
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/ConstructorIdentifier.java

+package com.ferox.resource.shader.grammar;
+
+public interface ConstructorIdentifier extends FunctionIdentifier {
+
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/ContinueStatement.java

+package com.ferox.resource.shader.grammar;
+
+public class ContinueStatement implements JumpStatement {
+
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/Declaration.java

+package com.ferox.resource.shader.grammar;
+
+public interface Declaration extends ExternalDeclaration, SimpleStatement, ForLoopInitializer {
+
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/DiscardStatement.java

+package com.ferox.resource.shader.grammar;
+
+public class DiscardStatement implements JumpStatement {
+
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/EmptyExpression.java

+package com.ferox.resource.shader.grammar;
+
+public class EmptyExpression implements ConstantExpression {
+
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/Expression.java

+package com.ferox.resource.shader.grammar;
+
+public interface Expression extends SimpleStatement, WhileLoopCondition, ForLoopInitializer {
+
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/ExpressionList.java

+package com.ferox.resource.shader.grammar;
+
+public class ExpressionList implements Expression {
+    private final Expression first;
+    private final AssignmentExpression afterComma;
+
+    public ExpressionList(Expression first, AssignmentExpression afterComma) {
+        this.first = first;
+        this.afterComma = afterComma;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/ExternalDeclaration.java

+package com.ferox.resource.shader.grammar;
+
+public interface ExternalDeclaration {
+
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/FieldSelection.java

+package com.ferox.resource.shader.grammar;
+
+public class FieldSelection implements PostfixExpression {
+    private final PostfixExpression variable;
+    private final String field;
+
+    public FieldSelection(PostfixExpression variable, String field) {
+        this.variable = variable;
+        this.field = field;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/FloatConstant.java

+package com.ferox.resource.shader.grammar;
+
+public class FloatConstant implements PrimaryExpression {
+    private final float value;
+
+    public FloatConstant(float value) {
+        this.value = value;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/ForLoopInitializer.java

+package com.ferox.resource.shader.grammar;
+
+public interface ForLoopInitializer {
+
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/ForStatement.java

+package com.ferox.resource.shader.grammar;
+
+public class ForStatement implements IterationStatement {
+    private final ForLoopInitializer initStatement;
+    private final WhileLoopCondition condition; // nullable for no condition
+    private final Expression increment; // nullable for no increment
+    private final Statement body;
+
+    public ForStatement(ForLoopInitializer initStatement, WhileLoopCondition condition,
+                        Expression increment, Statement body) {
+        this.initStatement = initStatement;
+        this.condition = condition;
+        this.increment = increment;
+        this.body = body;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/FullySpecifiedType.java

+package com.ferox.resource.shader.grammar;
+
+public class FullySpecifiedType implements SingleDeclaration {
+    public static enum TypeQualifier {
+        CONST,
+        // FIXME attribute and varying are deprecated and replaced by IN/OUT/INOUT
+        ATTRIBUTE,
+        VARYING,
+        // FIXME are uniforms really allowed in a function parameter list?
+        UNIFORM
+    }
+
+    private final TypeSpecifier type;
+    private final TypeQualifier qualifier; // nullable for unqualified type
+
+    public FullySpecifiedType(TypeQualifier qualifier, TypeSpecifier type) {
+        this.type = type;
+        this.qualifier = qualifier;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/FunctionCall.java

+package com.ferox.resource.shader.grammar;
+
+public class FunctionCall implements PostfixExpression {
+    // this is a reasonable consolidation of the grammar for
+    // function calls with and without parameters
+    private final FunctionIdentifier identifier;
+    private final AssignmentExpression[] parameters;
+
+    public FunctionCall(FunctionIdentifier identifier, AssignmentExpression... parameters) {
+        this.identifier = identifier;
+        this.parameters = parameters;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/FunctionDefinition.java

+package com.ferox.resource.shader.grammar;
+
+public class FunctionDefinition implements ExternalDeclaration {
+    private final FunctionPrototype prototype;
+    private final CompoundStatement body;
+
+    public FunctionDefinition(FunctionPrototype prototype, CompoundStatement body) {
+        this.prototype = prototype;
+        this.body = body;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/FunctionIdentifier.java

+package com.ferox.resource.shader.grammar;
+
+public interface FunctionIdentifier {
+
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/FunctionNameIdentifier.java

+package com.ferox.resource.shader.grammar;
+
+public class FunctionNameIdentifier implements FunctionIdentifier {
+    private final String identifier;
+
+    public FunctionNameIdentifier(String identifier) {
+        this.identifier = identifier;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/FunctionPrototype.java

+package com.ferox.resource.shader.grammar;
+
+public class FunctionPrototype implements Declaration {
+    private final FullySpecifiedType type;
+    private final ParameterDeclaration[] parameters;
+
+    public FunctionPrototype(FullySpecifiedType type, ParameterDeclaration... parameters) {
+        this.type = type;
+        this.parameters = parameters;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/IdentifierDeclaration.java

+package com.ferox.resource.shader.grammar;
+
+public class IdentifierDeclaration implements SingleDeclaration {
+    private final FullySpecifiedType type;
+    private final String identifier;
+    private final AssignmentExpression initializer; // nullable for no initializer
+
+    public IdentifierDeclaration(FullySpecifiedType type, String identifier,
+                                 AssignmentExpression initializer) {
+        this.type = type;
+        this.identifier = identifier;
+        this.initializer = initializer;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/InitArrayIdentifierList.java

+package com.ferox.resource.shader.grammar;
+
+public class InitArrayIdentifierList implements InitDeclaratorList {
+    private final InitDeclaratorList priorDeclarations;
+    private final String identifier;
+    private final ConstantExpression bracketExpression;
+
+    public InitArrayIdentifierList(InitDeclaratorList priorDeclarations,
+                                   String identifier, ConstantExpression bracketExpression) {
+        this.priorDeclarations = priorDeclarations;
+        this.identifier = identifier;
+        this.bracketExpression = bracketExpression;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/InitDeclaratorList.java

+package com.ferox.resource.shader.grammar;
+
+public interface InitDeclaratorList extends Declaration {
+
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/InitIdentifierList.java

+package com.ferox.resource.shader.grammar;
+
+public class InitIdentifierList implements InitDeclaratorList {
+    private final InitDeclaratorList priorDeclarations;
+    private final String identifier;
+    private final AssignmentExpression initializer; // nullable for no initialization
+
+    public InitIdentifierList(InitDeclaratorList priorDeclarations, String identifier,
+                              AssignmentExpression initializer) {
+        this.priorDeclarations = priorDeclarations;
+        this.identifier = identifier;
+        this.initializer = initializer;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/IntConstant.java

+package com.ferox.resource.shader.grammar;
+
+public class IntConstant implements PrimaryExpression {
+    private final int value;
+
+    public IntConstant(int value) {
+        this.value = value;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/IterationStatement.java

+package com.ferox.resource.shader.grammar;
+
+public interface IterationStatement extends SimpleStatement {
+
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/JumpStatement.java

+package com.ferox.resource.shader.grammar;
+
+public interface JumpStatement extends SimpleStatement {
+
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/NestedExpression.java

+package com.ferox.resource.shader.grammar;
+
+public class NestedExpression implements PrimaryExpression {
+    private final Expression expression;
+
+    public NestedExpression(Expression expression) {
+        this.expression = expression;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/ParameterDeclaration.java

+package com.ferox.resource.shader.grammar;
+
+import com.ferox.resource.shader.grammar.FullySpecifiedType.TypeQualifier;
+
+public class ParameterDeclaration {
+    public static enum ParameterQualifier {
+        IN,
+        OUT,
+        INOUT
+    }
+
+    // FIXME why doesn't this use a FullySpecifiedType?
+    private final TypeQualifier typeQualifier; // nullable for no qualifier
+    private final ParameterQualifier paramQualifier;
+
+    private final TypeSpecifier type;
+    private final String identifier; // nullable for unlabeled parameter
+    private final ConstantExpression bracketExpression; // nullable for non-array type
+
+    public ParameterDeclaration(TypeQualifier typeQualifier,
+                                ParameterQualifier paramQualifier, TypeSpecifier type,
+                                String identifier, ConstantExpression bracketExpression) {
+        this.typeQualifier = typeQualifier;
+        this.paramQualifier = paramQualifier;
+        this.type = type;
+        this.identifier = identifier;
+        this.bracketExpression = bracketExpression;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/PostfixDecrement.java

+package com.ferox.resource.shader.grammar;
+
+public class PostfixDecrement implements PostfixExpression {
+    private final PostfixExpression expression;
+
+    public PostfixDecrement(PostfixExpression expression) {
+        this.expression = expression;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/PostfixExpression.java

+package com.ferox.resource.shader.grammar;
+
+public interface PostfixExpression extends UnaryExpression {
+
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/PostfixIncrement.java

+package com.ferox.resource.shader.grammar;
+
+public class PostfixIncrement implements PostfixExpression {
+    private final PostfixExpression expression;
+
+    public PostfixIncrement(PostfixExpression expression) {
+        this.expression = expression;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/PrefixDecrement.java

+package com.ferox.resource.shader.grammar;
+
+public class PrefixDecrement implements UnaryExpression {
+    private final UnaryExpression expression;
+
+    public PrefixDecrement(UnaryExpression expression) {
+        this.expression = expression;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/PrefixIncrement.java

+package com.ferox.resource.shader.grammar;
+
+public class PrefixIncrement implements UnaryExpression {
+    private final UnaryExpression expression;
+
+    public PrefixIncrement(UnaryExpression expression) {
+        this.expression = expression;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/PrimaryExpression.java

+package com.ferox.resource.shader.grammar;
+
+public interface PrimaryExpression extends PostfixExpression {
+
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/PrimitiveConstructorIdentifier.java

+package com.ferox.resource.shader.grammar;
+
+public enum PrimitiveConstructorIdentifier implements ConstructorIdentifier {
+    FLOAT,
+    INT,
+    BOOL,
+    VEC2,
+    VEC3,
+    VEC4,
+    BVEC2,
+    BVEC3,
+    BVEC4,
+    IVEC2,
+    IVEC3,
+    IVEC4,
+    MAt2,
+    MAT3,
+    MAT4
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/PrimitiveTypeSpecifier.java

+package com.ferox.resource.shader.grammar;
+
+public enum PrimitiveTypeSpecifier implements TypeSpecifier {
+    VOID,
+    FLOAT,
+    INT,
+    BOOL,
+    VEC2,
+    VEC3,
+    VEC4,
+    BVEC2,
+    BVEC3,
+    BVEC4,
+    IVEC2,
+    IVEC3,
+    IVEc4,
+    MAT2,
+    MAT3,
+    MAT4,
+    SAMPLER1D,
+    SAMPLER2D,
+    SAMPLER3D,
+    SAMPLERCUBE,
+    SAMPLER1DSHADOW,
+    SAMPLER2DSHADOW
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/ReturnStatement.java

+package com.ferox.resource.shader.grammar;
+
+public class ReturnStatement implements JumpStatement {
+    private final Expression expression; // nullable for a void return
+
+    public ReturnStatement(Expression expression) {
+        this.expression = expression;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/SelectionStatement.java

+package com.ferox.resource.shader.grammar;
+
+public class SelectionStatement implements SimpleStatement {
+    private final Expression condition;
+    private final Statement onTrue;
+    private final Statement onFalse; // null for no else branch
+
+    public SelectionStatement(Expression condition, Statement onTrue, Statement onFalse) {
+        this.condition = condition;
+        this.onTrue = onTrue;
+        this.onFalse = onFalse;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/SimpleStatement.java

+package com.ferox.resource.shader.grammar;
+
+public interface SimpleStatement {
+
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/SingleDeclaration.java

+package com.ferox.resource.shader.grammar;
+
+public interface SingleDeclaration {
+
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/Statement.java

+package com.ferox.resource.shader.grammar;
+
+public interface Statement {
+
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/StructDeclaration.java

+package com.ferox.resource.shader.grammar;
+
+public class StructDeclaration {
+    private final TypeSpecifier type;
+    private final StructDeclarator[] identifiers;
+
+    public StructDeclaration(TypeSpecifier type, StructDeclarator... identifiers) {
+        this.type = type;
+        this.identifiers = identifiers;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/StructDeclarator.java

+package com.ferox.resource.shader.grammar;
+
+public class StructDeclarator {
+    private final String identifier;
+    private final ConstantExpression bracketExpression; // null for non-array type
+
+    public StructDeclarator(String identifier, ConstantExpression bracketExpression) {
+        this.identifier = identifier;
+        this.bracketExpression = bracketExpression;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/StructSpecifier.java

+package com.ferox.resource.shader.grammar;
+
+public class StructSpecifier implements TypeSpecifier {
+    private final StructDeclaration[] definition;
+
+    public StructSpecifier(StructDeclaration... definition) {
+        this.definition = definition;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/TranslationUnit.java

+package com.ferox.resource.shader.grammar;
+
+public class TranslationUnit {
+    private final ExternalDeclaration[] declarations;
+
+    public TranslationUnit(ExternalDeclaration... declarations) {
+        this.declarations = declarations;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/TypeNameIdentifier.java

+package com.ferox.resource.shader.grammar;
+
+public class TypeNameIdentifier implements ConstructorIdentifier, TypeSpecifier {
+    private final String name;
+
+    public TypeNameIdentifier(String name) {
+        this.name = name;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/TypeSpecifier.java

+package com.ferox.resource.shader.grammar;
+
+public interface TypeSpecifier {
+
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/UnaryExpression.java

+package com.ferox.resource.shader.grammar;
+
+public interface UnaryExpression extends BinaryExpression {
+
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/UnaryOperatorExpression.java

+package com.ferox.resource.shader.grammar;
+
+public class UnaryOperatorExpression implements UnaryExpression {
+    public static enum UnaryOperator {
+        PLUS,
+        DASH,
+        BANG,
+        TILDE /* reserved */
+    }
+
+    private final UnaryOperator operator;
+    private final UnaryExpression expression;
+
+    public UnaryOperatorExpression(UnaryOperator operator, UnaryExpression expression) {
+        this.operator = operator;
+        this.expression = expression;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/VariableIdentifier.java

+package com.ferox.resource.shader.grammar;
+
+public class VariableIdentifier implements PrimaryExpression {
+    private final String identifier;
+
+    public VariableIdentifier(String identifier) {
+        this.identifier = identifier;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/WhileLoopCondition.java

+package com.ferox.resource.shader.grammar;
+
+public interface WhileLoopCondition {
+
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/WhileLoopInitializer.java

+package com.ferox.resource.shader.grammar;
+
+public class WhileLoopInitializer implements WhileLoopCondition {
+    private final FullySpecifiedType type;
+    private final String identifier;
+    private final AssignmentExpression initializer;
+
+    public WhileLoopInitializer(FullySpecifiedType type, String identifier,
+                                AssignmentExpression initializer) {
+        this.type = type;
+        this.identifier = identifier;
+        this.initializer = initializer;
+    }
+}

ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/resource/shader/grammar/WhileStatement.java

+package com.ferox.resource.shader.grammar;
+
+public class WhileStatement implements IterationStatement {
+    private final WhileLoopCondition condition;
+    private final Statement body;
+
+    public WhileStatement(WhileLoopCondition condition, Statement body) {
+        this.condition = condition;
+        this.body = body;
+    }
+}