예제 #1
0
        public VBAPreprocessorVisitor(
            SymbolTable <string, IValue> symbolTable,
            VBAPredefinedCompilationConstants predefinedConstants,
            ICharStream stream,
            CommonTokenStream tokenStream)
        {
            if (stream == null)
            {
                throw new ArgumentNullException(nameof(stream));
            }
            if (tokenStream == null)
            {
                throw new ArgumentNullException(nameof(tokenStream));
            }
            if (symbolTable == null)
            {
                throw new ArgumentNullException(nameof(symbolTable));
            }
            if (predefinedConstants == null)
            {
                throw new ArgumentNullException(nameof(predefinedConstants));
            }

            _stream      = stream;
            _tokenStream = tokenStream;
            _symbolTable = symbolTable;
            AddPredefinedConstantsToSymbolTable(predefinedConstants);
        }
 private void AddPredefinedConstantsToSymbolTable(VBAPredefinedCompilationConstants predefinedConstants)
 {
     foreach (var constant in predefinedConstants.AllPredefinedConstants)
     {
         _symbolTable.AddOrUpdate(constant.Key, new DecimalValue(constant.Value));
     }
 }
예제 #3
0
 private void AddPredefinedConstantsToSymbolTable(VBAPredefinedCompilationConstants predefinedConstants)
 {
     _symbolTable.Add(VBAPredefinedCompilationConstants.VBA6_NAME, new BoolValue(predefinedConstants.VBA6));
     _symbolTable.Add(VBAPredefinedCompilationConstants.VBA7_NAME, new BoolValue(predefinedConstants.VBA7));
     _symbolTable.Add(VBAPredefinedCompilationConstants.WIN64_NAME, new BoolValue(predefinedConstants.Win64));
     _symbolTable.Add(VBAPredefinedCompilationConstants.WIN32_NAME, new BoolValue(predefinedConstants.Win32));
     _symbolTable.Add(VBAPredefinedCompilationConstants.WIN16_NAME, new BoolValue(predefinedConstants.Win16));
     _symbolTable.Add(VBAPredefinedCompilationConstants.MAC_NAME, new BoolValue(predefinedConstants.Mac));
 }
예제 #4
0
 public CompilationArgumentsProvider(ITypeLibWrapperProvider typeLibWrapperProvider, IUiDispatcher uiDispatcher, VBAPredefinedCompilationConstants predefinedConstants)
 {
     _typeLibWrapperProvider        = typeLibWrapperProvider;
     _uiDispatcher                  = uiDispatcher;
     PredefinedCompilationConstants = predefinedConstants;
 }