Zen
A cross-platform functional programming language

SwitchLabelList Class Reference

AST Node representing a list of case labels. More...

#include <Ast.hpp>

Inheritance diagram for SwitchLabelList:
Node

List of all members.

Public Types

typedef z::list< CaseLabel * > List
 List of case labels.

Public Member Functions

 SwitchLabelList ()
 Default constructor.
void addCase (CaseLabel &label)
 Add a case label to the list.
void addDefault (DefaultLabel &label)
 Set the default case.
const ListgetList () const
 Returns a reference to the list of labels.
bool hasDefault () const
 Checks if list has a default case.
const DefaultLabelgetDefault () const
 Returns the default label.

Private Attributes

List _list
 The Label list.
DefaultLabel_defaultLabel
 The default label.

Detailed Description

AST Node representing a list of case labels.


Member Function Documentation

void addCase ( CaseLabel label) [inline]

Add a case label to the list.

Parameters:
labelThe case label to add.
void addDefault ( DefaultLabel label) [inline]

Set the default case.

Parameters:
labelThe label to add.
const DefaultLabel& getDefault ( ) const [inline]

Returns the default label.

Returns:
The default label.
const List& getList ( ) const [inline]

Returns a reference to the list of labels.

Returns:
Label list.
bool hasDefault ( ) const [inline]

Checks if list has a default case.

Returns:
If if list has a default case, else false.

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines