public REAFunctionCall(Stringe token, RantExpressionAction function, REAGroup args, string _sourceName) : base(token) { _function = function; List<RantExpressionAction> argValues = new List<RantExpressionAction>(); if (args.Actions.Count > 0) { RantExpressionAction lastArg = null; for (var i = 0; i < args.Actions.Count; i++) { var action = args.Actions[i]; if (action is REAArgumentSeperator) { if (lastArg == null) throw new RantCompilerException(_sourceName, Range, "Blank argument in function call."); argValues.Add(lastArg); } else lastArg = action; } argValues.Add(lastArg); } _argValues = argValues.ToArray(); Returnable = true; }
public REAObjectPropertyAssignment(Stringe origin, RantExpressionAction nameExp, RantExpressionAction obj, RantExpressionAction value) : base(origin) { Name = nameExp; _value = value; _object = obj; }
public REAIfStatement(Stringe token, RantExpressionAction expr, RantExpressionAction body, RantExpressionAction elseBody = null) : base(token) { _expression = expr; _body = body; _elseBody = elseBody; }
public REAWhile(Stringe token, RantExpressionAction test, RantExpressionAction body) : base(token) { _test = test; _body = body; Breakable = true; }
public REAFor( Stringe token, string indexName, RantExpressionAction body, RantExpressionAction expr) : base(token) { _expr = expr; _body = body; _indexName = indexName; }
public REAFunction(Stringe origin, RantExpressionAction body, REAGroup args) : base(origin) { List<string> argNames = new List<string>(); if (args.Actions.Count > 0) { string lastArg = ""; for (var i = 0; i < args.Actions.Count; i++) { var action = args.Actions[i]; if (action is REAArgumentSeperator) argNames.Add(lastArg); else lastArg = (action as REAVariable).Name; } argNames.Add(lastArg); } // reverse it, since things are popped from the object stack in reverse order argNames.Reverse(); _argNames = argNames.ToArray(); _body = body; Type = ActionValueType.Function; Returnable = true; }
public REAReturn(Stringe origin, RantExpressionAction value) : base(origin) { _returnValue = value; }
public REAObjectKeyValue(Stringe token, RantExpressionAction value) : base(token) { Name = Util.UnescapeConstantLiteral(token.Value); Value = value; }
public REAObjectProperty(Stringe origin, RantExpressionAction name, RantExpressionAction obj) : base(origin) { Name = name; _object = obj; }