Class Rule

Extends: System.Object

The Rule class is used to represent the logical structures of the grammar. Rules consist of a head containing a nonterminal followed by a series of both nonterminals and terminals.

Public Properties

RuleNonTerminal
Gets the head symbol of this rule. 
SymbolCount
Gets the number of symbols in the body (right-hand-side) of the rule. 
TableIndex
Gets the index of this Rule in the GoldParser's rule-table. 

Public Methods

GetSymbol
Returns the symbol in the body of the rule with the specified index. 
ToString
Returns the Backus-Naur representation of this Rule

Property Detail

RuleNonTerminal

public GoldParser.Symbol RuleNonTerminal { get; }

Gets the head symbol of this rule.


SymbolCount

public int SymbolCount { get; }

Gets the number of symbols in the body (right-hand-side) of the rule.


TableIndex

public int TableIndex { get; }

Gets the index of this Rule in the GoldParser's rule-table.

Method Detail

GetSymbol

public GoldParser.Symbol GetSymbol(int p_index)

Returns the symbol in the body of the rule with the specified index.


ToString

public string ToString()

Returns the Backus-Naur representation of this Rule.