Package org.qdl_lang.statements
Class WhileLoop
- java.lang.Object
-
- org.qdl_lang.statements.WhileLoop
-
- All Implemented Interfaces:
Serializable,Statement
public class WhileLoop extends Object implements Statement
Created by Jeff Gaynor
on 1/17/20 at 4:44 PM- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WhileLoop()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ObjectdoBasicWhile(State localState)protected ObjectdoForLoop(State localState)protected ObjectdoPostLoop(State localState)QDLValueevaluate(State state)protected ObjectforKeysOrValuesLoop(State localState, boolean doKeys)for_keys(var, stem.) -- Loop over the keys in a given stem, assigning each to the var.ExpressionNodegetConditional()List<String>getSourceCode()List<Statement>getStatements()TokenPositiongetTokenPosition()booleanhasTokenPosition()voidsetConditional(ExpressionNode conditional)voidsetSourceCode(List<String> sourceCode)voidsetStatements(List<Statement> statements)voidsetTokenPosition(TokenPosition tokenPosition)Set the location of this token from the parser.
-
-
-
Method Detail
-
setTokenPosition
public void setTokenPosition(TokenPosition tokenPosition)
Description copied from interface:StatementSet the location of this token from the parser. This is used for error notifications later.- Specified by:
setTokenPositionin interfaceStatement
-
getTokenPosition
public TokenPosition getTokenPosition()
- Specified by:
getTokenPositionin interfaceStatement
-
hasTokenPosition
public boolean hasTokenPosition()
- Specified by:
hasTokenPositionin interfaceStatement
-
getConditional
public ExpressionNode getConditional()
-
setConditional
public void setConditional(ExpressionNode conditional)
-
forKeysOrValuesLoop
protected Object forKeysOrValuesLoop(State localState, boolean doKeys)
for_keys(var, stem.) -- Loop over the keys in a given stem, assigning each to the var.- Parameters:
localState-- Returns:
-
getSourceCode
public List<String> getSourceCode()
- Specified by:
getSourceCodein interfaceStatement
-
setSourceCode
public void setSourceCode(List<String> sourceCode)
- Specified by:
setSourceCodein interfaceStatement
-
-