diff options
Diffstat (limited to 'src/libfsm/common.cc')
-rw-r--r-- | src/libfsm/common.cc | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/src/libfsm/common.cc b/src/libfsm/common.cc index 9a14a290..97715b82 100644 --- a/src/libfsm/common.cc +++ b/src/libfsm/common.cc @@ -26,81 +26,6 @@ #include <assert.h> #include "ragel.h" -/* - * C - */ - -const char *defaultOutFnC( const char *inputFileName ) -{ - const char *ext = findFileExtension( inputFileName ); - if ( ext != 0 && strcmp( ext, ".rh" ) == 0 ) - return fileNameFromStem( inputFileName, ".h" ); - else - return fileNameFromStem( inputFileName, ".c" ); -} - -HostType hostTypesC[] = -{ - { "char", 0, "char", (CHAR_MIN != 0), true, false, SCHAR_MIN, SCHAR_MAX, 0, UCHAR_MAX, sizeof(char) }, - { "signed", "char", "char", true, true, false, SCHAR_MIN, SCHAR_MAX, 0, 0, sizeof(signed char) }, - { "unsigned", "char", "uchar", false, true, false, 0, 0, 0, UCHAR_MAX, sizeof(unsigned char) }, - { "short", 0, "short", true, true, false, SHRT_MIN, SHRT_MAX, 0, 0, sizeof(short) }, - { "signed", "short", "short", true, true, false, SHRT_MIN, SHRT_MAX, 0, 0, sizeof(signed short) }, - { "unsigned", "short", "ushort", false, true, false, 0, 0, 0, USHRT_MAX, sizeof(unsigned short) }, - { "int", 0, "int", true, true, false, INT_MIN, INT_MAX, 0, 0, sizeof(int) }, - { "signed", "int", "int", true, true, false, INT_MIN, INT_MAX, 0, 0, sizeof(signed int) }, - { "unsigned", "int", "uint", false, true, false, 0, 0, 0, UINT_MAX, sizeof(unsigned int) }, - { "long", 0, "long", true, true, false, LONG_MIN, LONG_MAX, 0, 0, sizeof(long) }, - { "signed", "long", "long", true, true, false, LONG_MIN, LONG_MAX, 0, 0, sizeof(signed long) }, - { "unsigned", "long", "ulong", false, true, false, 0, 0, 0, ULONG_MAX, sizeof(unsigned long) }, -}; - -const HostLang hostLangC = { - hostTypesC, - 12, - 0, - true, - false, /* loopLabels */ - Direct, - GotoFeature, - &makeCodeGen, - &defaultOutFnC, - &genLineDirectiveC -}; - -/* - * ASM - */ -const char *defaultOutFnAsm( const char *inputFileName ) -{ - return fileNameFromStem( inputFileName, ".s" ); -} - -HostType hostTypesAsm[] = -{ - { "char", 0, "char", true, true, false, CHAR_MIN, CHAR_MAX, 0, 0, sizeof(char) }, - { "unsigned", "char", "uchar", false, true, false, 0, 0, 0, UCHAR_MAX, sizeof(unsigned char) }, - { "short", 0, "short", true, true, false, SHRT_MIN, SHRT_MAX, 0, 0, sizeof(short) }, - { "unsigned", "short", "ushort", false, true, false, 0, 0, 0, USHRT_MAX, sizeof(unsigned short) }, - { "int", 0, "int", true, true, false, INT_MIN, INT_MAX, 0, 0, sizeof(int) }, - { "unsigned", "int", "uint", false, true, false, 0, 0, 0, UINT_MAX, sizeof(unsigned int) }, - { "long", 0, "long", true, true, false, LONG_MIN, LONG_MAX, 0, 0, sizeof(long) }, - { "unsigned", "long", "ulong", false, true, false, 0, 0, 0, ULONG_MAX, sizeof(unsigned long) }, -}; - -const HostLang hostLangAsm = { - hostTypesAsm, - 8, - 0, - true, - false, /* loopLabels */ - Direct, - GotoFeature, - &makeCodeGenAsm, - &defaultOutFnC, - &genLineDirectiveAsm -}; - HostType *findAlphType( const HostLang *hostLang, const char *s1 ) { for ( int i = 0; i < hostLang->numHostTypes; i++ ) { |