C# Class ABB.Swum.Nodes.MethodDeclarationNode

Represents a method declaration in the program.
Inheritance: ProgramElementNode
Exibir arquivo Open project: abb-iss/Swum.NET Class Usage Examples

Public Methods

Method Description
AddSecondaryArgument ( Node argument, WordNode preposition ) : void

Creates a new ArgumentNode from the given parameters, and adds it to the SecondaryArguments list.

AddUnknownArgument ( Node argument ) : void

Adds the given argument to the UnknownArguments list.

AddUnknownArguments ( IEnumerable arguments ) : void

Adds the given arguments to the UnknownArguments list.

AssignStructuralInformation ( IdSplitter splitter, Tagger tagger ) : void

Initializes the fields containing structural information about the method. This includes the location, return type and parameters.

ClearSecondaryArguments ( ) : void

Clears the list of SecondaryArguments.

ClearUnknownArguments ( ) : void

Clears the list of UnknownArguments.

CreateEquivalenceFromUnknownArguments ( Node equivalentNode, IEnumerable equivalentUnknownArgs ) : EquivalenceNode

Creates a new EquivalenceNode containing the passed node and the specified nodes from the UnknownArguments list. The arguments are removed from the UnknownArguments list after being added to the EquivalenceNode.

CreateEquivalenceFromUnknownArguments ( Node equivalentNode, bool equivalentUnknownArgs ) : EquivalenceNode

Creates a new EquivalenceNode containing the passed node and the specified nodes from the UnknownArguments list. The arguments are removed from the UnknownArguments list after being added to the EquivalenceNode.

CreateThemeFromPhrases ( PhraseNode phrase1, PhraseNode phrase2 ) : void

Concatenates the given phrases and assigns the result to Theme. ** Note that this will potentially modify phrase1. **

MethodDeclarationNode ( string name ) : System

Creates a new MethodDeclarationNode with the given method name.

MethodDeclarationNode ( string name, MethodContext context ) : System

Creates a new MethodDeclarationNode with the given method name and context.

ToString ( ) : string

Creates a string representation of the node, which contains the action, theme and arguments.

Method Details

AddSecondaryArgument() public method

Creates a new ArgumentNode from the given parameters, and adds it to the SecondaryArguments list.
public AddSecondaryArgument ( Node argument, WordNode preposition ) : void
argument Node The node that is serving as the argument.
preposition WordNode The preposition describing the argument's relation to the method.
return void

AddUnknownArgument() public method

Adds the given argument to the UnknownArguments list.
public AddUnknownArgument ( Node argument ) : void
argument Node A Node corresponding to the argument to add.
return void

AddUnknownArguments() public method

Adds the given arguments to the UnknownArguments list.
public AddUnknownArguments ( IEnumerable arguments ) : void
arguments IEnumerable A collection of the arguments to add.
return void

AssignStructuralInformation() public method

Initializes the fields containing structural information about the method. This includes the location, return type and parameters.
splitter is null. tagger is null. Context property is not set.
public AssignStructuralInformation ( IdSplitter splitter, Tagger tagger ) : void
splitter IdSplitter An IdSplitter to split the method name into words.
tagger Tagger A Tagger to tag the parts-of-speech of the name.
return void

ClearSecondaryArguments() public method

Clears the list of SecondaryArguments.
public ClearSecondaryArguments ( ) : void
return void

ClearUnknownArguments() public method

Clears the list of UnknownArguments.
public ClearUnknownArguments ( ) : void
return void

CreateEquivalenceFromUnknownArguments() public method

Creates a new EquivalenceNode containing the passed node and the specified nodes from the UnknownArguments list. The arguments are removed from the UnknownArguments list after being added to the EquivalenceNode.
equivalentNode is null. equivalentUnknownArgs is null.
public CreateEquivalenceFromUnknownArguments ( Node equivalentNode, IEnumerable equivalentUnknownArgs ) : EquivalenceNode
equivalentNode Node The first node to add to the EquivalenceNode, i.e. the node that the unknown arguments are equivalent with.
equivalentUnknownArgs IEnumerable The UnknownArguments to include in the equivalence.
return EquivalenceNode

CreateEquivalenceFromUnknownArguments() public method

Creates a new EquivalenceNode containing the passed node and the specified nodes from the UnknownArguments list. The arguments are removed from the UnknownArguments list after being added to the EquivalenceNode.
equivalentNode is null. The length of equivalentUnknownArgs is not the same as the UnknownArguments property of the MethodDeclarationNode.
public CreateEquivalenceFromUnknownArguments ( Node equivalentNode, bool equivalentUnknownArgs ) : EquivalenceNode
equivalentNode Node The first node to add to the EquivalenceNode, i.e. the node that the unknown arguments are equivalent with.
equivalentUnknownArgs bool An array of booleans indicating which unknown arguments to include in the equivalence. /// This array must be the same length as the UnknownArguments list. /// For each element in the array, a value of True means to include the corresponding unknown argument, False means to not include it.
return EquivalenceNode

CreateThemeFromPhrases() public method

Concatenates the given phrases and assigns the result to Theme. ** Note that this will potentially modify phrase1. **
public CreateThemeFromPhrases ( PhraseNode phrase1, PhraseNode phrase2 ) : void
phrase1 PhraseNode The first phrase.
phrase2 PhraseNode The second phrase.
return void

MethodDeclarationNode() public method

Creates a new MethodDeclarationNode with the given method name.
public MethodDeclarationNode ( string name ) : System
name string The name of the method.
return System

MethodDeclarationNode() public method

Creates a new MethodDeclarationNode with the given method name and context.
public MethodDeclarationNode ( string name, MethodContext context ) : System
name string The name of the method.
context MethodContext The method's context.
return System

ToString() public method

Creates a string representation of the node, which contains the action, theme and arguments.
public ToString ( ) : string
return string