Esempio n. 1
0
	void Imperative_RangeExpr(out ProtoCore.AST.ImperativeAST.ImperativeNode node) {
		Imperative_rel(out node);
		if (la.kind == 24) {
			ProtoCore.AST.ImperativeAST.RangeExprNode rnode = new ProtoCore.AST.ImperativeAST.RangeExprNode(); 
			rnode.From = node;
			NodeUtils.SetNodeStartLocation(rnode, rnode.From);
			bool hasAmountOperator = false;
			
			Get();
			if (la.kind == 64) {
				Imperative_rangeAmountOperator(out hasAmountOperator);
			}
			rnode.HasRangeAmountOperator = hasAmountOperator; 
			Imperative_rel(out node);
			rnode.To = node;
			NodeUtils.SetNodeEndLocation(rnode, rnode.To);
			
			if (la.kind == 24) {
				RangeStepOperator op; 
				Get();
				Imperative_rangeStepOperator(out op);
				rnode.StepOperator = op; 
				Imperative_rel(out node);
				rnode.Step = node;
				NodeUtils.SetNodeEndLocation(rnode, rnode.Step);
				
			}
			node = rnode; 
		}
	}
Esempio n. 2
0
        void Imperative_RangeExpr(out ProtoCore.AST.ImperativeAST.ImperativeNode node)
        {
            Imperative_rel(out node);
            if (la.kind == 21) {
            ProtoCore.AST.ImperativeAST.RangeExprNode rnode = new ProtoCore.AST.ImperativeAST.RangeExprNode();
            rnode.FromNode = node;
            NodeUtils.SetNodeStartLocation(rnode, rnode.FromNode);

            Get();
            Imperative_rel(out node);
            rnode.ToNode = node;
            NodeUtils.SetNodeEndLocation(rnode, rnode.ToNode);

            if (la.kind == 21) {
                RangeStepOperator op;
                Get();
                Imperative_rangeStepOperator(out op);
                rnode.stepoperator = op;
                Imperative_rel(out node);
                rnode.StepNode = node;
                NodeUtils.SetNodeEndLocation(rnode, rnode.StepNode);

            }
            node = rnode;
            }
        }