public class GrammarBoss extends Boss
Modifier and Type | Field and Description |
---|---|
protected boolean |
allStatementsParsedSuccessfully |
protected Grammar |
grammar |
protected boolean |
grammarAmbiguityParm |
protected boolean |
grammarInitialized |
protected java.lang.Class<? extends GrammaticalParser> |
parserPrototype |
protected boolean |
statementAmbiguityParm |
batchFramework, runParm
Constructor and Description |
---|
GrammarBoss(BatchFramework batchFramework)
Constructor with BatchFramework for access to environment.
|
Modifier and Type | Method and Description |
---|---|
void |
doInitializeGrammar()
Executes the InitializeGrammar command, prints any messages, etc.
|
void |
doParse()
Executes the Parse command, prints any messages, etc.
|
protected void |
editGrammarAmbiguityEdits()
Validate Grammar Ambiguity Edits Runparm.
|
void |
editParser()
Set the grammar parser by class name.
|
protected void |
editStatementAmbiguityEdits()
Validate Statement Ambiguity Edits Runparm.
|
boolean |
getAllStatementsParsedSuccessfully()
Returns true if all statements parsed successfully.
|
Grammar |
getGrammar()
Fetch a Grammar object, building it if necessary from previously input
RunParms.
|
boolean |
getGrammarInitialized()
Returns true if Grammar initialized successfully.
|
protected void |
initializeGrammar()
An initializeGrammar subroutine.
|
accumException, addContext, buildBufferedFileReader, buildBufferedFileWriter, buildPrintWriter, doRunParmCommand, error, error, error, get, getBoolean, getBoolean, getColor, getEnum, getExistingFile, getExistingFile, getExistingFolder, getExistingFolder, getFileCharset, getFileName, getFileNameSuffix, getFileUsage, getInt, getNonBlank, getNonnegInt, getOnOff, getPosInt, getPrintableNoBlanksString, getPrintWriter, getSelectorCount, getSelectorTheorem, getStmt, getTheorem, getYesNo, opt, parseInt, putCommand, putCommand, require
protected Grammar grammar
protected boolean grammarInitialized
protected boolean allStatementsParsedSuccessfully
protected boolean grammarAmbiguityParm
protected boolean statementAmbiguityParm
protected java.lang.Class<? extends GrammaticalParser> parserPrototype
public GrammarBoss(BatchFramework batchFramework)
batchFramework
- for access to environment.public boolean getGrammarInitialized()
public boolean getAllStatementsParsedSuccessfully()
public Grammar getGrammar()
NOTE: The returned Grammar is "ready to go" but may not have been "initialized", which means grammar validation, etc. The reason that grammar is not initialized here is that a previous attempt to "initialize" may have failed due to grammar errors, so to re-do it here would result in doubled-up error messages. The Initialize Grammar RunParm Command should be used prior to PrintSyntaxDetails if a "load and print syntax" is desired.
public void editParser()
public void doInitializeGrammar()
public void doParse()
protected void initializeGrammar()
protected void editGrammarAmbiguityEdits()
protected void editStatementAmbiguityEdits()