Clarified info on peg identifiers authored by Aftab Hussain's avatar Aftab Hussain
...@@ -8,12 +8,13 @@ ...@@ -8,12 +8,13 @@
# <a name="peg-syntax"></a> Peg Syntax # <a name="peg-syntax"></a> Peg Syntax
Nonterminals that can take in values are preceded by an identifier Non-terminals that can take in values are preceded by an identifier
keyword, for example, keyword, for example,
``` ```
unnamed_scope = s:unnamed_scope_special new_chans:ChanInits* ch:Channel_scope* d:Type_Definitions* r:Rpc* Spacing CLOSEC Spacing {{ unnamed_scope = s:unnamed_scope_special new_chans:ChanInits* ch:Channel_scope* d:Type_Definitions* r:Rpc* Spacing CLOSEC Spacing {{
``` ```
These identifer keywords are declared as `Value` variables in the parser that is generated by vembyr, `lcd_idl.cpp`. In this parser, the corresponding values of the nonterminal obtained from the input (the .idl file) is stored in these variables, as shown below These identifier keywords are declared as `Value` variables in the parser, `lcd_idl.cpp`, which is automatically generated by vembyr. In this parser, the corresponding values of the non-terminal obtained from the input (the .idl file) is stored in these `Value` variables. Here is an example of
storing the values obtained from processing the `ChanInits` non-terminal.
``` ```
new_chans = result_peg_3.getValues(); new_chans = result_peg_3.getValues();
``` ```
... ...
......