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

Encapsulates a block of statements. More...

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

Public Member Functions

 Block (Location location)
 Constructor of Block More...
 
 Block (List< Statement > stats, Location location)
 Constructor of Block More...
 
void AddStatement (Statement statement)
 Add a new statement to the end of the block. More...
 
void AddStatementToTheBeginning (Statement statement)
 Add a new statement. More...
 
void AddStatementAtIndex (Statement statement, int index)
 Add a new statement at the specified index. More...
 
int SearchPosition (string id)
 Searches the identifier and returns its position. More...
 
Statement GetStatementElement (int index)
 Gets the element stored in the specified index. 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

int StatementCount [get]
 Gets the number of statements. 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 block of statements.

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

Definition at line 34 of file Block.cs.

Constructor & Destructor Documentation

AST.Block.Block ( Location  location)

Constructor of Block

Parameters
fileNameFile name.
lineNumberLine number.
columnNumberColumn number.

Definition at line 65 of file Block.cs.

AST.Block.Block ( List< Statement stats,
Location  location 
)

Constructor of Block

Parameters
statsList of statements of the block.
fileNameFile name.
lineNumberLine number.
columnNumberColumn number.

Definition at line 77 of file Block.cs.

Member Function Documentation

override Object AST.Block.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 174 of file Block.cs.

void AST.Block.AddStatement ( Statement  statement)

Add a new statement to the end of the block.

Parameters
statementStatements to add.

Definition at line 90 of file Block.cs.

void AST.Block.AddStatementAtIndex ( Statement  statement,
int  index 
)

Add a new statement at the specified index.

Parameters
statementStatement to add.
indexPosition to insert.

Definition at line 117 of file Block.cs.

void AST.Block.AddStatementToTheBeginning ( Statement  statement)

Add a new statement.

Parameters
statementStatements to add.

Definition at line 103 of file Block.cs.

Statement AST.Block.GetStatementElement ( int  index)

Gets the element stored in the specified index.

Parameters
indexIndex.
Returns
Element stored in the specified index.

Definition at line 159 of file Block.cs.

int AST.Block.SearchPosition ( string  id)

Searches the identifier and returns its position.

Parameters
idIdentifier to search.
Returns
Returns the position to the identifier.

Definition at line 131 of file Block.cs.

Property Documentation

int AST.Block.StatementCount
get

Gets the number of statements.

Definition at line 51 of file Block.cs.


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