Class EBNFParser
Represents EBNF Parser Generator Object
Defined in: generator03.js.
Constructor Attributes | Constructor Name and Description |
---|---|
EBNFParser(syntax, gapFree, name, ver, ignoreCase)
EBNF Parser Generator Object
|
Field Attributes | Field Name and Description |
---|---|
syntax buffer
|
|
array of gap free id
|
|
true if ignore case
|
|
name of the parser
|
|
syntax buffer pointer
|
|
version of the parser
|
Method Attributes | Method Name and Description |
---|---|
alternative = sequence, {'|', sequence}.
|
|
character = symbol | letter | digit.
|
|
group()
group = '(', alternative, ')'.
|
|
id()
id = letter, {letter | digit}.
|
|
idl()
idl = letter, {letter | digit}.
|
|
letter()
letter = lower | upper.
|
|
option()
option = '[', alternative, ']'.
|
|
primary()
primary = terminal | id | repeat | option | group.
|
|
repeat()
repeat = '{', alternative, '}'.
|
|
rule()
rule = idl, '=', alternative, '.
|
|
run(n, match, parser)
Parser Runner (Generator) for EBNF Syntax
|
|
sequence()
sequence = term, {',', term}.
|
|
symbol()
symbol = '=' | ',' | '.
|
|
syntax()
syntax = rule, {rule}.
|
|
term()
term = primary.
|
|
terminal()
terminal = sq, character, {character}, sq.
|
Class Detail
EBNFParser(syntax, gapFree, name, ver, ignoreCase)
EBNF Parser Generator Object
- Parameters:
- {String} syntax
- syntax object for generate parser
- {Object} gapFree
- array of gap free id
- {String} name
- name of the parser
- {String} ver
- version of the parser
- {Boolean} ignoreCase
- true if ignore case (optional)
- Since:
- 0.2
Field Detail
{String}
buf
syntax buffer
{Object}
gapFree
array of gap free id
{Boolean}
ignoreCase
true if ignore case
{String}
name
name of the parser
{Integer}
ptr
syntax buffer pointer
{String}
ver
version of the parser
Method Detail
{String}
alternative()
alternative = sequence, {'|', sequence}.
- Since:
- 0.2
- Returns:
- {String} code generated if matched, null if not matched
{String}
character()
character = symbol | letter | digit.
- Since:
- 0.2
- Returns:
- {String} code generated if matched, null if not matched
{String}
group()
group = '(', alternative, ')'.
- Since:
- 0.2
- Returns:
- {String} code generated if matched, null if not matched
{String}
id()
id = letter, {letter | digit}.
- Since:
- 0.2
- Returns:
- {String} code generated if matched, null if not matched
{String}
idl()
idl = letter, {letter | digit}.
- Since:
- 0.2
- Returns:
- {String} code generated if matched, null if not matched
{String}
letter()
letter = lower | upper.
- Since:
- 0.2
- Returns:
- {String} code generated if matched, null if not matched
{String}
option()
option = '[', alternative, ']'.
- Since:
- 0.2
- Returns:
- {String} code generated if matched, null if not matched
{String}
primary()
primary = terminal | id | repeat | option | group.
- Since:
- 0.2
- Returns:
- {String} code generated if matched, null if not matched
{String}
repeat()
repeat = '{', alternative, '}'.
- Since:
- 0.2
- Returns:
- {String} code generated if matched, null if not matched
{String}
rule()
rule = idl, '=', alternative, '.'.
- Since:
- 0.2
- Returns:
- {String} code generated if matched, null if not matched
{String}
run(n, match, parser)
Parser Runner (Generator) for EBNF Syntax
- Parameters:
- {String} n
- number of match
- {Object} match
- array of parsed result
- {String} parser
- caller method name
- Since:
- 0.2
- Returns:
- {String} generated code
{String}
sequence()
sequence = term, {',', term}.
- Since:
- 0.2
- Returns:
- {String} code generated if matched, null if not matched
{String}
symbol()
symbol = '=' | ',' | '.' | '|' | '+' | '-' | '*' | '/' |
'[' | ']' | '{' | '}' | '(' | ')'.
- Since:
- 0.3
- Returns:
- {String} code generated if matched, null if not matched
{String}
syntax()
syntax = rule, {rule}.
- Since:
- 0.2
- Returns:
- {String} code generated if matched, null if not matched
{String}
term()
term = primary.
- Since:
- 0.2
- Returns:
- {String} code generated if matched, null if not matched
{String}
terminal()
terminal = sq, character, {character}, sq.
- Since:
- 0.2
- Returns:
- {String} code generated if matched, null if not matched