public class Bnf extends Object
| Constructor and Description |
|---|
Bnf() |
| Modifier and Type | Method and Description |
|---|---|
static Bnf |
getInstance(Reader csv)
Create an instance using the grammar specified in the CSV file.
|
HashMap<String,String> |
getNextTokenList(String query)
Get the list of tokens that can follow.
|
RuleHead |
getRuleHead(String title)
Get the rule head for the given title.
|
static String |
getRuleMapKey(String token)
Convert convert ruleLink to rule_link.
|
ArrayList<RuleHead> |
getStatements()
Get the list of possible statements.
|
static StringTokenizer |
getTokenizer(String s)
Get the tokenizer for the given syntax.
|
void |
linkStatements()
Cross-link all statements with each other.
|
void |
updateTopic(String topic,
DbContextRule rule)
Update a topic with a context specific rule.
|
void |
visit(BnfVisitor visitor,
String s)
Parse the syntax and let the rule call the visitor.
|
public static Bnf getInstance(Reader csv) throws SQLException, IOException
csv - if not specified, the help.csv is usedSQLExceptionIOExceptionpublic void visit(BnfVisitor visitor, String s)
visitor - the visitors - the syntax to parsepublic static String getRuleMapKey(String token)
token - the tokenpublic RuleHead getRuleHead(String title)
title - the titlepublic HashMap<String,String> getNextTokenList(String query)
key: 1#SELECT, value: ELECT key: 1#SET, value: ET
query - the start of the statementpublic void linkStatements()
public void updateTopic(String topic, DbContextRule rule)
topic - the topicrule - the database context rulepublic ArrayList<RuleHead> getStatements()
public static StringTokenizer getTokenizer(String s)
s - the syntaxCopyright © 2012 JBoss by Red Hat. All Rights Reserved.