public ASTTableGet(ASTExpressionBase variable, ASTExpressionBase tableIndex) { Variable = variable; TableIndexes = new List <ASTExpressionBase> { tableIndex }; }
public ASTFor(ASTExpressionBase initializer, ASTExpressionBase condition, ASTExpressionBase incrementer, ASTStatementBase body) { Initializer = initializer; Condition = condition; Incrementer = incrementer; Body = body; }
public bool InsertValue(ASTExpressionBase key, ASTExpressionBase value) { if (key == null) { AutoIntegerValues.Add(AutoIntegerValues.Count, new ASTTableElement(AutoIntegerValues.Count, value)); return(true); } if (key.Type == ExpressionType.NUMBER) { var numberKey = key as ASTNumber; if (IntegerValues.ContainsKey((int)numberKey.Value)) // TODO: Do something to stop this from possibly crashing.. someday. (double to int cast) { return(false); } IntegerValues.Add((int)numberKey.Value, new ASTTableElement((int)numberKey.Value, value)); } else if (key.Type == ExpressionType.STRING) { var stringKey = key as ASTString; if (StringValues.ContainsKey(stringKey.Text)) { return(false); } StringValues.Add(stringKey.Text, new ASTTableElement(stringKey.Text, value)); } else if (key.Type == ExpressionType.IDENTIFIER) { var identifierKey = key as ASTIdentifier; if (StringValues.ContainsKey(identifierKey.Name)) { return(false); } StringValues.Add(identifierKey.Name, new ASTTableElement(identifierKey.Name, value)); } else { return(false); } return(true); }
public ASTTableElement(int key, ASTExpressionBase value) { IntKey = key; Value = value; Type = ExpressionType.NUMBER; }
public ASTTableElement(string key, ASTExpressionBase value) { StringKey = key; Value = value; Type = ExpressionType.STRING; }
public ASTAssignment(AssignmentType opType, string variable, ASTExpressionBase expression) { OperationType = opType; Variable = variable; Expression = expression; }
public ASTMemberAssignment(AssignmentType opType, string variable, ASTExpressionBase expression) : base(opType, variable, expression) { }
public ASTCompare(OperationType type, ASTExpressionBase left, ASTExpressionBase right) { ComparisonType = type; Left = left; Right = right; }
public ASTReturn(ASTExpressionBase returnExpression) { ReturnExpression = returnExpression; }
public ASTStatementExpression(ASTExpressionBase expression) { Expression = expression; }
public ASTUnaryMathOperation(OperationType type, ASTExpressionBase expression) { MathOperationType = type; Expression = expression; }
public ASTIf(ASTExpressionBase condition, ASTStatementBase ifPart, ASTStatementBase elsePart) : this(condition, ifPart) { ElsePart = elsePart; }
public ASTIf(ASTExpressionBase condition, ASTStatementBase ifPart) { Condition = condition; IfPart = ifPart; }
public ASTGlobalVariableAssignment(string variable, ASTExpressionBase expression) : base(AssignmentType.ASSIGNMENT, variable, expression) { }
public ASTWhile(ASTExpressionBase condition, ASTStatementBase body) { Condition = condition; Body = body; }
public ASTTableGet(ASTExpressionBase variable, List <ASTExpressionBase> tableIndexes) { Variable = variable; TableIndexes = tableIndexes; }
public ASTBinaryMathOperation(OperationType type, ASTExpressionBase left, ASTExpressionBase right) { MathOperationType = type; Left = left; Right = right; }
public ASTMemberAssignmentInstance(AssignmentType opType, string variable, ASTExpressionBase expression, string instanceName) : base(opType, variable, expression) { InstanceName = instanceName; }