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 | List of all members
Mercury.Syntax.CompositeScanner Class Reference

Mercury.Syntax.IScanner implementation that behaves like container of scanners using the Composite Design Pattern. More...

Inheritance diagram for Mercury.Syntax.CompositeScanner:
Mercury.Syntax.IScanner

Public Member Functions

 CompositeScanner ()
 Creates an empty Composite scanner. More...
 
 CompositeScanner (IEnumerable< IScanner > scanners)
 Creates a scanner initialized by source scanners. More...
 
IScanner Add (IScanner scanner)
 Adds the specified scanner to the container. If the scanner is already present, this method will have no effect. More...
 
IScanner Remove (IScanner scanner)
 Removes the scanner from the container. More...
 
IEnumerable< RuleScan (IEnumerable< Token > tokens)
 Scans input tokens and creates additional rules for parsing. More...
 
IEnumerator< IScannerGetEnumerator ()
 

Detailed Description

Mercury.Syntax.IScanner implementation that behaves like container of scanners using the Composite Design Pattern.

When Scan method is called, it internally calls all scanners and concatenates their outputs.

Definition at line 42 of file Scanner.cs.

Constructor & Destructor Documentation

Mercury.Syntax.CompositeScanner.CompositeScanner ( )

Creates an empty Composite scanner.

Definition at line 53 of file Scanner.cs.

Mercury.Syntax.CompositeScanner.CompositeScanner ( IEnumerable< IScanner scanners)

Creates a scanner initialized by source scanners.

Parameters
scannersThe source scanners

Definition at line 60 of file Scanner.cs.

Member Function Documentation

IScanner Mercury.Syntax.CompositeScanner.Add ( IScanner  scanner)

Adds the specified scanner to the container. If the scanner is already present, this method will have no effect.

Parameters
scannerThe scanner.
Returns
This instance to support chaining.

Definition at line 72 of file Scanner.cs.

IEnumerator<IScanner> Mercury.Syntax.CompositeScanner.GetEnumerator ( )

Definition at line 100 of file Scanner.cs.

IScanner Mercury.Syntax.CompositeScanner.Remove ( IScanner  scanner)

Removes the scanner from the container.

Parameters
scannerThe scanner.
Returns
This instance

Definition at line 83 of file Scanner.cs.

IEnumerable<Rule> Mercury.Syntax.CompositeScanner.Scan ( IEnumerable< Token tokens)

Scans input tokens and creates additional rules for parsing.

Parameters
tokensInput tokens.
Returns
Enumeration of additional rules.

Implements Mercury.Syntax.IScanner.

Definition at line 93 of file Scanner.cs.


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