DSL-Style state class for easy generation of ImpLan code. Functions of this class can be called iteratively to produce ImpLan step by step.
Value parameters
- blockState
-
Stack keeping track of unclosed ifs/try-catchs
- condStack
-
Stack of conditions of if blocks which are not closed yet
- elseCatchStack
-
Stack of statements in Else/Catch blocks which are not closed yet
- ifTryStack
-
Stack of statements in If/Try blocks which are not closed yet
- stmts
-
Sequence of already generated statements
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
Value members
Concrete methods
Add assignment to the code
Add assignment to the code
Value parameters
- default
-
The default value the variable has until the assignment . Must match the default value from other assignments to this variable. Optional.
- lhs
-
The left hand side of the assignment
- rhs
-
The right hand side of the assignment
- typ
-
The type of the assigned identifier. Must match the type from other assignments to this variable.
Attributes
- Returns
-
IntermediateCodeUtils representing the new state
Add assignment to the code
Add assignment to the code
Value parameters
- default
-
The default value the variable has until the assignment . Must match the default value from other assignments to this variable.
- lhs
-
The left hand side of the assignment
- rhs
-
The right hand side of the assignment
- typ
-
The type of the assigned identifier. Must match the type from other assignments to this variable.
Attributes
- Returns
-
IntermediateCodeUtils representing the new state
Add assignment to the code
Add assignment to the code
Value parameters
- default
-
The default value the variable has until the assignment . Must match the default value from other assignments to this variable. Optional.
- glob
-
Whether the variable must be declared in the global space.
- lhs
-
The left hand side of the assignment
- rhs
-
The right hand side of the assignment
- typ
-
The type of the assigned identifier. Must match the type from other assignments to this variable.
Attributes
- Returns
-
IntermediateCodeUtils representing the new state
Closes the innermost try and starts its catch block. In the scope of the catch block a variable var_err exists which holds the thrown error. Fails if there was no previous unclosed try block.
Closes the innermost try and starts its catch block. In the scope of the catch block a variable var_err exists which holds the thrown error. Fails if there was no previous unclosed try block.
Attributes
- Returns
-
IntermediateCodeUtils representing the new state
Closes the innermost if and starts its else block. Fails if there was no previous unclosed if block.
Closes the innermost if and starts its else block. Fails if there was no previous unclosed if block.
Attributes
- Returns
-
IntermediateCodeUtils representing the new state
Closes the innermost if. Fails if there is none.
Closes the innermost if. Fails if there is none.
Attributes
- Returns
-
IntermediateCodeUtils representing the new state
Closes the innermost try. Fails if there is none.
Closes the innermost try. Fails if there is none.
Attributes
- Returns
-
IntermediateCodeUtils representing the new state
Add a final assignment to the code. May be called twice for the same lhs but only with exactly the same params.
Add a final assignment to the code. May be called twice for the same lhs but only with exactly the same params.
Value parameters
- lazyDef
-
Flag indicating if the variable is of type lazy
- lhs
-
The left hand side of the assignment
- typ
-
The type of the assigned identifier.
- value
-
The value the variable has. Optional.
Attributes
- Returns
-
IntermediateCodeUtils representing the new state
Add a final assignment to the code. May be called twice for the same lhs but only with exactly the same params.
Add a final assignment to the code. May be called twice for the same lhs but only with exactly the same params.
Value parameters
- lazyDef
-
Flag indicating if the variable is of type lazy
- lhs
-
The left hand side of the assignment
- typ
-
The type of the assigned identifier.
- value
-
The value the variable has. Optional. Note: Only in rare cases it makes sense to have a final assignment without value.
Attributes
- Returns
-
IntermediateCodeUtils representing the new state
Add a function call to the generated code.
Add a function call to the generated code.
Value parameters
- name
-
The name of the function to be called
- params
-
The param expressions of the call
- typeHint
-
The type of the called function
Attributes
- Returns
-
IntermediateCodeUtils representing the new state
Adds an If statement to the code. Has to be closed with EndIf. Further generated statements are added inside the if.
Adds an If statement to the code. Has to be closed with EndIf. Further generated statements are added inside the if.
Value parameters
- cond
-
The Ifs condition in DNF
Attributes
- Returns
-
IntermediateCodeUtils representing the new state
Add a lambda call to the generated code.
Add a lambda call to the generated code.
Value parameters
- exp
-
The expression to be called
- params
-
The param expressions of the call
Attributes
- Returns
-
IntermediateCodeUtils representing the new state
Adds a Try statement to the code. Has to be followed by Catch and closed with EndTry. Further generated statements are added inside the try.
Adds a Try statement to the code. Has to be followed by Catch and closed with EndTry. Further generated statements are added inside the try.
Attributes
- Returns
-
IntermediateCodeUtils representing the new state
Returns current statements. Checks if all if/trys are closed.
Returns current statements. Checks if all if/trys are closed.
Attributes
- Returns
-
Sequence of statements from the current state