/// <summary> /// Define struct scope and symbol /// </summary> /// <param name="context"></param> public override void EnterStruct_definition([NotNull] Struct_definitionContext context) { var structIdentityContext = context.identifier(); StructSymbol structSymbol = new StructSymbol(structIdentityContext.GetText()); structSymbol.SetEnclosingScope(currentScope); structSymbol.DefNode = structIdentityContext; structIdentityContext.Symbol = structSymbol; structIdentityContext.Scope = structSymbol; Define(structSymbol); linker[currentFileAnalysis].Add(structSymbol); currentScope = structSymbol; }
public override void ExitStruct_definition([NotNull] Struct_definitionContext context) { currentScope = currentScope.GetEnclosingScope(); }