Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

[FEATURE REQUEST] Ability to run the TestRig from within the IDE #140

Open
xoxota99 opened this issue Mar 24, 2016 · 4 comments
Open

[FEATURE REQUEST] Ability to run the TestRig from within the IDE #140

xoxota99 opened this issue Mar 24, 2016 · 4 comments

Comments

@xoxota99
Copy link

It would be useful to be able to run the ANTLR4 testrig on an arbitrary input file from within the IDE.

@arifogel
Copy link
Member

arifogel commented Nov 6, 2016

What is your proposed workflow for this? Please be more specific.

@sithys
Copy link

sithys commented Nov 8, 2016

In general, an actual pre-existing workflow would have been nice getting into using this IDE. Right now my workflow is a bit silly. I made a console app in another program that asks for the name of the .g4 file and then generates 1) The .g4 file with a simple grammar that builds, 2) an input file with some text that can be parsed by the grammar, and 3) a java class that sets up the lexer and parser and runs the input through them both.

I don't make a new project every time I want to make a new grammar, and I am following along with the examples in The Definitive ANTLR 4 Reference and all of my grammars and tests and input are all just dumped into the same project.

I'm very new to this, and it took a long time (~8 hours) to set up the IDE. When I say "set up the IDE" I do so within the context of these goals:

  1. Rapid Iteration Time: I should be able to follow the examples in the book with minimal effort interacting with the IDE. The IDE should get out of the way, and be effortless.

  2. Per-Example Files: Every example in the book should have it's own .g4 file, it's own input, and it's own test rig, at if not the latter, then the option to run the ANTLR test rig with a single click, as the OP suggested. This is so that when I complete an example, I don't have to delete the code I just wrote to start the next example. I have git, but I don't want to go to a previous commit to see an example I worked on in the past.

  3. Single Project: I should not have to make a new project every time I want to make a new grammar. So far the IDE meets this requirement, and any solution should not impact this requirement.

I have a proposed workflow: Imagine a new tab (ANTLR TestRig) that appears on the right of the workspace in Eclipse, for example with the Task List or Outline tab. The tab would be divided in half horizontally. In the top section there would be ANTLR test rig options in the form of check boxes and/or radio buttons. There would also be a "Run" button in this section. The bottom half would be divided vertically. The bottom left quadrant would contain a list of all the grammars which were built successfully. The list only supports single selection, and multi-select is disabled. When you click a grammar, a second list appears in the bottom right quadrant with a list of rules. You select a rule from that list, which is also single-select only.

You click to select an input file from the project tree on the right side of your workspace in Eclipse. Then you click the run button in the aforementioned tab (ANTLR TestRig) to run that input file against the selected grammar/rule. If multiple input files are selected, then they will all be run against the test rig with the same settings, one after another. Output will be sent to the console as normal.

@HSorensen
Copy link
Member

@sithys Regarding your points

  1. Once configured antlr4ide works in the background
  2. If you want to create those sample grammars that would be a good start. We can look at new feature creating a sample wizards that could import/add those to a project.
  3. I have multiple grammars in the same project.

For the TestRig I'll check if the ParseTree view wasn't supposed to handle this.

@sithys
Copy link

sithys commented Dec 2, 2016

The parse tree is a bit clunky because you can't type in the textbox (the textbox loses focus on grammar errors)

Also, the way that you need to put the cursor on a rule in a grammar file is very clunky. The parse tree view should be self-contained.

Also, I don't want to have to copy the text from an input file into the parse tree text box. It's just an extra step.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants