Persistate API documentation
Production Class
NamespacesPersistate.LanguageProduction

[This is preliminary documentation and is subject to change.]

Represents a grammar production rule used in syntax parsing.
Declaration Syntax
C#
public class Production : IProduction, IEnumerable<Element>, 
	IEnumerable
Members
All MembersMethodsProperties



IconMemberDescription
Add(array<Object>[]()[][])
Adds one or more items to the RHS of this production.

AppendString(StringBuilder)
Appends a line containing a text representation of this production to a StringBuilder.

Choice(array<Object>[]()[][])
Creates the productions and Elements necessary for a choice (alternatives) section of a production.

Count
Gets the number of Elements in the RHS of this production.

ElementsFrom(Int32)
Obtains an enumerator which will iterate through the elements in the RHS of this production, starting from a particular element.

Equals(Object)
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Finalize()()()()
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
GenerateCode
Gets or sets the CodeGenerator delegate which will be called during the code generation phase.

GetEnumerator()()()()
Obtains an enumerator which will iterate through the elements in the RHS of this production.

GetHashCode()()()()
Serves as a hash function for a particular type.
(Inherited from Object.)
GetType()()()()
Gets the Type of the current instance.
(Inherited from Object.)
Item[([( Int32])])
Gets the Element at a particular position in the Right Hand Side (RHS) of this Production.

Lhs
Gets the Element representing the Left Hand Side (LHS) of this Production.

MemberwiseClone()()()()
Creates a shallow copy of the current Object.
(Inherited from Object.)
Name
Gets the Name of this Production. This is the text of the RHS non terminal

Option(array<Object>[]()[][])
Creates the productions and Elements necessary for an optional section of a production.

Parser
Gets the SyntaxParser that this Production belongs to.

Repeat(array<Object>[]()[][])
Creates the Productions and Elements necessary for a repeated section of a production.

RuleIndex
Gets the RuleIndex of this production, used for indexing in the parser and the transition table.

ToString()()()()
Creates a short string representation of the value of this production
(Overrides Object.ToString()()()().)
Remarks

There are two ways you can create the productions for a parser. The easy way is to use the GenerateParser or GenerateParserFromFile methods in the SyntaxParser class. These will create a ready to use parser complete with productions from a grammar expressed in a variant of EBNF.

You can also create productions manually for a parser by using the Add, Repeat, Option and Choice methods of this class. If you do it this way, you must then call the SyntaxParser.CreateParser method to incorporate the productions you've added into the parser state automaton.

Inheritance Hierarchy
Object
Production

Assembly: Persistate.Language (Module: Persistate.Language) Version: 0.6.1.20 (0.6.1.20)