Beispiel #1
0
        public override InjectionValue VisitAssignment([NotNull] injectionParser.AssignmentContext context)
        {
            var value = Visit(context.expression());

            if (context.lvalue().indexedSymbol() != null)
            {
                var name  = context.lvalue().indexedSymbol().SYMBOL().GetText();
                var index = (int)Visit(context.lvalue().indexedSymbol().expression());

                if (debugger != null)
                {
                    debugger.BeforeVariableAssignment(new IndexedVariableAssignmentContex(context, currentFileName, name, value, index));
                }
                semanticScope.SetDim(name, index, value);
            }
            else
            {
                var name = context.lvalue().SYMBOL().GetText();

                if (debugger != null)
                {
                    debugger.BeforeVariableAssignment(new VariableAssignmentContext(context, currentFileName, name, value));
                }

                semanticScope.SetVar(name, value);
            }

            return(InjectionValue.Unit);
        }