public override object VisitNumberedEnumElem(PParser.NumberedEnumElemContext context) { // name=iden ASSIGN value=IntLiteral var elem = (EnumElem)nodesToDeclarations.Get(context); elem.Value = int.Parse(context.value.Text); return(elem); }
public EnumElem Put(string name, PParser.NumberedEnumElemContext tree) { EnumElem enumElem = new EnumElem(name, tree); CheckConflicts(enumElem, Namespace(enumElems), Namespace(events)); enumElems.Add(name, enumElem); return(enumElem); }
public override object VisitNumberedEnumElem(PParser.NumberedEnumElemContext context) { string symbolName = context.name.GetText(); EnumElem elem = CurrentScope.Put(symbolName, context); nodesToDeclarations.Put(context, elem); return(null); }
public Exception DuplicateEnumValue(PParser.NumberedEnumElemContext location, PEnum pEnum) { return(IssueError(location, $"enum element {location.name.GetText()} in {pEnum.Name} duplicates previous value")); }