I am relatively new in field of Compilers and ANTLR.
I would like to try build PHP target with ANTLR4. I have cloned repo with:
```
git clone https://github.com/antlr/antlr4.git
```
Then I installed maven and run:
```
mvn -N install
```
After that I run:
```
mvn -Duser.name="Your Name" -DskipTests=true install
```
as described here: http://www.antlr.org/wiki/display/ANTLR4/Building+ANTLR+4+with+Maven
I get the antlr4-runtime-4.0.1-SNAPSHOT.jar file, but when I try to run the following command:
``
java -cp .;antlr4-runtime-4.0.1-SNAPSHOT.jar org.antlr.v4.Tool
```
from the antlr4\runtime\Java\target> directory I get the following error:
```
Error: Could not find or load main class org.antlr.v4.Tool
```
I have no idea what is wrong? Can you give me some advice so I be able to fix it?
Thanks ;)
Thanks Kevin for suggestion, I have tried both cases - ; and : and they don't work for some reason...
May be I don't have the org.antlr.v4.Tool class in the generated .jar and I need to compile the antlr4-4.x-complete.jar file somehow... Because the following command is working:
```
java org.antlr.v4.runtime.misc.TestRig
```
Could you describe a sequence of commands to compile the antlr4-4.x-complete.jar file?
Parser(parser, funcs, atn, sempredFuncs, superClass) ::= <<
<Parser_(ctor="parser_ctor", ...)>
>>
Parser_(parser, funcs, atn, sempredFuncs, ctor, superClass) ::= <<
@TODO: Parser
>>
DefaultParserSuperClass(s) ::= "BaseParser"
LexerFile(lexerFile, lexer, namedActions) ::= <<
<fileHeader(file.grammarFileName, file.ANTLRVersion)>
>>
DefaultLexerSuperClass(s) ::= "BaseLexer"
Lexer(lexer, atn, actionFuncs, sempredFuncs, superClass) ::= <<
@TODO: Lexer
>>
fileHeader(grammarFileName, ANTLRVersion) ::= <<
\<?php
/**
* Automatically generated with ANTLR <ANTLRVersion>.
*/
namespace My\Ns;
>>
// ...
```
After running of antlr I get Parser.java with the '@TODO Parser' string, but Lexer.java contains Java code for some reason, however I expect that it will contain the '@TODO: Lexer' string.
It seems like the Lexer related lines are ignored in the string template file.
Could describe what is wrong or what should be done to fix this problem and generate Lexer with @TODO string?