Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ANTLR_HOME path variable must be defined to import grammar #2

Open
fac2003 opened this issue Feb 23, 2016 · 0 comments
Open

ANTLR_HOME path variable must be defined to import grammar #2

fac2003 opened this issue Feb 23, 2016 · 0 comments

Comments

@fac2003
Copy link
Member

fac2003 commented Feb 23, 2016

When the variable is not defined and you try to import a grammar fragment, you may see:

FileNotFoundException: Unable to paste : ${ANTLR_HOME}\tree.ps (The system cannot find the path specified)

A work-around is to define the path variable in MPS to point to some directory where you want the postcript file (tree.ps) to be written. You could set it to an empty directory and it should work. In the future we should make this writing optional (i.e., not try to write the file when the variable is not defined), it is really there only to help you see what the parse tree looks like for the source fragment you imported. Try opening directory/tree.ps after you import an ANTLR fragment to see the tree.

Unable to paste : ${ANTLR_HOME}\tree.ps (The system cannot find the path specified)
java.io.FileNotFoundException: ${ANTLR_HOME}\tree.ps (The system cannot find the path specified)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.(FileOutputStream.java:213)
at java.io.FileOutputStream.(FileOutputStream.java:101)
at java.io.FileWriter.(FileWriter.java:63)
at org.antlr.v4.runtime.tree.Trees.writePS(Trees.java:70)
at org.antlr.v4.runtime.tree.Trees.writePS(Trees.java:83)
at org.antlr.v4.runtime.RuleContext.save(RuleContext.java:187)
at org.antlr.v4.runtime.RuleContext.save(RuleContext.java:171)
at org.campagnelab.antlr.parsers.AntlrPaster.saveTreeAsPostScript(AntlrPaster.java:157)
at org.campagnelab.antlr.parsers.AntlrPaster.pasteGrammarAsNodes(AntlrPaster.java:93)
at org.campagnelab.antlr.parsers.AntlrPaster.pasteRules(AntlrPaster.java:46)
at org.campagnelab.antlr.plugin.plugin.PasteAsAntlrRules_Action.doExecute(PasteAsAntlrRules_Action.java:90)

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

No branches or pull requests

1 participant