Пример #1
0
 public static void BuildUnaryOperator(IronyParser parser, Root root, Expression parentExpression, ParseTreeNode currentNode)
 {
     var op = new UnaryOperator(parentExpression, currentNode.Token.Convert());
     parentExpression.ChildExpressions.Add(op);
     switch(currentNode.ChildNodes[0].FindTokenAndGetText())
     {
         case "!":
             op.OperatorType = UnaryOperatorType.Not;
             break;
         case "-":
             op.OperatorType = UnaryOperatorType.Negate;
             break;
     }
     parser.ConsumeParseTree(root, op, currentNode.ChildNodes[1]);
 }
Пример #2
0
 // CodeDOM doesn't support unary operators??
 public static CodeExpression Emit(UnaryOperator op)
 {
     // var opType = new Code
     return null;
 }