Re: moving from classical lex/yacc to pegged parser

2024-05-10 Thread Dukc via Digitalmars-d-learn
Dmitry Ponyatov kirjoitti 9.5.2024 klo 11.30: > And I also can't figure out how to inherit `ParseTree` with all my script language objects to get AST right from pegged parser. Should I use some superloop with lot of matches to process parsed `pt` tree into something I need myself, to drop all

moving from classical lex/yacc to pegged parser

2024-05-09 Thread Dmitry Ponyatov via Digitalmars-d-learn
Using lex/yacc I can do a more or less complex things in .yacc semantic actions, such complex as bytecode compilation or real CPU assembly. Playing with `pegged`, I can't figure out how to move from `ParseTree` to such like semantic actions. I even can't parse numbers from strings in