Beispiel #1
0
        public UstNode VisitExpressionStatement(DslParser.ExpressionStatementContext context)
        {
            Statement result;
            var       expression = (Expression)VisitExpression(context.expression());

            if (!PatternExpressionInsideStatement)
            {
                result = new ExpressionStatement(expression, context.GetTextSpan(), null);
                if (context.PatternNot() != null)
                {
                    result = new PatternStatement(result, true);
                }
            }
            else
            {
                result = new PatternExpressionInsideStatement(expression, context.PatternNot() != null);
            }
            return(result);
        }
Beispiel #2
0
        public PatternUst VisitExpressionStatement(DslParser.ExpressionStatementContext context)
        {
            PatternUst result = VisitExpression(context.expression());

            if (!PatternExpressionInsideStatement)
            {
                if (context.PatternNot() != null)
                {
                    result = new PatternNot(result);
                }
            }
            else
            {
                result = new PatternArbitraryDepth(result, context.GetTextSpan());
                if (context.PatternNot() != null)
                {
                    result = new PatternNot(result);
                }
            }
            return(result);
        }