For using parsing capabilities in php extensions a conversion of grammar and parsing is needed.
Therefore enable php conversion and check the current output.
WIP.
Problem:
- the functions defined in the initializer code section of parser.pegs are not translated to php, the php based parser crashes when using such a function.
- the content of parsing expressions in each rule are also not translated to php.
Possible solutions:
- Convert the action blocks and the initializing section to php
- Insert the information obtained in a new parser pegjs (in comments and initial code?!)
- Use phpeggy or wikipeg for generating php based peg grammar
- Automation of this solution steps:
- action blocks are always in curly brackets { }, mostly one line
- converters:
- js2php https://github.com/sstur/js2php doesn't convert ast.js
- https://wtools.io/javascript-to-php-converter doesn't convert ast.js or selected functions