public VB6CodeModelFactoryContext(VBBaseModule rootModule, VBBaseCodeModel parentCodeBlock, ParserRuleContext context, VBScope scope) { RootModule = rootModule; ParentCodeBlock = parentCodeBlock; ParserContext = context; Scope = scope; }
internal VBBaseModule(VisualBasic6Lexer vb6Lexer, VisualBasic6Parser vb6Parser, CommonTokenStream commonTokenStream, ParserRuleContext context) : base(context) { VB6Lexer = vb6Lexer; VB6Parser = vb6Parser; VB6CommonTokenStream = commonTokenStream; Scope = new VBScope(null, this, VBProgramScope.Module); ConversionMessageList = new ReadOnlyCollection <ConversionMessageBase>(_conversionMessageList); }
internal VBScope(VBScope parentScope, VBBaseCodeModel codeModel, VBProgramScope level) { ParentScope = parentScope; CodeModel = codeModel; ScopeLevel = level; ChildScopes = new ReadOnlyCollection <VBScope>(_childs); if (parentScope != null) { parentScope.AddChildScope(this); } }
/* * ifElseBlockStmt * : ELSE NEWLINE + (block NEWLINE +)? * */ internal VBIfElseBlockStmt(VB6CodeModelFactoryContext factoryContext) : base(factoryContext) { Scope = new VBScope(factoryContext.Scope, this, VBProgramScope.Block); }
/* * propertySetStmt * : (visibility WS)? (STATIC WS)? PROPERTY_SET WS ambiguousIdentifier (WS? argList)? NEWLINE + (block NEWLINE +)? END_PROPERTY * */ internal VBPropertySetStmt(VB6CodeModelFactoryContext factoryContext) : base(factoryContext) { Scope = new VBScope(factoryContext.Scope, this, VBProgramScope.Procedure); }
/* * ifThenElseStmt * : IF WS ifConditionStmt WS THEN WS blockStmt (WS ELSE WS blockStmt)? # inlineIfThenElse * | ifBlockStmt ifElseIfBlockStmt* ifElseBlockStmt? END_IF # blockIfThenElse * * Note: * - Grammar file do not support multiple statements inside If/Else being joined by COLON : (Only one statement is allowed) * */ internal VBInlineIfThenElse(VB6CodeModelFactoryContext factoryContext) : base(factoryContext) { Scope = new VBScope(factoryContext.Scope, this, VBProgramScope.Block); }
/* * macroIfBlockStmt * : MACRO_IF WS ifConditionStmt WS THEN NEWLINE + (moduleBody NEWLINE +)? * * ifConditionStmt * : valueStmt * * Note: * - Refer: https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa262671(v=vs.60) * - If condition is much simpler. Can only use other conditional compiler constants, literal and operators. Therefore, can be copied as it is for now. */ internal VBMacroIfBlockStmt(VB6CodeModelFactoryContext factoryContext) : base(factoryContext) { Scope = new VBScope(factoryContext.Scope, this, VBProgramScope.MacroBlock); }
internal void AddChildScope(VBScope childScope) { _childs.Add(childScope); }