java.lang.Object
simula.compiler.syntaxClass.SyntaxClass
simula.compiler.syntaxClass.statement.Statement
simula.compiler.syntaxClass.statement.ConditionalStatement
Conditional Statement.
Simula Standard: 4.2 Conditional statement conditional-statement = if-clause { Label : } for-statement | if-clause { Label : } unconditional-statement [ ELSE statement ] if-clause = IF boolean-expression THENLink to GitHub: Source File.
- Author:
- SIMULA Standards Group, Øystein Myhre Andersen
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Expression
The if-clause conditionprivate final Statement
The else-statementprivate final Statement
The then-statementFields inherited from class simula.compiler.syntaxClass.SyntaxClass
lineNumber
-
Constructor Summary
-
Method Summary
Methods inherited from class simula.compiler.syntaxClass.statement.Statement
expectStatement
Methods inherited from class simula.compiler.syntaxClass.SyntaxClass
ASSERT_SEMANTICS_CHECKED, doDeclarationCoding, edIndent, edTreeIndent, IS_SEMANTICS_CHECKED, SET_SEMANTICS_CHECKED, toJavaCode
-
Field Details
-
condition
The if-clause condition -
thenStatement
The then-statement -
elseStatement
The else-statement
-
-
Constructor Details
-
ConditionalStatement
ConditionalStatement(int line) Create a new ConditionalStatement.- Parameters:
line
- the source line number
-
-
Method Details
-
print
public void print(int indent) Description copied from class:SyntaxClass
Utility print method.- Overrides:
print
in classSyntaxClass
- Parameters:
indent
- number of spaces leading the line
-
doChecking
public void doChecking()Description copied from class:SyntaxClass
Perform semantic checking.This must be redefined in every subclass.
- Overrides:
doChecking
in classSyntaxClass
-
doJavaCoding
public void doJavaCoding()Description copied from class:SyntaxClass
Output Java code.- Overrides:
doJavaCoding
in classStatement
-
printTree
public void printTree(int indent) Description copied from class:SyntaxClass
Utility print syntax tree method.- Overrides:
printTree
in classSyntaxClass
- Parameters:
indent
- number of spaces leading the lines
-
toString
-