Mercury.Formats library  1.0
The library provides format parsers for the Mercury library components.
 All Classes Namespaces Files Functions Properties
Public Member Functions | Properties | List of all members
Mercury.Formats.Basic.GrammarEntityParser Class Reference

Class for parsing grammar entities used in Mercury. More...

Public Member Functions

 GrammarEntityParser (Symbol epsilon)
 Initializes a new instance of the GrammarEntityParser class. More...
 
Symbol ParseSymbol (Token token)
 Parses a symbol from a token. More...
 
Rule ParseRule (IList< Token > tokens)
 Parses the rule.
The rule is of the format A -> X Y Z... where A is a nonterminal symbols and X, Y and Z are terminals or nonterminals. If epsilon is used, the only format allowed is A -> epsilon. More...
 
IList< Rule > ParseMultiRule (IList< Token > tokens)
 Parses the multi-rule. It is of the form A -> RHS0 | RHS1 | ... where A -> RHS0 and A -> RHS1 are valid rules. More...
 
Edge ParseEdge (IList< Token > tokens)
 Parses the edge. It is of the form (l, r) A -> alpha . beta where l <= r and A -> alpha beta is a valid rule. More...
 

Properties

Symbol Epsilon [get, set]
 

Detailed Description

Class for parsing grammar entities used in Mercury.

Definition at line 18 of file EntityParser.cs.

Constructor & Destructor Documentation

Mercury.Formats.Basic.GrammarEntityParser.GrammarEntityParser ( Symbol  epsilon)

Initializes a new instance of the GrammarEntityParser class.

Parameters
epsilonThe epsilon symbol.
Exceptions
System.ArgumentExceptionRequired epsilon symbol for Grammar Entity Parser

Definition at line 28 of file EntityParser.cs.

Member Function Documentation

Edge Mercury.Formats.Basic.GrammarEntityParser.ParseEdge ( IList< Token >  tokens)

Parses the edge. It is of the form (l, r) A -> alpha . beta where l <= r and A -> alpha beta is a valid rule.

Parameters
tokensThe tokens.
Returns
The edge.

Definition at line 104 of file EntityParser.cs.

IList<Rule> Mercury.Formats.Basic.GrammarEntityParser.ParseMultiRule ( IList< Token >  tokens)

Parses the multi-rule. It is of the form A -> RHS0 | RHS1 | ... where A -> RHS0 and A -> RHS1 are valid rules.

Parameters
tokensThe tokens.
Returns
List of rules.

Definition at line 76 of file EntityParser.cs.

Rule Mercury.Formats.Basic.GrammarEntityParser.ParseRule ( IList< Token >  tokens)

Parses the rule.
The rule is of the format A -> X Y Z... where A is a nonterminal symbols and X, Y and Z are terminals or nonterminals. If epsilon is used, the only format allowed is A -> epsilon.

Parameters
tokensThe tokens.
Returns

Definition at line 59 of file EntityParser.cs.

Symbol Mercury.Formats.Basic.GrammarEntityParser.ParseSymbol ( Token  token)

Parses a symbol from a token.

Parameters
tokenThe token.
Returns
A new symbol.

Definition at line 41 of file EntityParser.cs.

Property Documentation

Symbol Mercury.Formats.Basic.GrammarEntityParser.Epsilon
getset

Definition at line 134 of file EntityParser.cs.


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