示例#1
0
        public String strName;    //字符串值

        private AstNode(ASTNODE_TYPE op, AstNode leftLeaf, AstNode rightLeaf, int intValue, String strName, bool bValue = false)
        {
            this.op        = op;
            this.leftLeaf  = leftLeaf;
            this.rightLeaf = rightLeaf;
            this.intValue  = intValue;
            this.strName   = strName;
            this.bValue    = bValue;
        }
示例#2
0
 // Make a unary AST node: only one child
 public static AstNode mkastunary(ASTNODE_TYPE op, AstNode left, int intvalue)
 {
     return(mkNode(op, left, null, intvalue, ""));
 }
示例#3
0
 public static AstNode mkastleaf(ASTNODE_TYPE op, bool bValue)
 {
     return(mkNode(op, null, null, 0, "", bValue));
 }
示例#4
0
 public static AstNode mkastleaf(ASTNODE_TYPE op, String strName)
 {
     return(mkNode(op, null, null, 0, strName));
 }
示例#5
0
        // Make an AST leaf node

        public static AstNode mkastleaf(ASTNODE_TYPE op, int intvalue)
        {
            return(mkNode(op, null, null, intvalue, ""));
        }
示例#6
0
 public static AstNode mkNodeRight(ASTNODE_TYPE in_op, AstNode in_right, int intValue)
 {
     return(new AstNode(in_op, null, in_right, intValue, ""));
 }
示例#7
0
 public static AstNode mkNodeLeft(ASTNODE_TYPE in_op, AstNode in_left, int intValue)
 {
     return(new AstNode(in_op, in_left, null, intValue, ""));
 }
示例#8
0
 public static AstNode mkNodewithNoLeaf(ASTNODE_TYPE in_op)
 {
     return(new AstNode(in_op, null, null, 0, ""));
 }
示例#9
0
 public static AstNode mkNode(ASTNODE_TYPE in_op, AstNode leftLeaf, AstNode rightLeaf, int intValue, String strName, bool bValue = false)
 {
     return(new AstNode(in_op, leftLeaf, rightLeaf, intValue, strName, bValue));
 }