Example #1
0
 //Push unar operation to stack
 public override void EnterUnarOp([NotNull] CmanParser.UnarOpContext context)
 {
     if (context.MINUS() != null)
     {
         _nodes.Push(new ASTMinusOpNode(context, _nodes.Peek()));
     }
     if (context.NOT() != null)
     {
         _nodes.Push(new ASTNotOpNode(context, _nodes.Peek()));
     }
 }
Example #2
0
        public override void ExitUnarOp([NotNull] CmanParser.UnarOpContext context)
        {
            IASTUnarOpNode opNode = (IASTUnarOpNode)_nodes.ElementAt(1);

            opNode.Expression = (IASTExprNode)_nodes.Pop();
        }
Example #3
0
 public ASTNotOpNode(CmanParser.UnarOpContext context, ASTNode parent)
     : base(parent)
 {
     SetLocation(context);
 }