Class IXMLGrammar
java.lang.Object
org.libxmq.imp.ixml.IXMLGrammar
Grammar reader ported from ixml.c; independent of the YAEP backend.
The rules and terms are public for the Earley parser in the earley package.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA rule, name = alternatives.static final classA term: a call of a rule (ref), a character set (chars), an insertion or a not. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe code point after the last unicode code point, used for end of input.final Map<String, IXMLGrammar.Rule> The rules, in grammar order, followed by the generated rules /1, /2, ...The name of the start rule, the first rule of the grammar. -
Method Summary
Modifier and TypeMethodDescriptionstatic IXMLGrammarRead a grammar using the parse_ixml_* productions from the C reader.static Stringquote(int cp) A code point as written in an ixml grammar: 'a', "'" for the single quote, or #a for a control character or space, like the C version.source()The grammar source.
-
Field Details
-
EOF
public static final int EOFThe code point after the last unicode code point, used for end of input.- See Also:
-
rules
The rules, in grammar order, followed by the generated rules /1, /2, ... -
start
The name of the start rule, the first rule of the grammar.
-
-
Method Details
-
source
-
quote
A code point as written in an ixml grammar: 'a', "'" for the single quote, or #a for a control character or space, like the C version.- Parameters:
cp- the code point- Returns:
- the text
-
parse
Read a grammar using the parse_ixml_* productions from the C reader.- Parameters:
source- iXML source- Returns:
- normalized grammar
-