fr.umlv.tatoo.runtime.tools.builder
Class Builder.ParserBuilder<T,N,P,V>

java.lang.Object
  extended by fr.umlv.tatoo.runtime.tools.builder.Builder.ParserBuilder<T,N,P,V>
Type Parameters:
T - type of terminals.
N - type of non terminals.
P - type of productions.
V - type of versions.
Enclosing class:
Builder

public static class Builder.ParserBuilder<T,N,P,V>
extends Object

A parser builder able to configure the version of the grammar and the start non terminal that will be used by the parser.


Method Summary
 Parser<T,N,P,V> create()
          Create a new parser.
 Builder.ExpertParserBuilder<T,N,P,V> expert()
          Returns a parser builder in expert mode.
 Builder.ParserBuilder<T,N,P,V> start(N start)
          Set the start non terminal.
 Builder.ParserBuilder<T,N,P,V> trace()
          Trace all calls to the parser listener.
 Builder.ParserBuilder<T,N,P,V> version(V version)
          Set the grammar version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

start

public Builder.ParserBuilder<T,N,P,V> start(N start)
Set the start non terminal. The parser will try to recognized the grammar starting from this non terminal.

Parameters:
start - a start non terminal.
Returns:
this parser builder.

version

public Builder.ParserBuilder<T,N,P,V> version(V version)
Set the grammar version. The parser will use this version of the grammar.

Parameters:
version - a grammar version.
Returns:
this parser builder.

trace

public Builder.ParserBuilder<T,N,P,V> trace()
Trace all calls to the parser listener. This method is for debugging purpose only.

Returns:
this parser builder.

expert

public Builder.ExpertParserBuilder<T,N,P,V> expert()
Returns a parser builder in expert mode.

Returns:
a parser builder in expert mode.

create

public Parser<T,N,P,V> create()
Create a new parser. If no version is set, the default version is used. If no start non terminal is set, default start non terminal is used. If no lookaheadMap is defined, the default lookahead map is used.

Returns:
a new parser.