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 | Protected Attributes | Properties | List of all members
Mercury.Interpreting.Alternative Class Reference

Represents an alternative of elements. It may match specified symbols or symboltypes (Nonterminals, ...). More...

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

Public Member Functions

 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)
 

Protected Attributes

HashSet< Symbolsmset
 

Properties

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...
 

Detailed Description

Represents an alternative of elements. It may match specified symbols or symboltypes (Nonterminals, ...).

Definition at line 48 of file Element.cs.

Constructor & Destructor Documentation

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.

Parameters
smThe Symbol mask.
symbolsThe symbols.
Exceptions
System.ArgumentNullExceptionWhen symbols is null
System.ArgumentExceptionArgument 'symbols' contains null
System.ArgumentExceptionEmpty alternative is not allowed

Definition at line 67 of file Element.cs.

Member Function Documentation

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

Definition at line 112 of file Element.cs.

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

Definition at line 159 of file Element.cs.

override int Mercury.Interpreting.Alternative.GetHashCode ( )

Definition at line 118 of file Element.cs.

bool Mercury.Interpreting.Alternative.MatchesSymbol ( Symbol  s)

Indicates whether this alternative matches the given symbol.

Parameters
sThe symbol.
Returns
true if this alternative matches s, false otherwise

Definition at line 105 of file Element.cs.

override string Mercury.Interpreting.Alternative.ToString ( )

Definition at line 130 of file Element.cs.

Member Data Documentation

HashSet<Symbol> Mercury.Interpreting.Alternative.smset
protected

Definition at line 53 of file Element.cs.

Property Documentation

SymbolType Mercury.Interpreting.Alternative.SymbolMask
getset

Mask of symbol types this alternative matches regardless the symbol name.

The symbol mask.

Definition at line 92 of file Element.cs.

IReadOnlyList<Symbol> Mercury.Interpreting.Alternative.Symbols
getset

List of specific symbols this alternative matches.

The symbols.

Definition at line 96 of file Element.cs.


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