|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.umlv.tatoo.runtime.tools.ToolsProcessor<R,B,T,N,P>
R - type of rules.B - type of buffer.T - type of terminals.N - type of non terminals.P - type of productions.public class ToolsProcessor<R,B extends LexerBuffer,T,N,P>
Glue between lexer and parser.
How lexer's rules are transformed to parser's terminal
is described by ToolsTable.
A mini-tools processor is created using the factory method
createProcessor(ToolsListener).
This processor called a unique listener ToolsListener
for both lexer events and parser events.
This processor is itself a ParserListener
and createLexerListener(SimpleParser, ToolsTable) is able to create
a LexerListener that submit its rules transformed to terminal to
a parser.
| Method Summary | ||
|---|---|---|
void |
accept(N nonTerminal)
Notifies that the accept action is performed by the parser on the start non terminaL. |
|
LexerListener<R,B> |
createLexerListener(SimpleParser<? super T> parser,
ToolsTable<? super R,? extends T> table)
Create a ToolsProcessor.LexerHandler
from a ToolsTable and a parser. |
|
static
|
createProcessor(ToolsListener<? super R,? super B,? super T,? super N,? super P> listener)
Creates a new processor that acts as a parser listener and is able to create a lexer listener and
a lifecycle handler. |
|
void |
reduce(P production)
Notifies that a reduce action is performed by the parser. |
|
void |
shift(T terminal)
Notifies that a shift action is performed by the parser. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <R,B extends LexerBuffer,T,N,P> ToolsProcessor<R,B,T,N,P> createProcessor(ToolsListener<? super R,? super B,? super T,? super N,? super P> listener)
lexer listener and
a lifecycle handler.
R - type of rulesB - type of buffer.T - type of terminals.N - type of non terminalsP - type of productions.listener - a listener that will be called each time
a rule is not send as a terminal,
a shift/reduce is performed,
the grammar is accepted.
public LexerListener<R,B> createLexerListener(SimpleParser<? super T> parser,
ToolsTable<? super R,? extends T> table)
ToolsProcessor.LexerHandler
from a ToolsTable and a parser.
parser - a parser.table - a tools table.
public void shift(T terminal)
ParserListener
shift in interface ParserListener<T,N,P>terminal - shifted terminal.public void reduce(P production)
ParserListener
reduce in interface ParserListener<T,N,P>production - reduced production.public void accept(N nonTerminal)
ParserListener
accept in interface ParserListener<T,N,P>nonTerminal - accepted non terminal.Parser.getStartNonTerminal()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||