|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--fri.patterns.interpreter.parsergenerator.syntax.builder.SyntaxBuilderSemantic
A syntax specification similar to EBNF. This semantic is used to build a Parser with Lexer from a textual EBNF syntax specification.
The semantics of ".." is the description of the set between leading and trailing character. The leading must be the one with the lower UNICODE value.
The semantics of "-" is intersection. When specifiying chars - comment - stringdef this means all chars but not comments or stringdef, i.e. stringdef is not subtracted from comment but from chars!
TODO: think over repeat number symbol: parser AND lexer would need this. Better define this by written symbols like "a ::= b b b b;"? But what to do on hundred "b"?
Field Summary | |
static java.lang.String[][] |
syntax
|
Constructor Summary | |
SyntaxBuilderSemantic()
Creates a syntax builder semantic that resolves parenthesis and quantifiers. |
|
SyntaxBuilderSemantic(java.util.List initialNonterminals)
Creates a syntax builder semantic that resolves parenthesis and quantifiers. |
Method Summary | |
java.lang.Object |
doSemantic(Rule rule,
java.util.List inputTokens,
java.util.List ranges)
Called by every REDUCE step. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static java.lang.String[][] syntax
Constructor Detail |
public SyntaxBuilderSemantic()
public SyntaxBuilderSemantic(java.util.List initialNonterminals)
Method Detail |
public java.lang.Object doSemantic(Rule rule, java.util.List inputTokens, java.util.List ranges)
Semantic
doSemantic
in interface Semantic
rule
- Rule that was "reduced" (recognized).inputTokens
- all semantic call returns from underlying rules, collected according to current rule,
that means you get a List of Objects as long as the count of symbols on the right side of the rule,
every Object is a return of an underlying doSemantic() call.ranges
- all line ranges for parseResults elements. Cast elements to Token.Range
to get the start and end position of every Object in parseResult List.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |