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 | Properties | List of all members
Mercury.Analyser< T, TResult > Class Template Reference

Wrapper class for each step of analysis. More...

Inheritance diagram for Mercury.Analyser< T, TResult >:

## Public Member Functions
| Analyser (LanguageInfo< T > langinfo, Func< T, TResult > resultSelector, IInterpreterContextFactory contextFactory=null)
| Initializes a new instance of the Analyser{T,TResult} class from the provided language information. More...
| Analyser (ITokenizer tokenizer, IScanner scanner, IParser parser, IInterpreter< T > interpreter, Func< T, TResult > resultSelector)
| Initializes a new instance of analyzer from the class. Scanner and Interpreter can be `null` (if so, they won't be used). resultSelector can be `null` only if the interpreter is `null`. More...
AnalyserResult< T, TResult > | Analyze (string input)
| Analyzes the specified input and returns the Mercury.AnalyserResult{T,TResult}. More...

## Properties
ITokenizer | Tokenizer`[get, set]`
| Gets the tokenizer. More...
IScanner | Scanner`[get, set]`
| Gets the scanner. More...
IParser | Parser`[get, set]`
| Gets the parser. More...
IInterpreter< T > | Interpreter`[get, set]`
| Gets the interpreter. More...

## Detailed Description

Wrapper class for each step of analysis.

Template Parameters

  T | Interpreter return type.
  TResult | Result type of post-processing. May equal T .

Type Constraints

  T | : | class |
  TResult | : | class |

Definition at line 18 of file Analyser.cs.

## Constructor & Destructor Documentation

Mercury.Analyser< T, TResult >.Analyser | ( | LanguageInfo< T > | langinfo,
|  | Func< T, TResult > | resultSelector,
|  | IInterpreterContextFactory | contextFactory = `null`
| ) |  |

Initializes a new instance of the Analyser{T,TResult} class from the provided language information.

Parameters

  langinfo | The language information.
  resultSelector | The post-processing function.
  contextFactory | The context factory.

Definition at line 33 of file Analyser.cs.

Mercury.Analyser< T, TResult >.Analyser | ( | ITokenizer | tokenizer,
|  | IScanner | scanner,
|  | IParser | parser,
|  | IInterpreter< T > | interpreter,
|  | Func< T, TResult > | resultSelector
| ) |  |

Initializes a new instance of analyzer from the class. Scanner and Interpreter can be `null` (if so, they won't be used). resultSelector can be `null` only if the interpreter is `null`.

Parameters

  tokenizer | The tokenizer.
  scanner | The scanner.
  parser | The parser.
  interpreter | The interpreter.
  resultSelector | The result selector.

Exceptions

  System.ArgumentNullException | tokenizer, parser or resultSelector is null

Definition at line 52 of file Analyser.cs.

## Member Function Documentation

AnalyserResult<T, TResult> Mercury.Analyser< T, TResult >.Analyze | ( | string | input | ) |

Analyzes the specified input and returns the Mercury.AnalyserResult{T,TResult}.

Parameters

  input | The input.

Returns
  The result of analysis.

Definition at line 90 of file Analyser.cs.

## Property Documentation

IInterpreter<T> Mercury.Analyser< T, TResult >.Interpreter
| get set

Gets the interpreter.

Definition at line 81 of file Analyser.cs.

IParser Mercury.Analyser< T, TResult >.Parser
| get set

Gets the parser.

Definition at line 78 of file Analyser.cs.

IScanner Mercury.Analyser< T, TResult >.Scanner
| get set

Gets the scanner.

Definition at line 75 of file Analyser.cs.

ITokenizer Mercury.Analyser< T, TResult >.Tokenizer
| get set

Gets the tokenizer.

Definition at line 72 of file Analyser.cs.

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

- Mercury/Mercury/Analyser.cs