public override void VisitExpressionUnaryPostfix(ExpressionUnaryPostfix node, CloningAstVisitorContext context)
 {
     context.Result = new ExpressionUnaryPostfix()
     {
         Operator = node.Operator,
         Left     = this.CloneNode(node.Left, context)
     };
 }
        public override AstNode VisitPostfix_expression([NotNull] GLSL_ES300Parser.Postfix_expressionContext context)
        {
            if (context.Increment() != null || context.Decrement() != null)
            {
                var rUnary = new ExpressionUnaryPostfix();
                if (context.Increment() != null)
                {
                    rUnary.Operator = Operator.Increment;
                }
                else
                {
                    rUnary.Operator = Operator.Decrement;
                }

                rUnary.Left = (Expression)this.Visit(context.postfix_expression());
                return(rUnary);
            }

            var field = context.field_selection();

            if (field != null)
            {
                return(new ExpressionFieldSelection()
                {
                    Name = new Identifier()
                    {
                        Name = field.Identifier().Symbol.Text
                    },
                    Left = (Expression)this.Visit(context.postfix_expression())
                });
            }

            var func = context.function_call_generic();

            if (func != null)
            {
                var rFunc = this.VisitFunctionCall(func);
                if (context.postfix_expression() != null)
                {
                    rFunc.Left = (Expression)this.Visit(context.postfix_expression());
                }

                return(rFunc);
            }

            var intExpr = context.integer_expression();

            if (intExpr != null)
            {
                return(new ExpressionIndexAccess()
                {
                    Left = (Expression)this.Visit(context.postfix_expression()),
                    Index = (Expression)this.Visit(context.integer_expression())
                });
            }

            return(this.Visit(context.primary_expression()));
        }
 public virtual void VisitExpressionUnaryPostfix(ExpressionUnaryPostfix node, TContext context)
 {
     this.Visit(node.Left, context);
 }
 public override void VisitExpressionUnaryPostfix(ExpressionUnaryPostfix node, AstPrinterContext context)
 {
     this.Visit(node.Left, context);
     context.Write(this.GetOperatorString(node.Operator));
 }