##LANGUAGE 'GNU Make'
##ENGINE-NAME 'Mybuild'
##TEMPLATE-NAME 'Symbol constructors'
##AUTHOR 'Eldar Abusalimov'
##FILE-EXTENSION 'mk'
##NOTES
Generates constructor stubs for each symbol of your grammar.
In general you have to name this file the same as base name of the main script
with '-symbols' suffix.
##END-NOTES
##DELIMITER ','
##ID-SEPARATOR '_'
# Generated by GOLD Parser Builder using Mybuild program template.

##PARAMETERS
# Symbol constructors for '%Name%' grammar.
##END-PARAMETERS

#
# Each terminal symbol is converted by the corresponding constructor (if any).
# Constructor is a function named '$(gold_grammar)_create-<ID>' (where ID is
# a unique symbol identifier) with the following signature:
#
# Params:
#   1. A list of decimal char codes representing the token.
#
# Return:
#   The converted value, which is then passed as an argument to a production
#   function of the rule containing that symbol in its RHS.
#
# If constructor for some symbol is not defined then the default behavior
# is used, which is to decode an input by replacing all printable characters
# with their values and the rest ones with spaces.
#
# Constructor may also use a special 'gold_default_create' function to get
# the default value.
#

#
# TODO You can safely remove any constructor if the default behavior is ok.
#
# TODO Due to current limitations of template generator a definition
# is generated for all existing symbols, although functions for nonterminal
# symbols are never actually used.
#

##SYMBOLS
# Symbol: %Description%
define $(gold_grammar)_create-%ID%
	$(gold_default_create)# TODO Auto-generated stub!
endef

##END-SYMBOLS

#
# Optimized contructors for constant terminals (i.e. keywords and punctuation).
#
# TODO Uncomment (and fix if needed) the lines corresponding to terminals
# which are known to be immutable. This eliminates the need to convert them
# from an input each time when a new token arrives.
#

##SYMBOLS
#$(gold_grammar)_create-%ID% %Col:41%:= %ID%
##END-SYMBOLS

#
# For each regular terminal we also define a constant with a human-readable
# description used for error reporting.
#
# TODO Due to current limitations of template generator a definition
# is generated for all existing symbols, although variables for nonterminals
# are never actually used.
#

##SYMBOLS
$(gold_grammar)_name_of-%ID% %Col:40%:= %Description%
##END-SYMBOLS

