public final class SwitchStatement extends Statement implements ISwitchStatement
switch-statement
switch (<expression>) { [switch-cases] [switch-default] }
switch-cases
<switch-case>
<switch-cases> <switch-case>
switch-case
case <expression> : [statement-list]
switch-default
default : [statement-list]
IGosuParser| Modifier and Type | Field and Description |
|---|---|
protected CaseClause[] |
_cases |
protected List<Statement> |
_defaultStatements |
protected Expression |
_switchExpression |
VOID_RETURN_VALUE_tokens, UNDEF_FILE, UNDEF_FUNCTION, UNDEF_MODULE| Constructor and Description |
|---|
SwitchStatement() |
| Modifier and Type | Method and Description |
|---|---|
Object |
execute()
Execute the switch statement
|
CaseClause[] |
getCases() |
List<Statement> |
getDefaultStatements() |
protected ITerminalStatement |
getLeastSignificantTerminalStatement_internal(boolean[] bAbsolute)
bAbsolute is true iff there are no break terminals anywhere in any cases and
the default clause's terminator is non-break and absolute
|
Expression |
getSwitchExpression() |
boolean |
isCoveredEnumSwitch() |
void |
setCases(CaseClause[] cases) |
void |
setDefaultStatements(List<Statement> defaultStatements) |
void |
setSwitchExpression(Expression switchExpression) |
String |
toString()
Subclasses should return a String representing the parsed statement.
|
execute, getExcludedReturnTypeElements, getLeastSignificant, getLeastSignificantTerminalStatement, getReturnType, hasContent, isNoOp, setParentaddExceptionsFrom, addParseException, addParseException, addParseException, addParseExceptions, addParseIssues, addParseWarning, addParseWarning, addParseWarnings, addToken, adjustColumn, adjustLineNum, assignTokens, clearParseExceptions, clearParseTreeInformation, clearParseWarnings, compactParseTree, findAncestorParsedElementByType, findDeclaringStatement, findLineNumberOfDeclaration, findRootParsedElement, getAnnotations, getColumn, getContainedParsedElementsByType, getContainedParsedElementsByTypes, getContainedParsedElementsByTypesWithIgnoreSet, getEnclosingFeatureInfo, getFunctionName, getGosuClass, getGosuProgram, getImmediateParseIssue, getImmediateParseIssues, getLineNum, getLocation, getModule, getParent, getParseExceptions, getParseIssues, getParseWarnings, getQualifyingEnclosingTypeInfo, getTokens, hasImmediateParseIssue, hasImmediateParseWarning, hasImmediateParseWarnings, hasParseException, hasParseExceptions, hasParseIssue, hasParseIssues, hasParseWarning, hasParseWarnings, initEmptyParseTree, initLocation, isCompileTimeConstant, isSuppressed, isSuppressed, isSynthetic, makeDoubleValue, makeFloatValue, makeInteger, makeLong, removeParseException, removeParseWarning, removeParseWarningRecursively, setGosuProgram, setLineNum, setLocation, setSynthetic, shouldClearParseInfoclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitexecute, getLeastSignificantTerminalStatement, hasContentaddExceptionsFrom, addParseException, addParseException, addParseWarning, addParseWarning, clearParseExceptions, clearParseTreeInformation, clearParseWarnings, findAncestorParsedElementByType, findDeclaringStatement, findRootParsedElement, getColumn, getContainedParsedElementsByType, getContainedParsedElementsByTypes, getContainedParsedElementsByTypesWithIgnoreSet, getFunctionName, getGosuClass, getGosuProgram, getImmediateParseIssue, getImmediateParseIssues, getLineNum, getLocation, getModule, getParent, getParseExceptions, getParseIssues, getParseWarnings, getReturnType, getTokens, hasImmediateParseIssue, hasImmediateParseWarnings, hasParseException, hasParseExceptions, hasParseIssue, hasParseIssues, hasParseWarning, hasParseWarnings, isCompileTimeConstant, isSuppressed, isSynthetic, setLocation, setParentprotected Expression _switchExpression
protected CaseClause[] _cases
public Expression getSwitchExpression()
getSwitchExpression in interface ISwitchStatementpublic void setSwitchExpression(Expression switchExpression)
public CaseClause[] getCases()
getCases in interface ISwitchStatementpublic void setCases(CaseClause[] cases)
public List<Statement> getDefaultStatements()
getDefaultStatements in interface ISwitchStatementpublic Object execute()
execute in interface IStatementexecute in class Statementprotected ITerminalStatement getLeastSignificantTerminalStatement_internal(boolean[] bAbsolute)
getLeastSignificantTerminalStatement_internal in class Statementpublic boolean isCoveredEnumSwitch()
isCoveredEnumSwitch in interface ISwitchStatementCopyright © 2022. All rights reserved.