예제 #1
0
 private void CheckUnarOp(IASTUnarOpNode unarOpNode)
 {
     if (unarOpNode is ASTIndexOpNode indexOp)
     {
         CheckIndexOp(indexOp);
     }
     if (unarOpNode is ASTNotOpNode notOp)
     {
         CheckNotOp(notOp);
     }
     if (unarOpNode is ASTMinusOpNode minusOp)
     {
         CheckMinusOp(minusOp);
     }
 }
예제 #2
0
 private static Type GetUnarOpType(IASTUnarOpNode unarOp)
 {
     if (unarOp is ASTIndexOpNode)
     {
         return(typeof(object));
     }
     if (unarOp is ASTMinusOpNode)
     {
         return(typeof(decimal));
     }
     if (unarOp is ASTNotOpNode)
     {
         return(typeof(bool));
     }
     return(null);
 }
예제 #3
0
        public override void ExitUnarOp([NotNull] CmanParser.UnarOpContext context)
        {
            IASTUnarOpNode opNode = (IASTUnarOpNode)_nodes.ElementAt(1);

            opNode.Expression = (IASTExprNode)_nodes.Pop();
        }