TupleCompiler

The TupleCompiler converts you input to a tuple at compile-time. The default node parser simply adds the "matches" as an unnamed string[].

The parser works in two phases, and generates code of the form "Tuple!(types...)(values...)". This can be assigned to an enum.

As in the ordinary compiler, the parser/generator methods should be overridden to parse nodes from your grammar.

There are two overrides per-node in the tuple generator - the type, and the value. The compileType returns a string; either single type, or a string of the form 'type,"name"', which would add the type as a named field in the tuple.

The compileValue method returns a string - the code to mixin when the value is computed.

This version of the compilerOverride template takes three string parameters:

the name of the node type, the code to mixin to generate the "type" portion of the Tuple! created to represent that node, and a code string to mixin to generate the "value" part of the tuple (ie the argument to the tuple constructor).

Members

Mixins

__anonymous
mixin Compiler!(T, Parser)
Undocumented in source.

Static functions

compileChildTypes
string[] compileChildTypes()
Undocumented in source. Be warned that the author may not have intended to support it.
compileChildValues
string[] compileChildValues()
Undocumented in source. Be warned that the author may not have intended to support it.
compileNode
string compileNode()
Undocumented in source. Be warned that the author may not have intended to support it.
compileType
string compileType()
Undocumented in source. Be warned that the author may not have intended to support it.
compileValue
string compileValue()
Undocumented in source. Be warned that the author may not have intended to support it.

Templates

compilerOverride
template compilerOverride(string Name, string TypeF, string ValueF)
Undocumented in source.
nodeOverride
template nodeOverride(string Cond, string TypeFunc, string ValueFunc)
Undocumented in source.
tupleTypes
template tupleTypes()
Undocumented in source.
tupleValues
template tupleValues()
Undocumented in source.

Meta