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

Encapsulates the source code. More...

Inheritance diagram for AST.SourceFile:
AST.AstNode

Public Member Functions

 SourceFile (Location loc)
 Constructor of SourceFile More...
 
void AddUsing (string include)
 Add a new include file. More...
 
void AddDeclaration (Declaration declaration)
 Add a new declaration. More...
 
void AddNamespace (IdentifierExpression name, List< Declaration > declaration)
 Add a new namespace definition. More...
 
Declaration GetDeclarationElement (int index)
 Gets the element stored in the specified index. More...
 
int GetNamespaceDefinitionCount (string name)
 Gets the number of declaration into the specified namespace. More...
 
Namespace GetNamespaceDeclarationElement (string name, int index)
 Gets the element stored in the specified namespace and index. More...
 
override Object Accept (Visitor v, Object o)
 Accept method of a concrete visitor. 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 ()
 
virtual 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...
 

Properties

List< string > Usings [get]
 Gets the included files. More...
 
Dictionary< string, List
< Namespace > >.KeyCollection 
Namespacekeys [get]
 Gets the keys of namespace definition. More...
 
int DeclarationCount [get]
 Gets the number of declarations out of namespace definition. More...
 
- Properties inherited from AST.AstNode
Location Location [get]
 

Additional Inherited Members

- 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 the source code.

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

Definition at line 35 of file SourceFile.cs.

Constructor & Destructor Documentation

AST.SourceFile.SourceFile ( Location  loc)

Constructor of SourceFile

Parameters
fInformation of the file stores source code.
lineNumberLine number.
columnNumberColumn number.

Definition at line 93 of file SourceFile.cs.

Member Function Documentation

override Object AST.SourceFile.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 202 of file SourceFile.cs.

void AST.SourceFile.AddDeclaration ( Declaration  declaration)

Add a new declaration.

Parameters
declarationDeclaration to add.

Definition at line 123 of file SourceFile.cs.

void AST.SourceFile.AddNamespace ( IdentifierExpression  name,
List< Declaration declaration 
)

Add a new namespace definition.

Parameters
nameNamespace name.
declarationDeclaration.

Definition at line 137 of file SourceFile.cs.

void AST.SourceFile.AddUsing ( string  include)

Add a new include file.

Parameters
includestring that represents a external file to include in the current source code.

Definition at line 110 of file SourceFile.cs.

Declaration AST.SourceFile.GetDeclarationElement ( int  index)

Gets the element stored in the specified index.

Parameters
indexIndex.
Returns
Element stored in the specified index.

Definition at line 155 of file SourceFile.cs.

Namespace AST.SourceFile.GetNamespaceDeclarationElement ( string  name,
int  index 
)

Gets the element stored in the specified namespace and index.

Parameters
nameNamespace name.
indexIndex.
Returns
Element stored in the specified namespace and index.

Definition at line 185 of file SourceFile.cs.

int AST.SourceFile.GetNamespaceDefinitionCount ( string  name)

Gets the number of declaration into the specified namespace.

Parameters
nameNamespace name.

Definition at line 168 of file SourceFile.cs.

Property Documentation

int AST.SourceFile.DeclarationCount
get

Gets the number of declarations out of namespace definition.

Definition at line 79 of file SourceFile.cs.

Dictionary<string, List<Namespace> >.KeyCollection AST.SourceFile.Namespacekeys
get

Gets the keys of namespace definition.

Definition at line 71 of file SourceFile.cs.

List<string> AST.SourceFile.Usings
get

Gets the included files.

Definition at line 63 of file SourceFile.cs.


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