diff options
author | Adrian Thurston <thurston@complang.org> | 2007-03-10 23:21:36 +0000 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2007-03-10 23:21:36 +0000 |
commit | 45708f34570ee21801a42415ff3a517ce1b2ac26 (patch) | |
tree | 197cfad7ee8a9d139d649e524a9ef154f780b0d0 /ragel/xmlcodegen.cpp | |
parent | 772cfeae2e912c8341e33f3b4eb8ca8907333cb7 (diff) | |
download | ragel-45708f34570ee21801a42415ff3a517ce1b2ac26.tar.gz |
Implemented an export feature, for exporting single-character machine
definitions in #define format.
Changed function names: writeOut*() => write*().
Diffstat (limited to 'ragel/xmlcodegen.cpp')
-rw-r--r-- | ragel/xmlcodegen.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ragel/xmlcodegen.cpp b/ragel/xmlcodegen.cpp index f2bb5916..b07c82a1 100644 --- a/ragel/xmlcodegen.cpp +++ b/ragel/xmlcodegen.cpp @@ -656,6 +656,19 @@ void XMLCodeGen::writeConditions() } } +void XMLCodeGen::writeExports() +{ + if ( pd->exportList.length() > 0 ) { + out << " <exports>\n"; + for ( ExportList::Iter exp = pd->exportList; exp.lte(); exp++ ) { + out << " <ex name=\"" << exp->name << "\">"; + writeKey( exp->key ); + out << "</ex>\n"; + } + out << " </exports>\n"; + } +} + void XMLCodeGen::writeXML() { /* Open the definition. */ @@ -671,6 +684,8 @@ void XMLCodeGen::writeXML() if ( pd->curStateExpr != 0 ) writeCurStateExpr(); + writeExports(); + writeMachine(); out << |