Parsing In Python: Tools And Libraries より。 竜 TatSu。Arpeggioと同じく PEG 系。そしてここまでみてきた PEG 系とは明らかに異端、だけれども、初見での第一印象は「最もフレキシブルで完成度も高そう」というもの。 異端: 竜 TatSu (the successor to Grako) is a tool that takes grammars in a variation of EBNF as input, and outputs memoizing (Packrat) PEG parsers in Python. EBNF (の変種?) から PEG パーサを生成する、ということは、「orderd choice」でパーサの振る舞いが変わりうる、ということだと思うが、この差異は脳内変換せよ、ちぅこと? ながーい rational
This week we make the parser generator “self-hosted”, meaning the parser generator generates its own parser. [This is part 7 of my PEG series. See the Series Overview for the rest.] So we have a parser generator, a piece of which is a parser for grammars. We could call this a meta-parser. The meta-parser works similar to the generated parsers: GrammarParser inherits from Parser, and it uses the sa
I’ve alluded to left-recursion as a stumbling block a few times, and it’s time to tackle it. The basic problem is that with a recursive descent parser, left-recursion causes instant death by stack overflow. [This is part 5 of my PEG series. See the Series Overview for the rest.] Consider this hypothetical grammar rule: expr: expr '+' term | termIf we were to naively translate this grammar fragment
Some years ago someone asked whether it would make sense to switch Python to a PEG parser. (Or a PEG grammar; I don’t recall exactly what was said by whom, or when.) I looked into it a bit and wasn’t sure what to think, so I dropped the subject. Recently I’ve learned more about PEG (Parsing Expression Grammars), and I now think it’s an interesting alternative to the home-grown parser generator tha
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く