Closed jonathan-shahen closed 2 years ago
I am willing to contribute to this project.
Just need to know if this a bug/problem, and where I can go about adding either an escape-character (\$
) or use another symbol %
for referencing attributes.
Hi @jonathan-shahen, it's not related to the PHP Runtime itself but the parser generator. It should be fixed there, more specifically here.
Hey @jonathan-shahen, is there any question left? May I close this issue?
Here is an example use case (limited depth of nested expressions):
You can ignore the Semantic Predicate, because we cannot even declar the member variable due to the
$
being used. The error message is:attribute references not allowed in lexer actions: $depth
.If we replace ~$depth = 0;
with
depth = 0;, then it compiles the php class, but the member variable is malformed (php variables require the
$`).Is there a work around here to get this to work?
I found a work around for referencing variables in actions (
$parser->var
==>$this->var
), which is not the best work around but I will leave that for a separate ticket.ANTLR Version: 4.9.2 Runtime: 0.5.1 (had to downgrade to get working, see https://github.com/antlr/antlr-php-runtime/issues/19)
Any help would be appreciated :)