Re:PEG.js - parser generator for JavaScript
by euroclydon on Wednesday March 17, 2010 @12:16PM
(#1198904)
Thanks, what I don't get from reading the grammar is how, as you say, multiplicative is either a primary or primary followed by a multiplicative. Clearly I understand that it needs to be defined this way, but is that either part just inherit to PEG or this implementation or what, b/c I don't get it form the syntax?
[ Parent
| on HN ]
Re:PEG.js - parser generator for JavaScript
by mbrubeck on Wednesday March 17, 2010 @02:47PM
(#1199325)
The "/" at the start of the second line is a choice operator. For example, this is how you would define a term a that can match either b or c:
a: b / c
(The asterisks in my post were escaped because they were in a code block, or because there were not two of them in the same line.)