Mercury library  1.0
Translation of CFG grammars into an object model (Bachelor's thesis).
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties
Public Member Functions | Static Public Member Functions | Properties | List of all members
Mercury.Interpreting.Variable Class Reference

Represents a variable element that captures value and can be used on the RHS of the RewriteRule as an argument More...

Inheritance diagram for Mercury.Interpreting.Variable:
Mercury.Interpreting.Alternative Mercury.Interpreting.IElement Mercury.Interpreting.Wildcard

Public Member Functions

 Variable ()
 Creates an anonymous variable, an equivalent of Mercury.Interpreting.Wildcard that matches exactly one symbol More...
 
 Variable (string name, SymbolType ws, IEnumerable< Symbol > symbols)
 Initializes a new instance of the variable class. See Mercury.Interpreting.Alternative's constructor for more details. More...
 
override bool Equals (object obj)
 
override int GetHashCode ()
 
override string ToString ()
 
bool Equals (IElement other)
 
bool Equals (Variable other)
 
- Public Member Functions inherited from Mercury.Interpreting.Alternative
 Alternative (SymbolType sm, IEnumerable< Symbol > symbols)
 Initializes a new instance of the Alternative class. If symbols contains symbols of type that is present in the sm mask, they will be omitted. More...
 
bool MatchesSymbol (Symbol s)
 Indicates whether this alternative matches the given symbol. More...
 
override bool Equals (object obj)
 
override int GetHashCode ()
 
override string ToString ()
 
bool Equals (Alternative other)
 

Static Public Member Functions

static bool IsValidName (string name)
 Determines whether the specified string is a valid variable name.
More...
 

Properties

string Name [get, set]
 Name of the variable More...
 
ElementType Type [get, set]
 
- Properties inherited from Mercury.Interpreting.Alternative
SymbolType SymbolMask [get, set]
 Mask of symbol types this alternative matches regardless the symbol name. More...
 
IReadOnlyList< SymbolSymbols [get, set]
 List of specific symbols this alternative matches. More...
 
- Properties inherited from Mercury.Interpreting.IElement
ElementType Type [get]
 Element type More...
 

Additional Inherited Members

- Protected Attributes inherited from Mercury.Interpreting.Alternative
HashSet< Symbolsmset
 

Detailed Description

Represents a variable element that captures value and can be used on the RHS of the RewriteRule as an argument

Definition at line 261 of file Element.cs.

Constructor & Destructor Documentation

Mercury.Interpreting.Variable.Variable ( )

Creates an anonymous variable, an equivalent of Mercury.Interpreting.Wildcard that matches exactly one symbol

Definition at line 269 of file Element.cs.

Mercury.Interpreting.Variable.Variable ( string  name,
SymbolType  ws,
IEnumerable< Symbol symbols 
)

Initializes a new instance of the variable class. See Mercury.Interpreting.Alternative's constructor for more details.

Parameters
nameThe name of variable.
wsThe symbol mask.
symbolsThe symbols.
Exceptions
System.ArgumentException

Definition at line 282 of file Element.cs.

Member Function Documentation

override bool Mercury.Interpreting.Variable.Equals ( object  obj)

Definition at line 318 of file Element.cs.

bool Mercury.Interpreting.Variable.Equals ( IElement  other)

Definition at line 342 of file Element.cs.

bool Mercury.Interpreting.Variable.Equals ( Variable  other)

Definition at line 349 of file Element.cs.

override int Mercury.Interpreting.Variable.GetHashCode ( )

Definition at line 324 of file Element.cs.

static bool Mercury.Interpreting.Variable.IsValidName ( string  name)
static

Determines whether the specified string is a valid variable name.

  • contains only letters or digits
  • the first character is letter
Parameters
nameThe name.
Returns
true if the name is valid, otherwise it returns (surprisingly) false.

Definition at line 307 of file Element.cs.

override string Mercury.Interpreting.Variable.ToString ( )

Definition at line 327 of file Element.cs.

Property Documentation

string Mercury.Interpreting.Variable.Name
getset

Name of the variable

Definition at line 293 of file Element.cs.

ElementType Mercury.Interpreting.Variable.Type
getset

Definition at line 336 of file Element.cs.


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