2 ms·
> - add expressions, proper infix support for arithmetic I'd suggest ignoring precedence rules completely here. It generally simplifies the grammar and parser
by klibertp 12y ago
> - add expressions, proper infix support for arithmetic
I'd suggest ignoring precedence rules completely here. It generally simplifies the grammar and parser considerably. It doesn't make the language unworkable, either, as long as you allow for grouping with parentheses - Smalltalk does this and it work rather well.
I'd also try working with libraries like PyParsing first before attempting to use mammoth size parser generators. In my experience, especially for simple grammars, this way you can be done with parsing stage with minimum effort and concentrate on the "features" side.
- mrcsparker 12y agoI should have mentioned that precedence rules are pretty wacky. I wish that in the languages I have worked on that I could just ignore precedence and use parens, but operator precedence is expected.