summaryrefslogtreecommitdiff
path: root/src/common.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/common.cc')
-rw-r--r--src/common.cc74
1 files changed, 0 insertions, 74 deletions
diff --git a/src/common.cc b/src/common.cc
index 027b945c..b36dcace 100644
--- a/src/common.cc
+++ b/src/common.cc
@@ -27,80 +27,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 )
{