{
	"0: data": {
		"srcIndexStart": "0", 
		"file": "docssrc/docs.Tools.GRMC.tmpl", 
		"parseTreeMode": "true", 
		"srcLength": "3552", 
		"source": "[$name|GRMC$]
[$title|GRMC: Grammar Compiler$]
[$frame|HTMLPage.tmpl$]
<p>
Compiles a 
[$pageLink|Grammar| grammar definition file $]
to a
[$pageLink|CGT| CGT file $] (Compiled Grammar Table).
This tool can be used instead of GOLD Parser Builder. The resulting .cgt files
can be used with either Goldie or any other
[$link| http://goldparser.org/about/how-it-works.htm |GOLD Engine$].
</p>

<p>
Note that there are a few
[$pageLink|OtherTools#GOLD| GOLD Parser Builder $]
features that Goldie Grammar Compiler does not yet support:
</p>
<ul>
<li>The [$link| http://goldparser.org/5.0/index.htm | new GOLD v5.0 features $]</li>
<li>[$link| http://goldparser.org/doc/grammars/virtual-terminals.htm | Virtual terminals $]</li>
<li>User-defined terminals named [$ident|EOF$] or [$ident|Error$]</li>
</ul>

<p>
Be aware that although some grammars can be compiled in under a second,
others can take several minutes to be compiled into a CGT. In particular,
grammars that use large sets of Unicode characters or require many parsing
states tend to take significantly longer than simpler grammars.
</p>

<p>
Note: GRMC cannot be compiled with DMD 2.057 due to DMD Issue
[$link| http://d.puremagic.com/issues/show_bug.cgi?id=7375 | #7375 $].
</p>

<h3>Command-line parameters:</h3>
[$code|plain|
[:Usage: goldie-grmc grammar.grm
       goldie-grmc grammar.grm -o:output.cgt

Switches:
(Prefixes can be '/', '-' or '--')
('[]' means multiple switches are accepted)
  -help        Displays a help summary and exits
  -detail      Displays a detailed help message and exits
  <text>       (Required) Grammar definition in .grm format
  -o:<text>    Output filename
  -v           Verbose
  -gold        Imitate GOLD's output as closely as possible
  -dot         Output lexer's NFA and DFA to Graphviz DOT format:]
$]

<p>
The [$code|inline|-dot$] parameter is interesting because it allows you to
use [$link|http://www.graphviz.org/|Graphviz$] (or any other
[$link|http://en.wikipedia.org/wiki/DOT_language|DOT$]-compatible
visualization software) to create visual graphs
of the lexer's original NFA and its resulting
[$link|http://goldparser.org/articles/dfa.htm|DFA$].
</p>

<p>
The [$code|inline|-gold$] parameter needs a little clarification:
</p>

<p>
The CGTs Goldie generates are always valid GOLD-compatible files that are
functionally equivalent to the CGTs GOLD Parser Builder would generate.
But there can still be some inconsequential differences, even though the CGTs
behave exactly the same.
</p>

<p>
It's possible that another GOLD engine besides GoldieLib might mistakenly
rely on some subtle detail of GOLD Parser Builder's output. Such an engine might
accidentally handle Goldie's CGT slightly differently even though the CGTs
normally would be functionally equivalent.
</p>

<p>
If this happens, you can use the [$code|inline|-gold$] parameter:
Goldie will jump through some extra hoops trying to emulate
the normally-irrelevant details of GOLD Parser Builder as closely as possible.
It still might not be exactly the same as GOLD Parser Builder's output, but it
may at least be close enough.
</p>

<h3 class=\"list-heading\">See Also:</h3>
<ul>
<li>[$pageTitle| Grammar $]</li>
<li>[$pageTitle| CGT $]</li>
<li>[$link| http://goldparser.org/doc/grammars/index.htm | GOLD's documentation for the GRM grammar definition language $]</li>
<li>[$link| http://goldparser.org/doc/cgt/index.htm | GOLD's documentation for the CGT file format $]</li>
</ul>
", 
		"0: name": {
			"srcIndexStart": "0", 
			"data": "GRMC", 
			"srcLength": "13", 
			"0: data": {
				"srcIndexStart": "7", 
				"data": "GRMC", 
				"srcLength": "4"
			}
		}, 
		"1: data": {
			"srcIndexStart": "13", 
			"data": "
", 
			"srcLength": "2"
		}, 
		"2: title": {
			"srcIndexStart": "15", 
			"data": "GRMC: Grammar Compiler", 
			"srcLength": "32", 
			"0: data": {
				"srcIndexStart": "23", 
				"data": "GRMC: Grammar Compiler", 
				"srcLength": "22"
			}
		}, 
		"3: data": {
			"srcIndexStart": "47", 
			"data": "
", 
			"srcLength": "2"
		}, 
		"4: frame": {
			"srcIndexStart": "49", 
			"data": "HTMLPage.tmpl", 
			"srcLength": "23", 
			"0: data": {
				"srcIndexStart": "57", 
				"data": "HTMLPage.tmpl", 
				"srcLength": "13"
			}
		}, 
		"5: data": {
			"srcIndexStart": "72", 
			"data": "
<p>
Compiles a 
", 
			"srcLength": "20"
		}, 
		"6: pageLink": {
			"srcIndexStart": "92", 
			"param 0": "Grammar", 
			"data": "grammar definition file", 
			"srcLength": "46", 
			"0: data": {
				"srcIndexStart": "111", 
				"data": "grammar definition file", 
				"srcLength": "25"
			}
		}, 
		"7: data": {
			"srcIndexStart": "138", 
			"data": "
to a
", 
			"srcLength": "8"
		}, 
		"8: pageLink": {
			"srcIndexStart": "146", 
			"param 0": "CGT", 
			"data": "CGT file", 
			"srcLength": "27", 
			"0: data": {
				"srcIndexStart": "161", 
				"data": "CGT file", 
				"srcLength": "10"
			}
		}, 
		"9: data": {
			"srcIndexStart": "173", 
			"data": " (Compiled Grammar Table).
This tool can be used instead of GOLD Parser Builder. The resulting .cgt files
can be used with either Goldie or any other
", 
			"srcLength": "153"
		}, 
		"10: link": {
			"srcIndexStart": "326", 
			"param 0": "http://goldparser.org/about/how-it-works.htm", 
			"data": "GOLD Engine", 
			"srcLength": "67", 
			"0: data": {
				"srcIndexStart": "380", 
				"data": "GOLD Engine", 
				"srcLength": "11"
			}
		}, 
		"11: data": {
			"srcIndexStart": "393", 
			"data": ".
</p>

<p>
Note that there are a few
", 
			"srcLength": "43"
		}, 
		"12: pageLink": {
			"srcIndexStart": "436", 
			"param 0": "OtherTools#GOLD", 
			"data": "GOLD Parser Builder", 
			"srcLength": "50", 
			"0: data": {
				"srcIndexStart": "463", 
				"data": "GOLD Parser Builder", 
				"srcLength": "21"
			}
		}, 
		"13: data": {
			"srcIndexStart": "486", 
			"data": "
features that Goldie Grammar Compiler does not yet support:
</p>
<ul>
<li>The ", 
			"srcLength": "83"
		}, 
		"14: link": {
			"srcIndexStart": "569", 
			"param 0": "http://goldparser.org/5.0/index.htm", 
			"data": "new GOLD v5.0 features", 
			"srcLength": "71", 
			"0: data": {
				"srcIndexStart": "614", 
				"data": "new GOLD v5.0 features", 
				"srcLength": "24"
			}
		}, 
		"15: data": {
			"srcIndexStart": "640", 
			"data": "</li>
<li>", 
			"srcLength": "11"
		}, 
		"16: link": {
			"srcIndexStart": "651", 
			"param 0": "http://goldparser.org/doc/grammars/virtual-terminals.htm", 
			"data": "Virtual terminals", 
			"srcLength": "87", 
			"0: data": {
				"srcIndexStart": "717", 
				"data": "Virtual terminals", 
				"srcLength": "19"
			}
		}, 
		"17: data": {
			"srcIndexStart": "738", 
			"data": "</li>
<li>User-defined terminals named ", 
			"srcLength": "40"
		}, 
		"18: ident": {
			"srcIndexStart": "778", 
			"data": "EOF", 
			"srcLength": "13", 
			"0: data": {
				"srcIndexStart": "786", 
				"data": "EOF", 
				"srcLength": "3"
			}
		}, 
		"19: data": {
			"srcIndexStart": "791", 
			"data": " or ", 
			"srcLength": "4"
		}, 
		"20: ident": {
			"srcIndexStart": "795", 
			"data": "Error", 
			"srcLength": "15", 
			"0: data": {
				"srcIndexStart": "803", 
				"data": "Error", 
				"srcLength": "5"
			}
		}, 
		"21: data": {
			"srcIndexStart": "810", 
			"data": "</li>
</ul>

<p>
Be aware that although some grammars can be compiled in under a second,
others can take several minutes to be compiled into a CGT. In particular,
grammars that use large sets of Unicode characters or require many parsing
states tend to take significantly longer than simpler grammars.
</p>

<p>
Note: GRMC cannot be compiled with DMD 2.057 due to DMD Issue
", 
			"srcLength": "386"
		}, 
		"22: link": {
			"srcIndexStart": "1196", 
			"param 0": "http://d.puremagic.com/issues/show_bug.cgi?id=7375", 
			"data": "#7375", 
			"srcLength": "69", 
			"0: data": {
				"srcIndexStart": "1256", 
				"data": "#7375", 
				"srcLength": "7"
			}
		}, 
		"23: data": {
			"srcIndexStart": "1265", 
			"data": ".
</p>

<h3>Command-line parameters:</h3>
", 
			"srcLength": "46"
		}, 
		"24: code": {
			"srcIndexStart": "1311", 
			"param 0": "plain", 
			"data": "Usage: goldie-grmc grammar.grm
       goldie-grmc grammar.grm -o:output.cgt

Switches:
(Prefixes can be '/', '-' or '--')
('[]' means multiple switches are accepted)
  -help        Displays a help summary and exits
  -detail      Displays a detailed help message and exits
  &lt;text&gt;       (Required) Grammar definition in .grm format
  -o:&lt;text&gt;    Output filename
  -v           Verbose
  -gold        Imitate GOLD's output as closely as possible
  -dot         Output lexer's NFA and DFA to Graphviz DOT format", 
			"srcLength": "546", 
			"0: data": {
				"srcIndexStart": "1324", 
				"data": "", 
				"srcLength": "2"
			}, 
			"1: data": {
				"srcIndexStart": "1326", 
				"data": "Usage: goldie-grmc grammar.grm
       goldie-grmc grammar.grm -o:output.cgt

Switches:
(Prefixes can be '/', '-' or '--')
('[]' means multiple switches are accepted)
  -help        Displays a help summary and exits
  -detail      Displays a detailed help message and exits
  <text>       (Required) Grammar definition in .grm format
  -o:<text>    Output filename
  -v           Verbose
  -gold        Imitate GOLD's output as closely as possible
  -dot         Output lexer's NFA and DFA to Graphviz DOT format", 
				"srcLength": "527"
			}, 
			"2: data": {
				"srcIndexStart": "1853", 
				"data": "", 
				"srcLength": "2"
			}
		}, 
		"25: data": {
			"srcIndexStart": "1857", 
			"data": "

<p>
The ", 
			"srcLength": "13"
		}, 
		"26: code": {
			"srcIndexStart": "1870", 
			"param 0": "inline", 
			"data": "-dot", 
			"srcLength": "20", 
			"0: data": {
				"srcIndexStart": "1884", 
				"data": "-dot", 
				"srcLength": "4"
			}
		}, 
		"27: data": {
			"srcIndexStart": "1890", 
			"data": " parameter is interesting because it allows you to
use ", 
			"srcLength": "56"
		}, 
		"28: link": {
			"srcIndexStart": "1946", 
			"param 0": "http://www.graphviz.org/", 
			"data": "Graphviz", 
			"srcLength": "42", 
			"0: data": {
				"srcIndexStart": "1978", 
				"data": "Graphviz", 
				"srcLength": "8"
			}
		}, 
		"29: data": {
			"srcIndexStart": "1988", 
			"data": " (or any other
", 
			"srcLength": "16"
		}, 
		"30: link": {
			"srcIndexStart": "2004", 
			"param 0": "http://en.wikipedia.org/wiki/DOT_language", 
			"data": "DOT", 
			"srcLength": "54", 
			"0: data": {
				"srcIndexStart": "2053", 
				"data": "DOT", 
				"srcLength": "3"
			}
		}, 
		"31: data": {
			"srcIndexStart": "2058", 
			"data": "-compatible
visualization software) to create visual graphs
of the lexer's original NFA and its resulting
", 
			"srcLength": "109"
		}, 
		"32: link": {
			"srcIndexStart": "2167", 
			"param 0": "http://goldparser.org/articles/dfa.htm", 
			"data": "DFA", 
			"srcLength": "51", 
			"0: data": {
				"srcIndexStart": "2213", 
				"data": "DFA", 
				"srcLength": "3"
			}
		}, 
		"33: data": {
			"srcIndexStart": "2218", 
			"data": ".
</p>

<p>
The ", 
			"srcLength": "20"
		}, 
		"34: code": {
			"srcIndexStart": "2238", 
			"param 0": "inline", 
			"data": "-gold", 
			"srcLength": "21", 
			"0: data": {
				"srcIndexStart": "2252", 
				"data": "-gold", 
				"srcLength": "5"
			}
		}, 
		"35: data": {
			"srcIndexStart": "2259", 
			"data": " parameter needs a little clarification:
</p>

<p>
The CGTs Goldie generates are always valid GOLD-compatible files that are
functionally equivalent to the CGTs GOLD Parser Builder would generate.
But there can still be some inconsequential differences, even though the CGTs
behave exactly the same.
</p>

<p>
It's possible that another GOLD engine besides GoldieLib might mistakenly
rely on some subtle detail of GOLD Parser Builder's output. Such an engine might
accidentally handle Goldie's CGT slightly differently even though the CGTs
normally would be functionally equivalent.
</p>

<p>
If this happens, you can use the ", 
			"srcLength": "644"
		}, 
		"36: code": {
			"srcIndexStart": "2903", 
			"param 0": "inline", 
			"data": "-gold", 
			"srcLength": "21", 
			"0: data": {
				"srcIndexStart": "2917", 
				"data": "-gold", 
				"srcLength": "5"
			}
		}, 
		"37: data": {
			"srcIndexStart": "2924", 
			"data": " parameter:
Goldie will jump through some extra hoops trying to emulate
the normally-irrelevant details of GOLD Parser Builder as closely as possible.
It still might not be exactly the same as GOLD Parser Builder's output, but it
may at least be close enough.
</p>

<h3 class=\"list-heading\">See Also:</h3>
<ul>
<li>", 
			"srcLength": "324"
		}, 
		"38: pageTitle": {
			"srcIndexStart": "3248", 
			"data": "Grammar", 
			"srcLength": "23", 
			"0: data": {
				"srcIndexStart": "3260", 
				"data": "Grammar", 
				"srcLength": "9"
			}
		}, 
		"39: data": {
			"srcIndexStart": "3271", 
			"data": "</li>
<li>", 
			"srcLength": "11"
		}, 
		"40: pageTitle": {
			"srcIndexStart": "3282", 
			"data": "CGT", 
			"srcLength": "19", 
			"0: data": {
				"srcIndexStart": "3294", 
				"data": "CGT", 
				"srcLength": "5"
			}
		}, 
		"41: data": {
			"srcIndexStart": "3301", 
			"data": "</li>
<li>", 
			"srcLength": "11"
		}, 
		"42: link": {
			"srcIndexStart": "3312", 
			"param 0": "http://goldparser.org/doc/grammars/index.htm", 
			"data": "GOLD's documentation for the GRM grammar definition language", 
			"srcLength": "118", 
			"0: data": {
				"srcIndexStart": "3366", 
				"data": "GOLD's documentation for the GRM grammar definition language", 
				"srcLength": "62"
			}
		}, 
		"43: data": {
			"srcIndexStart": "3430", 
			"data": "</li>
<li>", 
			"srcLength": "11"
		}, 
		"44: link": {
			"srcIndexStart": "3441", 
			"param 0": "http://goldparser.org/doc/cgt/index.htm", 
			"data": "GOLD's documentation for the CGT file format", 
			"srcLength": "97", 
			"0: data": {
				"srcIndexStart": "3490", 
				"data": "GOLD's documentation for the CGT file format", 
				"srcLength": "46"
			}
		}, 
		"45: data": {
			"srcIndexStart": "3538", 
			"data": "</li>
</ul>", 
			"srcLength": "14"
		}
	}
}