Пример #1
0
 public VB6CodeModelFactoryContext(VBBaseModule rootModule, VBBaseCodeModel parentCodeBlock, ParserRuleContext context, VBScope scope)
 {
     RootModule      = rootModule;
     ParentCodeBlock = parentCodeBlock;
     ParserContext   = context;
     Scope           = scope;
 }
Пример #2
0
 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);
 }
Пример #3
0
        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);
            }
        }
Пример #4
0
        /*
         * ifElseBlockStmt
         * : ELSE NEWLINE + (block NEWLINE +)?
         *
         */

        internal VBIfElseBlockStmt(VB6CodeModelFactoryContext factoryContext) : base(factoryContext)
        {
            Scope = new VBScope(factoryContext.Scope, this, VBProgramScope.Block);
        }
Пример #5
0
        /*
         * 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);
        }
Пример #6
0
        /*
         * 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);
        }
Пример #7
0
        /*
         * 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);
        }
Пример #8
0
 internal void AddChildScope(VBScope childScope)
 {
     _childs.Add(childScope);
 }