public class Grammar extends Object implements Documented, Serializable
Constructor and Description |
---|
Grammar() |
Modifier and Type | Method and Description |
---|---|
void |
addLexer(Lexer lexer)
Adds new lexer to internal repository
|
Set<ParsingContext.AutoCompleteResult> |
autoComplete(AdvancedReader source)
Launches a partial parsing process of a source stream, stopping at the end of the source stream and
returning computed possibilities for the following text.
|
AdditionalGrammarValidator |
getAdditionalValidator() |
String |
getCommentBegin() |
DslDoc |
getDslDoc()
Extra documentation used by doc gen.
|
String |
getId() |
Lexer |
getLexerFromId(String lexerId)
Queries internal lexer repository by unique id.
|
List<Lexer> |
getLexerFromType(Class<?> lexerType,
Set<String> excludedIds,
Set<Class<?>> excludedTypes)
Queries internal lexer repository by lexer returning type (i.e. the parsing result type).
|
String |
getLocale() |
ObjectCreator |
getObjectCreator() |
Object |
parse(AdvancedReader source)
Launches the full parsing process of a source stream.
|
void |
setAdditionalValidator(AdditionalGrammarValidator additionalValidator) |
void |
setCommentBegin(String commentBegin) |
void |
setDslDoc(DslDoc dslDoc)
Extra documentation used by doc gen.
|
void |
setId(String id) |
void |
setLocale(String locale) |
void |
setObjectCreator(ObjectCreator objectCreator) |
void |
validate()
Allows to validate the grammar.
|
void |
validate(AdvancedReader source)
Validates the syntax of the source.
|
public void addLexer(Lexer lexer) throws DslException
DslException
public Lexer getLexerFromId(String lexerId)
public List<Lexer> getLexerFromType(Class<?> lexerType, Set<String> excludedIds, Set<Class<?>> excludedTypes) throws DslException
DslException
public Object parse(AdvancedReader source) throws DslException
DslException
public void validate(AdvancedReader source) throws DslException
DslException
public Set<ParsingContext.AutoCompleteResult> autoComplete(AdvancedReader source) throws DslException
AdvancedReader.setMaxReadLen(int)
can be used to set the autoComplete point in the middle of the text content.DslException
public void validate() throws DslException
DslException
public String getCommentBegin()
public void setCommentBegin(String commentBegin)
public ObjectCreator getObjectCreator()
public void setObjectCreator(ObjectCreator objectCreator)
public AdditionalGrammarValidator getAdditionalValidator()
public void setAdditionalValidator(AdditionalGrammarValidator additionalValidator)
public String getId()
public void setId(String id)
public String getLocale()
public void setLocale(String locale)
public DslDoc getDslDoc()
Documented
getDslDoc
in interface Documented
public void setDslDoc(DslDoc dslDoc)
Documented
setDslDoc
in interface Documented