public override void EnterAssign(EnumParser.AssignContext context)
        {
            ITokenStream tokens = (ITokenStream)parser.InputStream;
            String       args   = tokens.GetText(context.expr());

            builder.AppendLine("\t" + context.ID() + ": " + args + ",");
        }
Exemple #2
0
        public override void EnterAssign(EnumParser.AssignContext context)
        {
            ITokenStream tokens = (ITokenStream)parser.InputStream;
            String       args;

            if (context.expr() != null)
            {
                args = tokens.GetText(context.expr());
            }
            else
            {
                args = currentlyParsingEnum.ParsedEnumIds.Count().ToString();
            }

            string name = Char.ToLowerInvariant(context.ID().ToString()[0]) + context.ID().ToString().Substring(1);

            currentlyParsingEnum.ParsedEnumIds.Add(Int32.Parse(args));
            currentlyParsingEnum.ParsedEnumContent.AppendLine("\t" + name + ": " + args + ",");
        }