-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EBNF unable to get at sub-expression #254
Comments
I also have this issue. function_call:
IDENTIFIER '(' ')'
|IDENTIFIER '(' param ')'
;
param:
expression
|param ',' expression
; Is there any other solution? |
Exactly the same problem with
translates to:
|
@brianZeng Thank you for the idea of solution. I used the same approach:
|
…write process so there'll always a risk of edge cases which won't fly exactly as intended, not due to the rewrite process, which in itself is fine, but because of ACTION mapping from EBNF rule with action block to rewritten ruleset: we do not/cannot validate the action code *perfectly* so userland action code *can* screw up when it tries hard enough. TODO: at least *some* validation of the action code to ensure that subnames, subrefs, etc. are not used in the action block as those will be *nuked* by the rewrite process!
…ms); all test pass again after rebuilding the compiler. TODO: cleanup the bnf.y file and remove the debug print code. - tests have been inspected and corrected where necessary now that we propagate the *quoted* literals rather than the *unquoted* literals (which made `' '` literal whitespace tokens *disappear* when used in a grammar that way - This work is related to zaach#254
…istakes in relation to EBNF usage (related to zaach#254, completing the work done on that one) - tightened and unified the regexes for named aliases in ACTION blocks: now only classic C variable names are accepted, i.e. `/[a-zA-Z_][a-zA-Z0-9_]*/`
…ork on zaach#254. Now this stuff should be documented... Not at 3AM though.
After some work on the EBNF stuff lately, I added a bit of docu in the wiki that might be useful, if only sideways today (as EBNF in latest jison is a tad skewered, while I must say that my own fork isn't super-duper either. Here's the docs: https://github.com/zaach/jison/wiki/Deviations-From-Flex-Bison#extended-bnf The |
👍 Thanl you! |
Consider this grammar part:
This code executes the "exception" log statement. In this case, $5 can be undefined due to the asterisk-operator. However, I cannot test for this, because the $5 is translated by JISON into an array subscript. Am I doing something wrong or does JISON maybe need a way to discover whether $x is present?
The text was updated successfully, but these errors were encountered: