the write init command. If there is no main machine, cs is initialized to the
entry point of the last machine instantiation.
git-svn-id: http://svn.complang.org/ragel/trunk@155
052ea7fc-9027-0410-9066-
f65837a77df0
syntax region rlWrite matchgroup=Type start="\<write\>" matchgroup=NONE end=";" contained contains=rlWriteKeywords,rlWriteOptions
syntax keyword rlWriteKeywords init data exec eof exports contained
-syntax keyword rlWriteOptions noerror nofinal noprefix noend contained
+syntax keyword rlWriteOptions noerror nofinal noprefix noend nocs contained
"
" Sync at the start of machine specs.
writeConditions();
/* Start state. */
- GraphDictEl *mainEl = pd->graphDict.find( mainMachine );
- if ( mainEl != 0 ) {
- out << " <start_state>" << fsm->startState->alg.stateNum <<
+ out << " <start_state>" << fsm->startState->alg.stateNum <<
"</start_state>\n";
- }
/* Error state. */
if ( fsm->errState != 0 ) {
hasEnd(true),
dataPrefix(true),
writeFirstFinal(true),
- writeErr(true)
+ writeErr(true),
+ writeCS(true)
{}
}
else if ( strcmp( args[0], "init" ) == 0 ) {
for ( int i = 1; i < nargs; i++ ) {
- source_warning(loc) << "unrecognized write option \"" <<
- args[i] << "\"" << endl;
+ if ( strcmp( args[i], "nocs" ) == 0 )
+ writeCS = false;
+ else {
+ source_warning(loc) << "unrecognized write option \"" <<
+ args[i] << "\"" << endl;
+ }
}
writeInit();
}
bool dataPrefix;
bool writeFirstFinal;
bool writeErr;
+ bool writeCS;
void createMachine();
void initActionList( unsigned long length );
{
out << " {\n";
- if ( redFsm->startState != 0 )
+ if ( writeCS )
out << "\t" << CS() << " = " << START() << ";\n";
/* If there are any calls, then the stack top needs initialization. */
{
out << " {\n";
- if ( redFsm->startState != 0 )
+ if ( writeCS )
out << "\t" << CS() << " = " << START() << ";\n";
/* If there are any calls, then the stack top needs initialization. */
{
out << INDENT_U() << "begin";
- if ( redFsm->startState != 0 )
+ if ( writeCS )
out << INDENT_S() << CS() << " = " << START();
/* If there are any calls, then the stack top needs initialization. */
int cs = test_en_commands;
const char *p = data, *pe = data + len;
- %% write init;
+ %% write init nocs;
%% write exec;
if ( cs >= test_first_final )
int cs = test_en_commands, p = 0, pe = data.length;
int top;
- %% write init;
+ %% write init nocs;
%% write exec;
if ( cs >= test_first_final )
val = 0;
neg = false;
+ %% write init nocs;
%% write exec;
%% write eof;
if cs >= test_first_final
int cs = test_en_commands;
char *p = data.ptr, pe = data.ptr + data.length;
- %% write init;
+ %% write init nocs;
%% write exec;
if ( cs >= test_first_final )