예제 #1
0
        private string SimpleExpressionPart(SimpleExpressionPartNode node)
        {
            string output = "";

            output += Term(node.term);
            switch (node.addop)
            {
            case "+":
                output += "add\n";
                break;

            case "-":
                output += "sub\n";
                break;

            case "or":
                output += "or\n";
                break;
            }
            if (node.part != null)
            {
                output += SimpleExpressionPart(node.part);
            }
            return(output);
        }
예제 #2
0
        public SimpleExpressionPartNode SimpleExpressionPart()
        {
            var simpleExpressionPart = new SimpleExpressionPartNode();

            Match(TokenTypes.ADDOP);
            simpleExpressionPart.addop = returnToken.value;
            simpleExpressionPart.term  = Term();
            if (token.type == TokenTypes.ADDOP)
            {
                simpleExpressionPart.part = SimpleExpressionPart();
            }

            return(simpleExpressionPart);
        }
예제 #3
0
 public SimpleExpressionPartNode()
 {
     part = null;
 }
예제 #4
0
 public SimpleExpressionNode()
 {
     part = null;
     sign = "";
 }