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

## 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< Rule > | Scan (IEnumerable< Token > tokens)
| Scans input tokens and creates additional rules for parsing. More...
IEnumerator< IScanner > | GetEnumerator ()

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

  scanners | The 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

  scanner | The 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

  scanner | The 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

  tokens | Input 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:

- Mercury/Mercury/Syntax/Scanner.cs