Beispiel #1
0
        public override void ExitFormalParameterDecl([NotNull] SBP.FormalParameterDeclContext context)
        {
            var type = this.PopType("ExitFormalParameterDecl");
            var name = context.GetChild(context.children.Count - 1).GetText();

            m_procedureParameters.Add(new ParameterData(m_parameterModifiers, name, type.Item1, typeToken: type.Item2));
            m_parameterModifiers = null;
        }
        public override void ExitFormalParameterDecl([NotNull] SBP.FormalParameterDeclContext context)
        {
            string        name      = context.GetChild(context.ChildCount - 1).GetText();
            TypeReference type      = m_typeStack.Pop();
            var           modifiers = (m_modifiers != null) ? m_modifiers.Split(' ') : new string[] { };

            System.Diagnostics.Debug.Assert(type != null);
            var typeToken = ((ParserRuleContext)context.children[context.ChildCount - 2]).Start;

            m_parameters.Add(new ParameterData(modifiers, name, type.Type.Name, type, typeToken));
            m_expressionData.PopStackLevel();
        }
 public override void EnterFormalParameterDecl([NotNull] SBP.FormalParameterDeclContext context)
 {
     m_expressionData.PushStackLevel("Parameter");
     //m_parameters = new List<Tuple<Type, string>>();     // If not used from the formalParameters rule.
 }