Commit c879aa1e authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Introduce StringTemplate

Text-based backends could benefit from String Template: better
maintainability, easier indenting, no mix between code and templates,
etc. This initial commit just puts in place the approach ; everything
has to be done from there.
parent b9c5d7fd
This diff is collapsed.
group ads;
process(name) ::= <<
-- This file was generated automatically: DO NOT MODIFY !
package <name> is
end <name>;
>>
/* just a test */
vardef(type, name) ::= "<type> <name>;"
......@@ -54,6 +54,10 @@ import singledispatch # NOQA
import Asn1scc # NOQA
import Connectors # NOQA
import TextInteraction # NOQA
try:
import stringtemplate3 # NOQA
except ImportError:
pass
#from PySide import phonon
......@@ -99,6 +103,12 @@ try:
except ImportError:
LlvmGenerator = None
try:
import StgBackend
except ImportError:
StgBackend = False
__all__ = ['opengeode', 'SDL_Scene', 'SDL_View', 'parse']
__version__ = '1.0RC2'
......@@ -1996,12 +2006,13 @@ def init_logging(options):
Clipboard,
Statechart,
Helper,
LlvmGenerator,
Asn1scc,
Connectors,
Pr,
TextInteraction,
Connectors
Connectors,
LlvmGenerator,
StgBackend
)
for module in modules:
module.LOG.addHandler(handler_console)
......@@ -2037,6 +2048,7 @@ def generate(process, options):
LOG.info('Generating Ada code')
try:
AdaGenerator.generate(process, simu=options.shared)
StgBackend.generate(process, simu=options.shared) # TEMP
except (TypeError, ValueError, NameError) as err:
LOG.error(str(err))
LOG.debug(str(traceback.format_exc()))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment