Mercury library 1.0 Translation of CFG grammars into an object model (Bachelor's thesis).

- Main Page
- Packages
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

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:

## 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< Symbol > | smset

## Properties
SymbolType | SymbolMask`[get, set]`
| Mask of symbol types this alternative matches regardless the symbol name. More...
IReadOnlyList< Symbol > | Symbols`[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

  sm | The Symbol mask.
  symbols | The symbols.

Exceptions

  System.ArgumentNullException | When symbols is null
  System.ArgumentException | Argument 'symbols' contains null
  System.ArgumentException | Empty 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

  s | The 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
| get set

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
| get set

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:

- Mercury/Mercury/Interpreting/Element.cs