Zen
A cross-platform functional programming language
|
AST Node representing a switch statement. More...
#include <Ast.hpp>
Public Member Functions | |
SwitchStatement (const Ast::Expr &expr, const Ast::SwitchLabelList &list) | |
Default constructor. | |
const Ast::Expr & | getExpr () const |
Returns a reference to the switch expression. | |
const Ast::SwitchLabelList & | getList () const |
Returns a reference to the list of case labels in this select statement. | |
Private Member Functions | |
virtual void | visit (Statement::Visitor &visitor) const |
Abstract visitor function. | |
Private Attributes | |
const Ast::Expr & | _expr |
The switch expression. | |
const Ast::SwitchLabelList & | _list |
The case label list. |
AST Node representing a switch statement.
A switch statement is a multiple condition statement that can have only integral constant values as case labels For example:
switch (a) { case 10: { } case 15: { } }
Here, the case labels are compile-time integral constants.
SwitchStatement | ( | const Ast::Expr & | expr, |
const Ast::SwitchLabelList & | list | ||
) | [inline] |
Default constructor.
expr | The expression to switch by. |
list | The list of case labels for this statement |
const Ast::Expr& getExpr | ( | ) | const [inline] |
Returns a reference to the switch expression.
const Ast::SwitchLabelList& getList | ( | ) | const [inline] |
Returns a reference to the list of case labels in this select statement.
void visit | ( | Statement::Visitor & | visitor | ) | const [private, virtual] |