public interface DdlParser
Modifier and Type | Method and Description |
---|---|
String |
getId()
Get the identifier for this parser.
|
void |
parse(String ddl,
AstNode rootNode,
Object scoreReturnObject)
Parses a DDL string, adding child
AstNode s and properties to the supplied root. |
void |
postProcess(AstNode rootNode)
Allows parsers to post process the
AstNode tree given the supplied root. |
Object |
score(String ddl,
String fileName,
DdlParserScorer scorer)
Determine this parser's score for the given DDL string.
|
Object score(String ddl, String fileName, DdlParserScorer scorer) throws ParsingException
parse(String, AstNode, Object)
method.ddl
- the input string to parse; may not be nullfileName
- the name of the DDL content, which may be used to improve the score; may be null if not knownscorer
- the scorer that should be used to record the score; may not be nullparse(String, AstNode,Object)
methodParsingException
- if there is an error parsing the supplied DDL contentvoid parse(String ddl, AstNode rootNode, Object scoreReturnObject) throws ParsingException
AstNode
s and properties to the supplied root. This method instantiates the
tokenizer, calls a method to allow subclasses to register keywords and statement start phrases with the tokenizer and
finally performs the tokenizing (i.e. tokens.start()) before calling the actual parse method.ddl
- the input string to parse; may not be nullrootNode
- the top level AstNode
; may not be nullscoreReturnObject
- the object returned from score(String, String, DdlParserScorer)
for the same DDL content;
may be null if the score(String, String, DdlParserScorer)
method was not calledParsingException
- if there is an error parsing the supplied DDL contentString getId()
void postProcess(AstNode rootNode)
AstNode
tree given the supplied root. Initial use-case would be to allow a
second pass through the tree to resolve any table references (FK's) that were defined out of order in the DDLrootNode
- the top level AstNode
; may not be nullCopyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.