public override object VisitPTypeDef(PParser.PTypeDefContext context) { string symbolName = context.name.GetText(); TypeDef typeDef = CurrentScope.Put(symbolName, context); nodesToDeclarations.Put(context, typeDef); return(null); }
public override object VisitPTypeDef(PParser.PTypeDefContext context) { // TYPE name=iden var typedef = (TypeDef)nodesToDeclarations.Get(context); // ASSIGN type typedef.Type = ResolveType(context.type()); // SEMI return(typedef); }
public TypeDef Put(string name, PParser.PTypeDefContext tree) { TypeDef typedef = new TypeDef(name, tree); CheckConflicts(typedef, Namespace(typedefs), Namespace(enums), Namespace(interfaces), Namespace(machines)); typedefs.Add(name, typedef); return(typedef); }