[$name|Grammar$]
[$title|Grammar Definition Language$]
[$frame|HTMLPage.tmpl$]
<p>
Goldie uses the same
[$link| http://www.devincook.com/goldparser/doc/grammars/index.htm | GOLD Meta-Language $]
grammar definition language as
[$pageLink| OtherTools#GOLD | GOLD Parser Builder $].
</p>

<p>
GOLD Parser Builder includes
a grammar editor that features syntax highlighting, a grammar-generating wizard,
and importing/exporting with YACC/Bison format.
Goldie's
[$link| http://www.dsource.org/projects/goldie/browser/tags/v0.4/lang/calc.grm | calc.grm $]
grammar below was created by using GOLD's grammar wizard (and slightly modifying the result).
</p>

<p>
Other
[$link|http://www.devincook.com/goldparser/grammars/index.htm| premade grammars $]
can be found in
[$link|http://www.devincook.com/goldparser/download.htm| GOLD's downloads section $].
</p>

<h2>Sample</h2>
<p>
As a simple example of what a grammar looks like, this is the
[$link| http://www.dsource.org/projects/goldie/browser/tags/v0.4/lang/calc.grm | calc.grm $]
grammar included with Goldie and used by the [$pageLink|SampleApps| Sample Apps $]:
<br /><br />
[$code|plain|
[:! -- Parameters ----------------------------------------
! Basic Calculator Grammar
! Supports integer literals, + - * / () and whitespace

"Name"     = 'Calc'
"Author"   = 'GOLD Parser Builder and Nick Sabalausky'
"Version"  = '0.01'
"About"    = 'Basic Calculator Grammar'
"Case Sensitive" = false

"Start Symbol" = &lt;Add Exp&gt;

! -- Terminals -----------------------------------------

Number = {Digit}+
Whitespace = {Whitespace}+

! -- Rules ---------------------------------------------

&lt;Add Exp&gt;     ::= &lt;Add Exp&gt; '+' &lt;Mult Exp&gt;
               |  &lt;Add Exp&gt; '-' &lt;Mult Exp&gt;
               |  &lt;Mult Exp&gt;

&lt;Mult Exp&gt;    ::= &lt;Mult Exp&gt; '*' &lt;Negate Exp&gt;
               |  &lt;Mult Exp&gt; '/' &lt;Negate Exp&gt;
               |  &lt;Negate Exp&gt;

&lt;Negate Exp&gt;  ::= '-' &lt;Value&gt;
               |  &lt;Value&gt; 

&lt;Value&gt;       ::= 'Number'
               |  '(' &lt;Add Exp&gt; ')':]
$]
</p>

<h2>Current Limitations</h2>
<p>
There are a few GOLD features that Goldie doesn't yet support:
</p>

<ul>
<li>All of Goldie: The [$link| http://www.devincook.com/goldparser/v4.2.htm | new GOLD v4.2 features $]</li>
<li>All of Goldie: [$link| http://www.devincook.com/goldparser/doc/grammars/virtual-terminals.htm | Virtual terminals $]</li>
<li>Goldie's [$pageLink|GRMC|grmc$]: User-defined terminals named [$ident|EOF$] or [$ident|Error$]</li>
<li>Goldie's [$pageLink|GRMC|grmc$]: The [$ident|{All Valid}$] character set</li>
</ul>

<h3 class="list-heading">See Also:</h3>
<ul>
<li>[$link| http://www.devincook.com/goldparser/doc/grammars/index.htm | Official GOLD Meta-Language documentation $]</li>
<li>[$pageLink| APIOver#TokenSymbol | Tokens, Symbols, and Symbol Types: The Front-End's Building Blocks $]</li>
<li>[$link| http://www.dsource.org/projects/goldie/browser/tags/v0.4/lang/calc.grm | Sample calculator grammar $]</li>
<li>[$link| http://www.devincook.com/goldparser/grammars/index.htm | Premade Grammars $]</li>
</ul>

