問題是,PEGs(解析表達式語法)do not allow left-recursive rules。 我已閱讀有關此主題的可用答案,但具體問題(如this one)或非常簡單(例如x = symbol:(x '.'))。 我創建了以下非常簡單的語法來說明問題 EXAMPLE = x+
x = symbol:(x y*/x y z)
y = symbol:('.' x)
z = symb
我在想如何解析pegjs中的評論(比如la Haskell)。 目標: {-
This is a comment and should parse.
Comments start with {- and end with -}.
If you've noticed, I still included {- and -} in the comment.
Thi
我最近對製作計算機語言很感興趣。 BNF & yacc讓我瘋狂。然後,我看到PEG,和我通過它graceful.I吸引想了解更多關於後援細節是: 1 how does PEG work (algorithm)
2 is there any tools about it on C/C++/Lua
非常thanks.◉-◉