Exemplo n.º 1
0
	void Imperative_Attribute(out ProtoCore.AST.ImperativeAST.ImperativeNode node) {
		ProtoCore.AST.ImperativeAST.FunctionCallNode f = new ProtoCore.AST.ImperativeAST.FunctionCallNode(); 
		Imperative_Ident(out node);
		NodeUtils.SetNodeStartLocation(f, t); 
		f.FormalArguments = new List<ProtoCore.AST.ImperativeAST.ImperativeNode>(); 
		if (la.kind == 12) {
			Get();
			ProtoCore.AST.ImperativeAST.ImperativeNode argNode; 
			Imperative_expr(out argNode);
			f.FormalArguments.Add(argNode); 
			while (la.kind == 52) {
				Get();
				Imperative_expr(out argNode);
				f.FormalArguments.Add(argNode); 
			}
			Expect(13);
		}
		ProtoCore.AST.ImperativeAST.FunctionCallNode funcNode = new ProtoCore.AST.ImperativeAST.FunctionCallNode(); 
		f.Function = node;
		NodeUtils.SetNodeEndLocation(f, t);
		node = f; 
		
	}
Exemplo n.º 2
0
	void Imperative_functioncall(out ProtoCore.AST.ImperativeAST.ImperativeNode node) {
		Expect(1);
		ProtoCore.AST.ImperativeAST.IdentifierNode function = new ProtoCore.AST.ImperativeAST.IdentifierNode() { Value = t.val, Name = t.val }; 
		NodeUtils.SetNodeLocation(function, t); 
		List<ProtoCore.AST.ImperativeAST.ImperativeNode> arglist = new List<ProtoCore.AST.ImperativeAST.ImperativeNode>(); 
		Expect(12);
		if (StartOf(4)) {
			ProtoCore.AST.ImperativeAST.ImperativeNode argNode; 
			Imperative_expr(out argNode);
			arglist.Add(argNode); 
			while (la.kind == 52) {
				Get();
				Imperative_expr(out argNode);
				arglist.Add(argNode); 
			}
		}
		Expect(13);
		ProtoCore.AST.ImperativeAST.FunctionCallNode funcNode = new ProtoCore.AST.ImperativeAST.FunctionCallNode(); 
		funcNode.Function = function;
		funcNode.FormalArguments = arglist;
		NodeUtils.SetNodeStartLocation(funcNode, function);
		NodeUtils.SetNodeEndLocation(funcNode, t);
		node = funcNode; 
		
	}