Beispiel #1
0
		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;
		}
Beispiel #3
0
		public REAIfStatement(Stringe token, RantExpressionAction expr, RantExpressionAction body, RantExpressionAction elseBody = null)
			: base(token)
		{
			_expression = expr;
			_body = body;
            _elseBody = elseBody;
		}
Beispiel #4
0
        public REAWhile(Stringe token, RantExpressionAction test, RantExpressionAction body)
            : base(token)
        {
            _test = test;
            _body = body;

            Breakable = true;
        }
Beispiel #5
0
 public REAFor(
     Stringe token,
     string indexName,
     RantExpressionAction body,
     RantExpressionAction expr)
     : base(token)
 {
     _expr = expr;
     _body = body;
     _indexName = indexName;
 }
Beispiel #6
0
		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;
		}
Beispiel #7
0
		public REAReturn(Stringe origin, RantExpressionAction value)
			: base(origin)
		{
			_returnValue = value;
		}
Beispiel #8
0
		public REAObjectKeyValue(Stringe token, RantExpressionAction value)
			: base(token)
		{
			Name = Util.UnescapeConstantLiteral(token.Value);
			Value = value;
		}
Beispiel #9
0
		public REAObjectProperty(Stringe origin, RantExpressionAction name, RantExpressionAction obj)
			: base(origin)
		{
			Name = name;
			_object = obj;
		}