public abstract class AbstractCommandAnalyzer extends AbstractAnalyzer<Command> implements CommandAnalyzer
Constructor and Description |
---|
AbstractCommandAnalyzer() |
Modifier and Type | Method and Description |
---|---|
protected Expression |
analyzeExpression() |
protected ExpressionList |
analyzeExpressionList() |
protected LeftValueList |
analyzeLeftValueList() |
protected LeftValue |
analyzeSimpleLeftValue() |
protected LeftValueList |
analyzeSimpleLeftValueList() |
protected void |
assertKeyWord(String keyword)
Ensures that the appropriate keyword is on the line.
|
protected void |
consumeEndOfLine()
Checks that there are no extra characters on a program line when the line
analyzer thinks that it has finished analyzing the line.
|
protected static boolean |
equal(LeftValue a,
LeftValue b)
Check that the left values are simple (no modifiers, a.k.a.
|
Factory |
getFactory() |
protected abstract String |
getName() |
protected boolean |
isKeyWord(String keyword) |
protected void |
pushNode(NestedStructure node) |
void |
setFactory(Factory factory)
When a factory creates an instance of a class implementing this interface
this method is called to register the factory that created the instance.
|
public Factory getFactory()
getFactory
in class AbstractAnalyzer<Command>
public void setFactory(Factory factory)
FactoryManaged
setFactory
in interface FactoryManaged
factory
- the factory that manages the instance.protected abstract String getName()
protected static boolean equal(LeftValue a, LeftValue b)
a
- variable oneb
- variable twotrue
if the variables have the same name and none of them
has modifiers (array access or field access)protected LeftValueList analyzeLeftValueList() throws AnalysisException
AnalysisException
protected LeftValueList analyzeSimpleLeftValueList() throws AnalysisException
AnalysisException
protected LeftValue analyzeSimpleLeftValue() throws AnalysisException
AnalysisException
protected Expression analyzeExpression() throws AnalysisException
AnalysisException
protected ExpressionList analyzeExpressionList() throws AnalysisException
AnalysisException
protected void pushNode(NestedStructure node)
protected void assertKeyWord(String keyword) throws AnalysisException
keyword
- the keyword that has to be present on the lineAnalysisException
- when the next lexeme is NOT the expected keyword.protected boolean isKeyWord(String keyword) throws AnalysisException
AnalysisException
protected void consumeEndOfLine() throws AnalysisException
AnalysisException
- when there are extra character on the actual lineCopyright © 2013 Verhas and Verhas Software Craftsmen. All Rights Reserved.