Skip to content

Building the Parser

Mathieu Guindon edited this page Jan 29, 2016 · 5 revisions

When changes are made to the VBA.g4 grammar, the following steps should be taken:

  • Amend the "Change log" section (add a bullet to the "v1.4 Rubberduck" section)
  • Save changes
  • (turn off ReSharper solution-wide analysis)
  • Delete the following generated files under Rubberduck.Parsing.Grammar:
    • VBABaseListener.cs
    • VBABaseVisitor.cs
    • VBALexer.cs
    • VBAListener.cs
    • VBAParser.cs
    • VBAVisitor.cs
  • (toggle 'Show all files' in VS Solution Explorer)
  • Delete the following generated files under Rubberduck.Parsing.obj if they exist:
    • VBABaseListener.cs
    • VBABaseVisitor.cs
    • VBALexer.cs
    • VBAListener.cs
    • VBAParser.cs
    • VBAVisitor.cs
    • VBA.tokens
    • VBALexer.tokens
  • Set 'Build Action' of VBA.g4 grammar file to "Antlr4": this will generate all files that need to be generated
  • Set 'Build Action' of VBA.g4 grammar file back to "None"
  • Copy the following generated files from Rubberduck.Parsing.obj to Rubberduck.Parsing.Grammar:
    • VBABaseListener.cs
    • VBABaseVisitor.cs
    • VBALexer.cs
    • VBAListener.cs
    • VBAParser.cs
    • VBAVisitor.cs
  • (turn ReSharper solution-wide analysis back on)
Clone this wiki locally