parser.rb |
|
---|---|
EBNF Parser for ABNF.Produces an Abstract Synatx Tree in S-Expression form for the input grammar file |
|
Regular expressions for both "Core" and ABNF-specific terminals. |
|
Hash of generated {EBNF::Rule} objects by symbol @return [Hash{Symbol => EBNF::Rule}] |
|
The following ABNF grammar rules are treated as terminals. |
|
|
|
|
|
|
|
|
|
Interpret segments in binary creating a sequence of hex characters or a string |
|
Interpret as a range |
|
Interpret as a single HEX character |
|
|
|
Interpret segments in decimal creating a sequence of hex characters or a string |
|
Interpret as a range |
|
Interpret as a single HEX character |
|
|
|
Interpret segments in hexadecimal creating a sequence of hex characters or a string |
|
Interpret as a range |
|
Interpret as a single HEX character |
|
|
|
|
|
|
|
Non-terminal productions |
|
The |
|
|
|
value contains an expression. Invoke callback |
|
append to rule alternate |
|
append alternatives to rule |
|
add elements as last alternative |
|
There shouldn't be an existing rule |
|
|
|
|
|
The |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Only need to use case-insensitive if there are alphabetic characters in the string. |
|
|
|
|
|
Parser invocation.On start, yield ourselves if a block is given, otherwise, return this parser instance @param [#read, #to_s] input @param [Hash{Symbol => Object}] options @option options [Boolean] :level Trace level. 0(debug), 1(info), 2(warn), 3(error). @return [EBNFParser] |
|
If the |
|
Read input, if necessary, which will be used in a Scanner. |
|
Parses into |
|
The AST includes the parsed rules along with built-in rules for ABNF used within the parsed grammar. @return [ArrayEBNF::Rule] |
|
Add built-in rules for standard ABNF rules not |
|
Output formatted S-Expression of grammar @return [String] |
|
Output rules as a formatted S-Expression |
|
Generate a combination of seq and string to represent a sequence of characters @param [Array |
|
Either return the sequence, or a string |
|