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 | 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 >:
Mercury.Analyser< T >

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
TInterpreter return type.
TResultResult 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
langinfoThe language information.
resultSelectorThe post-processing function.
contextFactoryThe 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
tokenizerThe tokenizer.
scannerThe scanner.
parserThe parser.
interpreterThe interpreter.
resultSelectorThe result selector.
Exceptions
System.ArgumentNullExceptiontokenizer, 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
inputThe input.
Returns
The result of analysis.

Definition at line 90 of file Analyser.cs.

Property Documentation

IInterpreter<T> Mercury.Analyser< T, TResult >.Interpreter
getset

Gets the interpreter.

Definition at line 81 of file Analyser.cs.

IParser Mercury.Analyser< T, TResult >.Parser
getset

Gets the parser.

Definition at line 78 of file Analyser.cs.

IScanner Mercury.Analyser< T, TResult >.Scanner
getset

Gets the scanner.

Definition at line 75 of file Analyser.cs.

ITokenizer Mercury.Analyser< T, TResult >.Tokenizer
getset

Gets the tokenizer.

Definition at line 72 of file Analyser.cs.


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