示例#1
0
文件: Parser.cs 项目: limrzx/Dynamo
	void Imperative_factor(out ProtoCore.AST.ImperativeAST.ImperativeNode node) {
		node = null; 
		if (IsNumber()) {
			Imperative_num(out node);
		} else if (la.kind == 5) {
			Imperative_Char(out node);
		} else if (la.kind == 4) {
			Imperative_String(out node);
		} else if (la.kind == 41) {
			Get();
			node = new ProtoCore.AST.ImperativeAST.BooleanNode(true);
			NodeUtils.SetNodeLocation(node, t); 
			
		} else if (la.kind == 42) {
			Get();
			node = new ProtoCore.AST.ImperativeAST.BooleanNode(false); 
			NodeUtils.SetNodeLocation(node, t); 
			
		} else if (la.kind == 43) {
			Get();
			node = new ProtoCore.AST.ImperativeAST.NullNode(); 
			NodeUtils.SetNodeLocation(node, t); 
			
		} else if (la.kind == 1 || la.kind == 12 || la.kind == 45) {
			Imperative_IdentifierList(out node);
		} else if (la.kind == 14 || la.kind == 15 || la.kind == 63) {
			Imperative_unaryexpr(out node);
		} else SynErr(117);
	}
示例#2
0
 void Imperative_factor(out ProtoCore.AST.ImperativeAST.ImperativeNode node)
 {
     node = null;
     if (IsNumber()) {
     Imperative_num(out node);
     } else if (la.kind == 5) {
     Imperative_Char(out node);
     } else if (la.kind == 4) {
     Imperative_String(out node);
     } else if (la.kind == 40) {
     Get();
     node = new ProtoCore.AST.ImperativeAST.BooleanNode() { value = ProtoCore.DSASM.Literal.True }; NodeUtils.SetNodeLocation(node, t);
     } else if (la.kind == 41) {
     Get();
     node = new ProtoCore.AST.ImperativeAST.BooleanNode() { value = ProtoCore.DSASM.Literal.False }; NodeUtils.SetNodeLocation(node, t);
     } else if (la.kind == 42) {
     Get();
     node = new ProtoCore.AST.ImperativeAST.NullNode(); NodeUtils.SetNodeLocation(node, t);
     } else if (la.kind == 1 || la.kind == 9 || la.kind == 44) {
     Imperative_IdentifierList(out node);
     } else if (StartOf(23)) {
     Imperative_unaryexpr(out node);
     } else SynErr(119);
 }