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

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