You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can not get the SDK CompilationTask to work properly to generate an in memory parser for the MathExp.gram example. I keep getting: ParseErrors { errors: [UnexpectedToken(ParseErrorUnexpectedToken { position: TextPosition { line: 1, column: 1 }, length: 1, value: "1", terminal: Symbol { id: 7, name: "NUMBER" }, expected: [Symbol { id: 17, name: "-" }] })] }
when I tried to use the in memory parser to parse a simple "1 + 2" input. Part of my code to get the in memory parser is below:
let data = l.grammars[0].build(Some(ParsingMethod::LR1), 0);
//println!("{:?}", data);
match data {
Ok(d) => {
match output::build_in_memory_grammar(&l.grammars[0], &d) {
Ok(parser) => {
let res = parser.parse("1 + 2");
println!("{:?}", res.errors);
print(res.get_ast().get_root(), &[]);
What should I do to get this work?
The text was updated successfully, but these errors were encountered:
I can not get the SDK CompilationTask to work properly to generate an in memory parser for the MathExp.gram example. I keep getting: ParseErrors { errors: [UnexpectedToken(ParseErrorUnexpectedToken { position: TextPosition { line: 1, column: 1 }, length: 1, value: "1", terminal: Symbol { id: 7, name: "NUMBER" }, expected: [Symbol { id: 17, name: "-" }] })] }
when I tried to use the in memory parser to parse a simple "1 + 2" input. Part of my code to get the in memory parser is below:
What should I do to get this work?
The text was updated successfully, but these errors were encountered: