[$name|Base$]
[$title|Base$]
[$frame|HTMLPage.tmpl$]

<ul>
<li>[$typeLink| CharSet      | struct CharSet      $]</li>
<li>[$pageLink| #Symbol      | struct Symbol       $]</li>
<li>[$typeLink| Rule         | struct Rule         $]</li>
<li>[$typeLink| DFAState     | struct DFAState     $]</li>
<li>[$typeLink| DFAStateEdge | struct DFAStateEdge $]</li>
<li>[$typeLink| LALRState    | struct LALRState    $]</li>
<li>[$typeLink| LALRAction   | struct LALRAction   $]</li>
</ul>

<p>
These types store the information contained in a
[$pageLink| CGT | CGT file $].
For more information on what these actually mean, see GOLD's documentation on
[$link| http://www.devincook.com/goldparser/articles/dfa.htm | DFA Lexing $],
[$link| http://www.devincook.com/goldparser/articles/lalr.htm | LALR(1) Parsing $],
and the
[$link| http://www.devincook.com/goldparser/doc/cgt/index.htm | CGT file format $].
</p>
<p>
Most users of GoldieLib will only need to deal directly with [$typeName|Symbol$].
</p>

[$apiSectionType| CharSet | goldie.base | struct CharSet $]
<div class="api-def">
	[$apiHead|[: dstring chars :]$]
	<div class="api-def">
		A dstring containing all the characters contained in this character set.
	</div>

	[$apiHead|[: string toString() :]$]
	<div class="api-def">
		The result of this is valid D code representing a struct literal.
		For example:
[$code|highlight|
[:auto charSet = CharSet("ABC123"d);
assert(charSet.toString() == `CharSet("ABC123"d)`);
:]$]
	</div>
</div>

[$apiSection| Symbol | goldie.base | struct Symbol $]
<div class="api-def">
	See the [$pageTitle|Symbol$] page.
</div>

[$apiSectionType| Rule | goldie.base | struct Rule $]
<div class="api-def">
	[$apiHead|[: int symbolIndex :]$]
	<div class="api-def">
	<p>
		The nonterminal symbol this rule reduces to.
	</p>
	<p>
		This is an index into [$typeName|Language$][$ident|.symbolTable$].
	</p>
	</div>

	[$apiHead|[: int[] subSymbolIndicies :]$]
	<div class="api-def">
	<p>
		The symbols that get reduced by this rule.
	</p>
	<p>
		These are indicies into [$typeName|Language$][$ident|.symbolTable$].
	</p>
	</div>

	[$apiHead|[: string toString() :]$]
	<div class="api-def">
		The result of this is valid D code representing a struct literal.
		For example:
[$code|highlight|
[:auto rule = Rule(10, [2, 3, 4]);
assert(rule.toString() == `Rule( 10, [2, 3, 4] )`);
:]$]
	</div>
</div>

[$apiSectionType| DFAState | goldie.base | struct DFAState $]
<div class="api-def">
	[$apiHead|[: bool accept :]$]
	<div class="api-def">
		Is this an "accept" state?
	</div>

	[$apiHead|[: int acceptSymbolIndex :]$]
	<div class="api-def">
	<p>
		If this is an accept state, [$ident|acceptSymbolIndex$] refers to
		the symbol that has been found.
	</p>
	<p>
		This is an index into [$typeName|Language$][$ident|.symbolTable$].
	</p>
	</div>

	[$apiHead|[: DFAStateEdge[] edges :]$]
	<div class="api-def">
	<p>
		The DFA edges leading away from this state.
	</p>
	<p>
		For more information,
		see [$typeName|DFAStateEdge$] and GOLD's documentation on
		[$link| http://www.devincook.com/goldparser/articles/dfa.htm | DFA Lexing $]
		and the
		[$link| http://www.devincook.com/goldparser/doc/cgt/index.htm | CGT file format $].
	</p>
	</div>

	[$apiHead|[: string toString() :]$]
	<div class="api-def">
		The result of this is valid D code representing a struct literal.
		For example:
[$code|highlight|
[:auto dfaState = DFAState(true, 5, [ DFAStateEdge(3, 8) ]);
assert(dfaState.toString() == `DFAState( true, 5, [DFAStateEdge(3,8)] )`);
:]$]
	</div>
</div>

[$apiSectionType| DFAStateEdge | goldie.base | struct DFAStateEdge $]
<div class="api-def">
	<p>
		If the current character being scanned by the [$typeName|Lexer$]
		is in the character set referred to by [$ident|charSetIndex$],
		then the [$typeName|Lexer$] moves to the DFA state referred to by
		[$ident|targetDFAStateIndex$].
	</p>
	<p>
		For more information, see GOLD's documentation on
		[$link| http://www.devincook.com/goldparser/articles/dfa.htm | DFA Lexing $]
		and the
		[$link| http://www.devincook.com/goldparser/doc/cgt/index.htm | CGT file format $].
	</p>
	[$apiHead|[: int charSetIndex :]$]
	<div class="api-def">
		This is an index into [$typeName|Language$][$ident|.charSetTable$].
	</div>

	[$apiHead|[: int targetDFAStateIndex :]$]
	<div class="api-def">
		This is an index into [$typeName|Language$][$ident|.dfaTable$].
	</div>

	[$apiHead|[: string toString() :]$]
	<div class="api-def">
		The result of this is valid D code representing a struct literal.
		For example:
[$code|highlight|
[:auto dfaEdge = DFAStateEdge(3, 8);
assert(dfaEdge.toString() == `DFAStateEdge(3,8)`);
:]$]
	</div>
</div>

[$apiSectionType| LALRState | goldie.base | struct LALRState $]
<div class="api-def">
	[$apiHead|[: LALRAction[] actions :]$]
	<div class="api-def">
	<p>
		The possible LALR actions associated with this state.
	</p>
	<p>
		For more information, see GOLD's documentation on
		[$link| http://www.devincook.com/goldparser/articles/lalr.htm | LALR Parsing $]
		and the
		[$link| http://www.devincook.com/goldparser/doc/cgt/index.htm | CGT file format $].
	</p>
	</div>

	[$apiHead|[: string toString() :]$]
	<div class="api-def">
		The result of this is valid D code representing a struct literal.
		For example:
[$code|highlight|
[:auto lalrState = LALRState([ LALRAction(7, LALRAction.Type.Shift, 10) ]);
assert(lalrState.toString() == `LALRState( [LALRAction(7,LALRAction.Type.Shift,10)] )`);
:]$]
	</div>
</div>

[$apiSectionType| LALRAction | goldie.base | struct LALRAction $]
<div class="api-def">
	[$apiHead|[: enum Type :]$]
	<div class="api-def">
		The definition of [$ident|LALRAction.Type$] is:
[$code|highlight|
[:enum Type
{
    Shift  = 1, // target: LALR State Index
    Reduce = 2, // target: Rule Index
    Goto   = 3, // target: LALR State Index
    Accept = 4  // target: unused
}
:]$]
	</div>

	[$apiHead|[: int symbolId :]$]
	<div class="api-def">
	<p>
		The symbol expected in order for the [$typeName|Parser$] to take
		this branch of the LALR graph.
	</p>
	<p>
		This is an index into [$typeName|Language$][$ident|.symbolTable$].
	</p>
	<p>
		For more information, see the definition of enum [$ident|Type$] above,
		as well as GOLD's documentation on
		[$link| http://www.devincook.com/goldparser/articles/lalr.htm | LALR Parsing $]
		and the
		[$link| http://www.devincook.com/goldparser/doc/cgt/index.htm | CGT file format $].
	</p>
	</div>

	[$apiHead|[: Type type :]$]
	<div class="api-def">
	<p>
		The type of this state.
	</p>
	<p>
		For more information, see the definition of enum [$ident|Type$] above,
		as well as GOLD's documentation on
		[$link| http://www.devincook.com/goldparser/articles/lalr.htm | LALR Parsing $]
		and the
		[$link| http://www.devincook.com/goldparser/doc/cgt/index.htm | CGT file format $].
	</p>
	</div>

	[$apiHead|[: int target :]$]
	<div class="api-def">
	<p>
		Extra information associated with this LALR state.
		The exact meaning of this depends on the value of [$ident|type$].
	</p>
	<p>
		For more information, see the definition of enum [$ident|Type$] above,
		as well as GOLD's documentation on
		[$link| http://www.devincook.com/goldparser/articles/lalr.htm | LALR Parsing $]
		and the
		[$link| http://www.devincook.com/goldparser/doc/cgt/index.htm | CGT file format $].
	</p>
	</div>

	[$apiHead|[: string toString() :]$]
	<div class="api-def">
		The result of this is valid D code representing a struct literal.
		For example:
[$code|highlight|
[:auto lalrAction = LALRAction(7, LALRAction.Type.Shift, 10);
assert(lalrAction.toString() == `LALRAction(7,LALRAction.Type.Shift,10)`);
:]$]
	</div>

	[$apiHead|[: static string typeToString(Type type) :]$]
	<div class="api-def">
		Example:
[$code|highlight|
[:string str = LALRAction.typeToString(LALRAction.Type.Reduce);
assert(str == "Reduce");
:]$]
	</div>

	[$apiHead|[: static string fullTypeToString(Type type) :]$]
	<div class="api-def">
		Example:
[$code|highlight|
[:string str = LALRAction.fullTypeToString(LALRAction.Type.Reduce);
assert(str == "LALRAction.Type.Reduce");
:]$]
	</div>
</div>
