I tried to generate cpp lexer from https://github.com/antlr/grammars-v4/blob/master/cpp/pom.xml, but have a error like:
error: expected {, found throw
I think the problem is throw because rust not using throw new like java or C# for error handling.
--> src\cpp\cpp14parser.rs:23478:64
|
23478 | .val { it.get_text() } else { "null" } .compareTo("0")!=0) throw new InputMismatchException(this);
| ^^^^^ expected {
|
note: the if expression is missing a block after this condition
--> src\cpp\cpp14parser.rs:23477:6
|
23477 | if(if let Some(it) = &(cast::<_,PureSpecifierContext >(&*_localctx))
| ^
23478 | | .val { it.get_text() } else { "null" } .compareTo("0")!=0) throw new InputMismatchException(this);
| |________________________________________________________^
help: try placing this code inside a block
|
23478 | .val { it.get_text() } else { "null" } .compareTo("0")!=0) { throw } new InputMismatchException(this);
| + +
I tried to generate cpp lexer from https://github.com/antlr/grammars-v4/blob/master/cpp/pom.xml, but have a error like:
error: expected
{, foundthrowI think the problem is
throwbecause rust not usingthrow newlike java or C# for error handling.23478 | .val { it.get_text() } else { "null" } .compareTo("0")!=0) throw new InputMismatchException(this);
| ^^^^^ expected
{|
note: the
ifexpression is missing a block after this condition--> src\cpp\cpp14parser.rs:23477:6
|
23477 | if(if let Some(it) = &(cast::<_,PureSpecifierContext >(&*_localctx))
| ^
23478 | | .val { it.get_text() } else { "null" } .compareTo("0")!=0) throw new InputMismatchException(this);
| |________________________________________________________^
help: try placing this code inside a block
|
23478 | .val { it.get_text() } else { "null" } .compareTo("0")!=0) { throw } new InputMismatchException(this);
| + +