Class Reduction

Extends: System.Object

This class is used by the engine to hold a reduced rule. Rather than contain a list of Symbols, a reduction contains a list of Tokens corresponding to the the rule it represents. This class is important since it is used to store the actual source program parsed by the Engine.

Public Properties
ParentRule
Returns the Rule that this Reduction represents. 
Tag
This is a general purpose field that can be used at the developer's leisure. 
Tokens
Returns an ArrayList containing the Tokens in this reduction. 

Public Methods
Accept
Makes the IGoldVisitor visit this Reduction
ChildrenAccept
Makes the IGoldVisitor visit the children of this Reduction
GetToken
Returns the token with the specified index. 
ToString
Returns a string-representation of this Reduction. 

Property Detail

ParentRule

public GoldParser.Rule ParentRule { get; set; }
Returns the Rule that this Reduction represents.

Tag

public object Tag { get; set; }
This is a general purpose field that can be used at the developer's leisure.

Tokens

public System.Collections.ArrayList Tokens { get; }
Returns an ArrayList containing the Tokens in this reduction.
Method Detail

Accept

public void Accept(GoldParser.IGoldVisitor p_visitor)
Makes the IGoldVisitor visit this Reduction.
Example
See the GoldTest sample project.

ChildrenAccept

public void ChildrenAccept(GoldParser.IGoldVisitor p_visitor)
Makes the IGoldVisitor visit the children of this Reduction.
Example
See the GoldTest sample project.

GetToken

public GoldParser.Token GetToken(int p_index)
Returns the token with the specified index.

ToString

public string ToString()
Returns a string-representation of this Reduction.