-
Notifications
You must be signed in to change notification settings - Fork 48
Some questions about the structure of rules #85
Comments
Hi :-), Thanks for the relevant questions. 1. What is the difference between
|
1.
Hmm, I did not think about this situation, thank you! 2.
Should I create a separate issue for this task? 3.
I meant that in the end it is not very important whether the rule is a group or a separate rule:
Therefore, information about the fact that the rule
Rule names do not matter what they are, strings or numbers, then all these places can be made numeric, which should quite speed up this case and reduce memory consumption. Right. However, there is one problem, trace items (Entry and Ekzit) are directed precisely by the names of the rules: To this I do not think that the implementation:
Will be faster and less in memory consumption, rather than:
|
Please yes! I'm cleaning up the
It is needed for tools that manipulate the grammar, so when analyzing language. This is not useful at runtime though.
It feels true. The original name can be kept in an attribute (and I think it is already the case). So +1 for this! Are you willing to try a PR for that too? |
Judging by the construction algorithm - it is still required to build a correct AST. I figured it out, so I'm taking off the question.
I can not implement this part. Attempts to get rid of identifiers (replacing them with numeric indexes) resulted in my fork to multiple bugs. While I think about it =\ |
@SerafimArts do you have any remaining open questions, or has everything been answered now? Please close the ticket. |
$nodeId
and$defaultId
in grammar rules?$nodeId
in tokens?Those. we can have completely numeric indexes in the rules array, and whether or not the rule in the AST will be determined by the presence of the name in the "Entry" element of the trace. That some order should speed up the initialization and fetching (optimizing arrays for numeric indexes php7+)
The text was updated successfully, but these errors were encountered: