|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--fri.patterns.interpreter.parsergenerator.semantics.TreeBuilderSemantic
A semantic that builds a syntax tree model from a parser run. Every node of the result tree contains the rule and the parsed token list. The result of the parser run can be retrieved by (TreeBuilderSemantic.Node) parser.getResult().
| Nested Class Summary | |
static class |
TreeBuilderSemantic.Node
Node class that representy a syntax tree node. |
| Constructor Summary | |
TreeBuilderSemantic()
|
|
| Method Summary | |
java.lang.Object |
doSemantic(Rule rule,
java.util.List inputTokens,
java.util.List ranges)
Implements Semantic to store every node of the syntax tree with rule and values. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public TreeBuilderSemantic()
| Method Detail |
public java.lang.Object doSemantic(Rule rule,
java.util.List inputTokens,
java.util.List ranges)
doSemantic in interface Semanticrule - 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 | |||||||||