summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2021-11-07 15:24:11 -0800
committerAdrian Thurston <thurston@colm.net>2021-11-07 15:24:11 -0800
commit6877df322fe8bbcf05212dd6bf333ba4d6564c4f (patch)
tree43eb92ed7bff122d58a0d7640d9d1eb9b55787c8
parent34c1750600a14193b74915bfd4d53bac61e77788 (diff)
downloadcolm-6877df322fe8bbcf05212dd6bf333ba4d6564c4f.tar.gz
moved the findAlphType code over to ragel
-rw-r--r--src/libfsm/common.cc37
-rw-r--r--src/libfsm/common.h4
-rw-r--r--src/libfsm/gendata.cc12
-rw-r--r--src/libfsm/gendata.h1
4 files changed, 0 insertions, 54 deletions
diff --git a/src/libfsm/common.cc b/src/libfsm/common.cc
index 97715b82..7a4df841 100644
--- a/src/libfsm/common.cc
+++ b/src/libfsm/common.cc
@@ -26,43 +26,6 @@
#include <assert.h>
#include "ragel.h"
-HostType *findAlphType( const HostLang *hostLang, const char *s1 )
-{
- for ( int i = 0; i < hostLang->numHostTypes; i++ ) {
- if ( strcmp( s1, hostLang->hostTypes[i].data1 ) == 0 &&
- hostLang->hostTypes[i].data2 == 0 )
- {
- return hostLang->hostTypes + i;
- }
- }
-
- return 0;
-}
-
-HostType *findAlphType( const HostLang *hostLang, const char *s1, const char *s2 )
-{
- for ( int i = 0; i < hostLang->numHostTypes; i++ ) {
- if ( strcmp( s1, hostLang->hostTypes[i].data1 ) == 0 &&
- hostLang->hostTypes[i].data2 != 0 &&
- strcmp( s2, hostLang->hostTypes[i].data2 ) == 0 )
- {
- return hostLang->hostTypes + i;
- }
- }
-
- return 0;
-}
-
-HostType *findAlphTypeInternal( const HostLang *hostLang, const char *s1 )
-{
- for ( int i = 0; i < hostLang->numHostTypes; i++ ) {
- if ( strcmp( s1, hostLang->hostTypes[i].internalName ) == 0 )
- return hostLang->hostTypes + i;
- }
-
- return 0;
-}
-
std::streamsize output_filter::countAndWrite( const char *s, std::streamsize n )
{
for ( int i = 0; i < n; i++ ) {
diff --git a/src/libfsm/common.h b/src/libfsm/common.h
index 980118f1..2be2bb55 100644
--- a/src/libfsm/common.h
+++ b/src/libfsm/common.h
@@ -242,10 +242,6 @@ void genLineDirectiveC( std::ostream &out, bool nld, int line, const char *file
void genLineDirectiveAsm( std::ostream &out, bool nld, int line, const char *file );
void genLineDirectiveTrans( std::ostream &out, bool nld, int line, const char *file );
-HostType *findAlphType( const HostLang *hostLang, const char *s1 );
-HostType *findAlphType( const HostLang *hostLang, const char *s1, const char *s2 );
-HostType *findAlphTypeInternal( const HostLang *hostLang, const char *s1 );
-
/* An abstraction of the key operators that manages key operations such as
* comparison and increment according the signedness of the key. */
struct KeyOps
diff --git a/src/libfsm/gendata.cc b/src/libfsm/gendata.cc
index 718b0d38..355ed12c 100644
--- a/src/libfsm/gendata.cc
+++ b/src/libfsm/gendata.cc
@@ -864,9 +864,6 @@ void Reducer::makeMachine()
void Reducer::make( const HostLang *hostLang, const HostType *alphType )
{
- /* Alphabet type. */
- setAlphType( hostLang, alphType->internalName );
-
/* Getkey expression. */
if ( fsmCtx->getKeyExpr != 0 ) {
getKeyExpr = new GenInlineList;
@@ -1202,15 +1199,6 @@ void Reducer::resolveTargetStates()
#endif
}
-bool Reducer::setAlphType( const HostLang *hostLang, const char *data )
-{
- HostType *alphType = findAlphTypeInternal( hostLang, data );
- if ( alphType == 0 )
- return false;
-
- return true;
-}
-
void Reducer::condSpaceItem( int cnum, long condActionId )
{
GenCondSpace *cond = allCondSpaces + cnum;
diff --git a/src/libfsm/gendata.h b/src/libfsm/gendata.h
index 7ba4e683..1ad63429 100644
--- a/src/libfsm/gendata.h
+++ b/src/libfsm/gendata.h
@@ -297,7 +297,6 @@ public:
void makeMachine();
void makeExports();
void makeGenInlineList( GenInlineList *outList, InlineList *inList );
- bool setAlphType( const HostLang *hostLang, const char *data );
void analyzeMachine();
void make( const HostLang *hostLang, const HostType *alphType );