CampagneLaboratory / ANTLR_MPS

An ANTLR language for MPS, and the ToMPS language to help create MPS languages and ANTRL visitors from an ANTLR 4 grammar.
Other
25 stars 8 forks source link

ANTLR_HOME path variable must be defined to import grammar #2

Open fac2003 opened 8 years ago

fac2003 commented 8 years ago

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)