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); } }
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); }
public override void ExitUnarOp([NotNull] CmanParser.UnarOpContext context) { IASTUnarOpNode opNode = (IASTUnarOpNode)_nodes.ElementAt(1); opNode.Expression = (IASTExprNode)_nodes.Pop(); }