The StaDyn Programming Language
Source code documentation of StaDyn, a hybrid static and dynamic typing language.
AST.SwitchSection Class Reference

Encapsulates a Case statement of our programming languages. More...

Inheritance diagram for AST.SwitchSection:
AST.Statement AST.AstNode

Public Member Functions

 SwitchSection (List< SwitchLabel > labels, List< Statement > stats, Location location)
 Constructor of SwitchSection More...
 
bool IsDefaultCase ()
 Checks if the switch section has a default case. More...
 
override Object Accept (Visitor v, Object o)
 Accept method of a concrete visitor. More...
 
- Public Member Functions inherited from AST.Statement
override object AcceptOperation (AstOperation op, object arg)
 Dispatches expressions to the operation passed as argument. It provokes the execution of op.AcceptOperation(AstNode) with the parameter resolved polymorfically More...
 
- Public Member Functions inherited from AST.AstNode
override bool Equals (object obj)
 AntLR compares Nodes with the class name. This is not correct for our purposes. More...
 
override int GetHashCode ()
 

Properties

Block SwitchBlock [get]
 Gets the code block of Case statement. More...
 
List< SwitchLabelLabelSection [get]
 Gets the type of the Case statement (case or default) More...
 
int LabelCount [get]
 Gets the number of labels associated to the switch section. More...
 
- Properties inherited from AST.AstNode
Location Location [get]
 

Additional Inherited Members

- Protected Member Functions inherited from AST.Statement
 Statement (Location location)
 Protected constructor of Statement. More...
 
- Protected Member Functions inherited from AST.AstNode
 AstNode (Location location)
 Protected constructor of NodeAst More...
 
- Protected Attributes inherited from AST.AstNode
Location location
 Location: Encapsulates in one object the line, column and filename More...
 

Detailed Description

Encapsulates a Case statement of our programming languages.

Inheritance: Statement. Implements Composite pattern [Composite]. Implements Visitor pattern [Concrete Element].

Definition at line 33 of file SwitchSection.cs.

Constructor & Destructor Documentation

AST.SwitchSection.SwitchSection ( List< SwitchLabel labels,
List< Statement stats,
Location  location 
)

Constructor of SwitchSection

Parameters
labelsCondition expressions of the Case statement.
statsBlock executed in the Case statement.
fileNameFile name.
lineNumberLine number.
columnNumberColumn number.

Definition at line 87 of file SwitchSection.cs.

Member Function Documentation

override Object AST.SwitchSection.Accept ( Visitor  v,
Object  o 
)
virtual

Accept method of a concrete visitor.

Parameters
vConcrete visitor
oOptional information to use in the visit.
Returns
Optional information to return

Implements AST.AstNode.

Definition at line 121 of file SwitchSection.cs.

bool AST.SwitchSection.IsDefaultCase ( )

Checks if the switch section has a default case.

Returns
True if the switch section has a default case. Otherwise, false.

Definition at line 101 of file SwitchSection.cs.

Property Documentation

int AST.SwitchSection.LabelCount
get

Gets the number of labels associated to the switch section.

Definition at line 71 of file SwitchSection.cs.

List<SwitchLabel> AST.SwitchSection.LabelSection
get

Gets the type of the Case statement (case or default)

Definition at line 63 of file SwitchSection.cs.

Block AST.SwitchSection.SwitchBlock
get

Gets the code block of Case statement.

Definition at line 55 of file SwitchSection.cs.


The documentation for this class was generated from the following file: