summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2020-03-08 22:21:58 +0200
committerAdrian Thurston <thurston@colm.net>2020-03-08 23:09:56 +0200
commit5718c319424a21b64e1b50dbb6aae644715b9e85 (patch)
treec1a009574512420c33cb026f7f13ca1d018283f2
parentf44ddde0cde8fa1794c91cb57871fc5a479b64b1 (diff)
downloadcolm-5718c319424a21b64e1b50dbb6aae644715b9e85.tar.gz
forked off ragel, keeping libfsm and rlhc in colm repository
Split off ragel, leaving behind libfsm and the rlhc code. Intend to use both of those components in colm.
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac4
-rw-r--r--ragel/.gitignore1
-rw-r--r--ragel/Makefile.am82
-rw-r--r--ragel/host-asm/.gitignore13
-rw-r--r--ragel/host-asm/CMakeLists.txt24
-rw-r--r--ragel/host-asm/Makefile.am30
-rw-r--r--ragel/host-asm/main.cc33
-rw-r--r--ragel/host-asm/rlparse.lm204
-rw-r--r--ragel/host-c/.gitignore14
-rw-r--r--ragel/host-c/CMakeLists.txt34
-rw-r--r--ragel/host-c/Makefile.am32
-rw-r--r--ragel/host-c/main.cc47
-rw-r--r--ragel/host-c/rlparse.lm203
-rw-r--r--ragel/host-crack/.gitignore13
-rw-r--r--ragel/host-crack/CMakeLists.txt34
-rw-r--r--ragel/host-crack/Makefile.am32
-rw-r--r--ragel/host-crack/main.cc63
-rw-r--r--ragel/host-crack/ragel-crack.lm150
-rw-r--r--ragel/host-crack/rlparse.lm202
-rw-r--r--ragel/host-csharp/.gitignore13
-rw-r--r--ragel/host-csharp/CMakeLists.txt34
-rw-r--r--ragel/host-csharp/Makefile.am32
-rw-r--r--ragel/host-csharp/main.cc72
-rw-r--r--ragel/host-csharp/rlparse.lm202
-rw-r--r--ragel/host-d/.gitignore13
-rw-r--r--ragel/host-d/CMakeLists.txt34
-rw-r--r--ragel/host-d/Makefile.am32
-rw-r--r--ragel/host-d/main.cc72
-rw-r--r--ragel/host-d/rlparse.lm211
-rw-r--r--ragel/host-go/.gitignore13
-rw-r--r--ragel/host-go/CMakeLists.txt34
-rw-r--r--ragel/host-go/Makefile.am34
-rw-r--r--ragel/host-go/main.cc70
-rw-r--r--ragel/host-go/out-go.lm47
-rw-r--r--ragel/host-go/rlparse.lm202
-rw-r--r--ragel/host-java/.gitignore13
-rw-r--r--ragel/host-java/CMakeLists.txt34
-rw-r--r--ragel/host-java/Makefile.am32
-rw-r--r--ragel/host-java/main.cc64
-rw-r--r--ragel/host-java/rlparse.lm202
-rw-r--r--ragel/host-js/.gitignore13
-rw-r--r--ragel/host-js/CMakeLists.txt34
-rw-r--r--ragel/host-js/Makefile.am32
-rw-r--r--ragel/host-js/main.cc66
-rw-r--r--ragel/host-js/rlparse.lm202
-rw-r--r--ragel/host-julia/.gitignore13
-rw-r--r--ragel/host-julia/CMakeLists.txt34
-rw-r--r--ragel/host-julia/Makefile.am32
-rw-r--r--ragel/host-julia/main.cc60
-rw-r--r--ragel/host-julia/rlparse.lm202
-rw-r--r--ragel/host-ocaml/.gitignore13
-rw-r--r--ragel/host-ocaml/CMakeLists.txt34
-rw-r--r--ragel/host-ocaml/Makefile.am34
-rw-r--r--ragel/host-ocaml/main.cc59
-rw-r--r--ragel/host-ocaml/rlparse.lm204
-rw-r--r--ragel/host-ruby/.gitignore13
-rw-r--r--ragel/host-ruby/CMakeLists.txt34
-rw-r--r--ragel/host-ruby/Makefile.am32
-rw-r--r--ragel/host-ruby/main.cc58
-rw-r--r--ragel/host-ruby/rlparse.lm203
-rw-r--r--ragel/host-ruby/ruby.dsc2
-rw-r--r--ragel/host-rust/.gitignore13
-rw-r--r--ragel/host-rust/CMakeLists.txt34
-rw-r--r--ragel/host-rust/Makefile.am32
-rw-r--r--ragel/host-rust/main.cc60
-rw-r--r--ragel/host-rust/rlparse.lm202
-rw-r--r--ragel/rlhc-c.lm (renamed from ragel/host-c/rlhc.lm)0
-rw-r--r--ragel/rlhc-crack.lm (renamed from ragel/host-crack/rlhc.lm)0
-rw-r--r--ragel/rlhc-csharp.lm (renamed from ragel/host-csharp/rlhc.lm)0
-rw-r--r--ragel/rlhc-d.lm (renamed from ragel/host-d/rlhc.lm)0
-rw-r--r--ragel/rlhc-go.lm (renamed from ragel/host-go/rlhc.lm)48
-rw-r--r--ragel/rlhc-java.lm (renamed from ragel/host-java/rlhc.lm)0
-rw-r--r--ragel/rlhc-js.lm (renamed from ragel/host-js/rlhc.lm)0
-rw-r--r--ragel/rlhc-julia.lm (renamed from ragel/host-julia/rlhc.lm)0
-rw-r--r--ragel/rlhc-ocaml.lm (renamed from ragel/host-ocaml/rlhc.lm)0
-rw-r--r--ragel/rlhc-ruby.lm (renamed from ragel/host-ruby/rlhc.lm)0
-rw-r--r--ragel/rlhc-rust.lm (renamed from ragel/host-rust/rlhc.lm)0
78 files changed, 54 insertions, 4386 deletions
diff --git a/Makefile.am b/Makefile.am
index 056db215..792f276a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,7 +19,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
-SUBDIRS = colm ragel doc test
+SUBDIRS = aapl colm ragel doc test
DIST_SUBDIRS = $(SUBDIRS) aapl
dist_doc_DATA = colm.vim
diff --git a/configure.ac b/configure.ac
index 8a518f8b..1eec5a06 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
dnl
-dnl Copyright 2006-2018 Adrian Thurston <thurston@colm.net>
+dnl Copyright 2006-2020 Adrian Thurston <thurston@colm.net>
dnl
dnl Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -20,7 +20,7 @@ dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM
dnl OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
dnl SOFTWARE.
-AC_INIT(colm-suite, 1)
+AC_INIT(colm, 0.14)
RAGEL_VERSION="7.0"
RAGEL_PUBDATE="January 2020"
diff --git a/ragel/.gitignore b/ragel/.gitignore
index d31bf206..78db4968 100644
--- a/ragel/.gitignore
+++ b/ragel/.gitignore
@@ -16,7 +16,6 @@
/rlhc.c
/*.lo
-/include
# Parsing
/parse.c
diff --git a/ragel/Makefile.am b/ragel/Makefile.am
index f247fba2..12c82946 100644
--- a/ragel/Makefile.am
+++ b/ragel/Makefile.am
@@ -1,6 +1,3 @@
-SUBDIRS = . host-ruby host-asm host-julia host-ocaml host-c \
- host-d host-csharp host-go host-java host-rust host-crack host-js
-
COLM_BIN = ../colm/colm
COLM_WRAP = ../colm/colm-wrap
COLM_LA = ../colm/libcolm.la
@@ -12,12 +9,7 @@ RAGEL = @RAGEL@
# libfsm contains only the FSM construction code and the backend code
# generators. It is useful for building code generators in programs not
# connected to the ragel language.
-#
-# libragel contains the parse tree and other parsing support code. Everything
-# except the reducers, which are specific to the frontends.
-lib_LTLIBRARIES = libfsm.la libragel.la
-
-bin_PROGRAMS = ragel
+lib_LTLIBRARIES = libfsm.la
pkginclude_HEADERS = \
action.h fsmgraph.h ragel.h common.h \
@@ -25,7 +17,9 @@ pkginclude_HEADERS = \
# nodist_pkginclude_HEADERS = config.h
-data_DATA = ragel.lm
+data_DATA = ril.lm rlhc-main.lm \
+ rlhc-c.lm rlhc-csharp.lm rlhc-go.lm rlhc-js.lm rlhc-ruby.lm \
+ rlhc-crack.lm rlhc-d.lm rlhc-java.lm rlhc-julia.lm rlhc-ocaml.lm rlhc-rust.lm
#
# libfsm: state machine construction and direct code generation.
@@ -57,21 +51,8 @@ nodist_libfsm_la_SOURCES = \
libfsm_la_LDFLAGS = -no-undefined
-#
-# libragel: ragel program minus host-specific code
-#
-libragel_la_CPPFLAGS = -I$(top_srcdir)/aapl -I$(top_srcdir)/colm/include -DBINDIR='"@bindir@"'
-
-dist_libragel_la_SOURCES = \
- parsedata.h parsetree.h inputdata.h pcheck.h reducer.h rlscan.h load.h \
- parsetree.cc longest.cc parsedata.cc inputdata.cc load.cc reducer.cc
-
-libragel_la_LDFLAGS = -no-undefined
-libragel_la_LIBADD = libfsm.la $(COLM_LA)
-
if LINKER_NO_UNDEFINED
libfsm_la_LDFLAGS += -Wl,--no-undefined
-libragel_la_LDFLAGS += -Wl,--no-undefined
endif
#
@@ -85,30 +66,6 @@ dist_ragel_SOURCES = \
nodist_ragel_SOURCES = \
parse.c rlreduce.cc
-ragel_LDADD = libragel.la libfsm.la $(COLM_LA)
-ragel_DEPENDENCIES = libragel.la libfsm.la $(COLM_LIBDEP)
-
-BUILT_SOURCES = \
- version.h \
- parse.c rlreduce.cc \
- include/ragel
-
-include/ragel:
- mkdir -p include
- ln -s .. include/ragel
-
-if WITH_RAGEL_KELBT
-nodist_ragel_SOURCES += \
- rlscan.cc rlparse.cc rlparse.h
-
-BUILT_SOURCES += \
- rlscan.cc rlparse.cc rlparse.h
-endif
-
-version.h: Makefile
- echo '#define RAGEL_VERSION "@RAGEL_VERSION@"' > version.h
- echo '#define RAGEL_PUBDATE "@RAGEL_PUBDATE@"' >> version.h
-
EXTRA_DIST = \
$(RAGEL_LM) \
rlscan.rl \
@@ -119,39 +76,8 @@ EXTRA_DIST = \
CLEANFILES = parse.c commit.cc rlhc.c
-if WITH_RAGEL_KELBT
-CLEANFILES += rlscan.cc rlparse.cc rlparse.h
-endif
-
RAGEL_LM = \
rlparse.lm \
ragel.lm \
rlreduce.lm
-parse.pack: $(RAGEL_LM) $(COLM_BINDEP)
- $(COLM_WRAP) -c -b rlparseC -o $@ -p parse.c -m rlreduce.cc $<
-
-rlreduce.cc: parse.pack
- $(COLM_WRAP) -o $@ $<
-
-parse.c: parse.pack
- $(COLM_WRAP) -o $@ $<
-
-if WITH_RAGEL_KELBT
-
-# This dependency comes from the import of the parser defines into the scanner.
-rlscan.cc: rlparse.h
-inputdata.cc: rlparse.h
-
-ragel-rlscan.$(OBJEXT): rlscan.cc
-
-rlscan.cc: rlscan.rl
- $(RAGEL) -G2 -I$(builddir) -o $@ $<
-
-rlparse.h: rlparse.kh
- $(KELBT) -o $@ $<
-
-rlparse.cc: rlparse.kl rlparse.kh
- $(KELBT) -o $@ $<
-
-endif
diff --git a/ragel/host-asm/.gitignore b/ragel/host-asm/.gitignore
deleted file mode 100644
index aac24809..00000000
--- a/ragel/host-asm/.gitignore
+++ /dev/null
@@ -1,13 +0,0 @@
-/Makefile.in
-/Makefile
-/.deps
-/.libs
-/ragel-asm
-/ragel-asm.exe
-/rlparse.pack
-/rlparse.c
-/rlreduce.cc
-
-/CMakeFiles
-/cmake_install.cmake
-
diff --git a/ragel/host-asm/CMakeLists.txt b/ragel/host-asm/CMakeLists.txt
deleted file mode 100644
index d1f22faa..00000000
--- a/ragel/host-asm/CMakeLists.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-add_custom_command(OUTPUT
- "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc"
- DEPENDS rlparse.lm
- COMMAND colm::colm
- ARGS -I.. -c -b rlparseAsm
- -o "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- -m "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc"
- rlparse.lm
- WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}")
-
-add_executable(ragel-asm main.cc
- "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc")
-
-target_link_libraries(ragel-asm PRIVATE libragel libfsm)
-
-if(${PROJECT_NAME}_MAKE_INSTALL)
- install(TARGETS ragel-asm
- EXPORT ${_PACKAGE_NAME}-targets
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
-endif()
diff --git a/ragel/host-asm/Makefile.am b/ragel/host-asm/Makefile.am
deleted file mode 100644
index 3a2ac07d..00000000
--- a/ragel/host-asm/Makefile.am
+++ /dev/null
@@ -1,30 +0,0 @@
-COLM_BIN = ../../colm/colm
-COLM_WRAP = ../../colm/colm-wrap
-COLM_LA = ../../colm/libcolm.la
-COLM_LIBDEP = $(COLM_LA)
-COLM_BINDEP = $(COLM_BIN) $(COLM_WRAP)
-
-bin_PROGRAMS = ragel-asm
-
-ragel_asm_CPPFLAGS = -I$(top_srcdir)/aapl -I$(top_srcdir)/ragel -I$(top_srcdir)/colm/include
-
-dist_ragel_asm_SOURCES = main.cc
-
-nodist_ragel_asm_SOURCES = \
- rlparse.c rlreduce.cc
-
-ragel_asm_LDADD = ../libragel.la ../libfsm.la $(COLM_LA)
-
-BUILT_SOURCES = rlparse.c rlreduce.cc
-
-EXTRA_DIST = rlparse.lm
-
-rlparse.pack: rlparse.lm $(COLM_BINDEP)
- $(COLM_WRAP) -c -I .. -b rlparseAsm -o $@ -p rlparse.c -m rlreduce.cc $<
-
-rlparse.c: rlparse.pack
- $(COLM_WRAP) -o $@ $<
-
-rlreduce.cc: rlparse.pack
- $(COLM_WRAP) -o $@ $<
-
diff --git a/ragel/host-asm/main.cc b/ragel/host-asm/main.cc
deleted file mode 100644
index 21f8a515..00000000
--- a/ragel/host-asm/main.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2001-2018 Adrian Thurston <thurston@colm.net>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include "inputdata.h"
-#include "asm.h"
-
-extern struct colm_sections rlparseAsm;
-
-int main( int argc, const char **argv )
-{
- InputData id( &hostLangAsm, &rlparseAsm, 0 );
- return id.main( argc, argv );
-}
-
diff --git a/ragel/host-asm/rlparse.lm b/ragel/host-asm/rlparse.lm
deleted file mode 100644
index 911e3ea6..00000000
--- a/ragel/host-asm/rlparse.lm
+++ /dev/null
@@ -1,204 +0,0 @@
-include 'ragel.lm'
-include 'rlreduce.lm'
-
-namespace inline
- lex
- literal `fpc `fc `fcurs `ftargs
- `fentry `fhold `fexec `fgoto `fnext
- `fcall `fret `fbreak `fncall `fnret `fnbreak
-
- token ident /ident/
- token number /digit+/
- token hex_number /'0x' [0-9a-fA-F]+/
- token dec_number /'0x' [0-9a-fA-F]+/
-
- token comment
- / c_comment | cpp_comment /
-
- token string
- / s_literal | d_literal /
-
- token whitespace
- / ( [ \t] | NL )+ /
-
- literal
- `{ `} `:: `* `, `( `) `;
-
- token var_ref
- / "$" [a-zA-Z_][a-zA-Z_0-9]* /
- {
- if GblActionParams
- {
- input->push( make_token(
- typeid<var_ref>, input->pull( match_length ) ) )
- }
- else
- {
- # Just pull one char. Don't consume the word because it may
- # be a keyword.
- input->push( make_token(
- typeid<c_any>, input->pull( 1 ) ) )
- }
- }
-
- token c_any
- / any /
- end
-
-end
-
-
-namespace host
- lex
- literal `%%{
-
- token close_inc /'}--%%'/
- {
- input->push( make_token( typeid<close_inc>, input->pull( match_length ) ) )
- restoreGlobals()
- }
-
- token close_imp /'}++%%'/
- {
- input->push( make_token( typeid<close_imp>, input->pull( match_length ) ) )
- restoreGlobals()
- }
-
- token slr / '%%' [^{] [^\n]* '\n' /
- {
- # Translates single line to multi-line
- input->pull( 2 )
- R: str = input->pull( match_length - 3 )
- input->push( "}%%" )
- input->push( R )
- input->push( "%%{" )
- }
-
- rl NL / '\n' /
-
- rl s_literal
- / "'" ([^'\\\n] | '\\' (any | NL))* "'" /
-
- rl d_literal
- / '"' ([^"\\] | NL | '\\' (any | NL))* '"' /
-
- literal `define `=
-
- token ident /ident "'"?/
- token number /digit+/
- token hex_number /'0x' [0-9a-fA-F]+/
-
- token comment
- / c_comment | cpp_comment /
-
- token string
- / s_literal | d_literal /
-
- token whitespace
- / ( [ \t] | NL )+ /
-
- token c_any / any /
- end
-
- def tok
- [`define whitespace ident whitespace? number] :ImportDefNum
- | [`define whitespace ident whitespace? string] :ImportDefStr
- | [ident whitespace? `= whitespace? number] :ImportAssignNum
- | [ident whitespace? `= whitespace? string] :ImportAssignStr
- | [`define] :Def
- | [`=] :Eq
- | [ident] :Ident
- | [number] :Number
- | [hex_number] :HexNumber
- | [comment] :Comment
- | [string] :String
- | [whitespace] :Whitespace
- | [c_any] :Any
-end
-
-reduction TopLevel
-
- # Pass Through.
- # def tok
- # [`define ident number] :Def1
- # | [`define ident string] :Def2
- # | [ident `= number] :Ass1
- # | [ident `= string] :Ass2
- # [`define whitespace ident whitespace? number] :ImportDefNum
- # | [`define whitespace ident whitespace? string] :ImportDefStr
- # | [ident whitespace? `= whitespace? number] :ImportAssignNum
- # | [ident whitespace? `= whitespace? string] :ImportAssignStr
- # | [`define] :Def
- # | [`=] :Eq
- # | [ident] :Ident
- # | [number] :Number
- # | [hex_number] :HexNumber
- # | [comment] :Comment
- # | [string] :String
- # | [whitespace] :Whitespace
- # | [c_any] :Any
-
- host::tok :ImportDefNum
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @number,
- false /* $number->neg */, $number->data,
- $number->length, Literal::Number );
-
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportDefStr
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @string, false,
- $string->data, $string->length, Literal::LitString );
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportAssignNum
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @number,
- false /*$number->neg */, $number->data,
- $number->length, Literal::Number );
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportAssignStr
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @string, false,
- $string->data, $string->length, Literal::LitString );
-
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
-
-end
-
-
-export RagelError: str
-
-# File name. The open is expected to succeed. It is tested before the colm
-# program is called.
-A: list_el<str> = argv->pop_head_el()
-GblFileName = A->value
-
-# Remaining items are include paths.
-while ( argv->length > 0 ) {
- A = argv->pop_head_el()
- GblIncludePaths->push_tail_el( A )
-}
-
-Stream: stream = open( GblFileName, "r" )
-reduce TopLevel start[ Stream ]
-RagelError = error
diff --git a/ragel/host-c/.gitignore b/ragel/host-c/.gitignore
deleted file mode 100644
index 55892c4f..00000000
--- a/ragel/host-c/.gitignore
+++ /dev/null
@@ -1,14 +0,0 @@
-/.deps/
-/.libs/
-/Makefile
-/Makefile.in
-/ragel-c
-/ragel-c.exe
-/rlhc.c
-/rlparse.pack
-/rlparse.c
-/rlreduce.cc
-/rlparse.pack
-
-/CMakeFiles
-/cmake_install.cmake
diff --git a/ragel/host-c/CMakeLists.txt b/ragel/host-c/CMakeLists.txt
deleted file mode 100644
index 1c97a41c..00000000
--- a/ragel/host-c/CMakeLists.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-add_custom_command(OUTPUT
- "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc"
- DEPENDS rlparse.lm
- COMMAND colm::colm
- ARGS -I.. -c -b rlparseC
- -o "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- -m "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc"
- rlparse.lm
- WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}")
-
-add_custom_command(OUTPUT
- "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- DEPENDS rlhc.lm
- COMMAND colm::colm
- ARGS -I.. -c -b rlhcC
- -o "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- rlhc.lm
- WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}")
-
-add_executable(ragel-c main.cc
- "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc")
-
-target_link_libraries(ragel-c PRIVATE libragel libfsm)
-
-if(${PROJECT_NAME}_MAKE_INSTALL)
- install(TARGETS ragel-c
- EXPORT ${_PACKAGE_NAME}-targets
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
-endif()
diff --git a/ragel/host-c/Makefile.am b/ragel/host-c/Makefile.am
deleted file mode 100644
index 680a09fe..00000000
--- a/ragel/host-c/Makefile.am
+++ /dev/null
@@ -1,32 +0,0 @@
-COLM_BIN = ../../colm/colm
-COLM_WRAP = ../../colm/colm-wrap
-COLM_LA = ../../colm/libcolm.la
-COLM_LIBDEP = $(COLM_LA)
-COLM_BINDEP = $(COLM_BIN) $(COLM_WRAP)
-
-bin_PROGRAMS = ragel-c
-
-ragel_c_CPPFLAGS = -I$(top_srcdir)/aapl -I$(top_srcdir)/ragel -I$(top_srcdir)/colm/include
-
-dist_ragel_c_SOURCES = main.cc rlhc.c
-
-nodist_ragel_c_SOURCES = \
- rlparse.c rlreduce.cc
-
-ragel_c_LDADD = ../libragel.la ../libfsm.la $(COLM_LA)
-
-BUILT_SOURCES = rlparse.c rlreduce.cc
-
-EXTRA_DIST = rlparse.lm rlhc.lm
-
-rlparse.pack: rlparse.lm $(COLM_BINDEP)
- $(COLM_WRAP) -c -I .. -b rlparseC -o $@ -p rlparse.c -m rlreduce.cc $<
-
-rlparse.c: rlparse.pack
- $(COLM_WRAP) -o $@ $<
-
-rlreduce.cc: rlparse.pack
- $(COLM_WRAP) -o $@ $<
-
-rlhc.c: rlhc.lm ../ril.lm $(COLM_BINDEP)
- $(COLM_BIN) -c -I .. -b rlhcC -o $@ $<
diff --git a/ragel/host-c/main.cc b/ragel/host-c/main.cc
deleted file mode 100644
index 20c7e6da..00000000
--- a/ragel/host-c/main.cc
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2001-2018 Adrian Thurston <thurston@colm.net>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include "inputdata.h"
-
-extern struct colm_sections rlparseC;
-extern struct colm_sections rlhcC;
-
-const HostLang hostLangC_translated =
-{
- hostTypesC,
- 8,
- 0,
- true,
- false, /* loopLabels */
- Translated,
- GotoFeature,
- &makeCodeGen,
- &defaultOutFnC,
- &genLineDirectiveTrans
-};
-
-int main( int argc, const char **argv )
-{
- InputData id( &hostLangC_translated, &rlparseC, &rlhcC );
- return id.rlhcMain( argc, argv );
-}
-
diff --git a/ragel/host-c/rlparse.lm b/ragel/host-c/rlparse.lm
deleted file mode 100644
index 0fd61bbf..00000000
--- a/ragel/host-c/rlparse.lm
+++ /dev/null
@@ -1,203 +0,0 @@
-include 'ragel.lm'
-include 'rlreduce.lm'
-
-namespace inline
- lex
- literal `fpc `fc `fcurs `ftargs
- `fentry `fhold `fexec `fgoto `fnext
- `fcall `fret `fbreak `fncall `fnret `fnbreak
-
- token ident /ident/
- token number /digit+/
- token hex_number /'0x' [0-9a-fA-F]+/
- token dec_number /'0x' [0-9a-fA-F]+/
-
- token comment
- / c_comment | cpp_comment /
-
- token string
- / s_literal | d_literal /
-
- token whitespace
- / ( [ \t] | NL )+ /
-
- literal
- `{ `} `:: `* `, `( `) `;
-
- token var_ref
- / "$" [a-zA-Z_][a-zA-Z_0-9]* /
- {
- if GblActionParams
- {
- input->push( make_token(
- typeid<var_ref>, input->pull( match_length ) ) )
- }
- else
- {
- # Just pull one char. Don't consume the word because it may
- # be a keyword.
- input->push( make_token(
- typeid<c_any>, input->pull( 1 ) ) )
- }
- }
-
- token c_any
- / any /
- end
-end
-
-
-namespace host
- lex
- literal `%%{
-
- token close_inc /'}--%%'/
- {
- input->push( make_token( typeid<close_inc>, input->pull( match_length ) ) )
- restoreGlobals()
- }
-
- token close_imp /'}++%%'/
- {
- input->push( make_token( typeid<close_imp>, input->pull( match_length ) ) )
- restoreGlobals()
- }
-
- token slr / '%%' [^{] [^\n]* '\n' /
- {
- # Translates single line to multi-line
- input->pull( 2 )
- R: str = input->pull( match_length - 3 )
- input->push( "}%%" )
- input->push( R )
- input->push( "%%{" )
- }
-
- rl NL / '\n' /
-
- rl s_literal
- / "'" ([^'\\\n] | '\\' (any | NL))* "'" /
-
- rl d_literal
- / '"' ([^"\\] | NL | '\\' (any | NL))* '"' /
-
- literal `define `=
-
- token ident /ident "'"?/
- token number /digit+/
- token hex_number /'0x' [0-9a-fA-F]+/
-
- token comment
- / c_comment | cpp_comment /
-
- token string
- / s_literal | d_literal /
-
- token whitespace
- / ( [ \t] | NL )+ /
-
- token c_any / any /
- end
-
- def tok
- [`define whitespace ident whitespace? number] :ImportDefNum
- | [`define whitespace ident whitespace? string] :ImportDefStr
- | [ident whitespace? `= whitespace? number] :ImportAssignNum
- | [ident whitespace? `= whitespace? string] :ImportAssignStr
- | [`define] :Def
- | [`=] :Eq
- | [ident] :Ident
- | [number] :Number
- | [hex_number] :HexNumber
- | [comment] :Comment
- | [string] :String
- | [whitespace] :Whitespace
- | [c_any] :Any
-end
-
-reduction TopLevel
-
- # Pass Through.
- # def tok
- # [`define ident number] :Def1
- # | [`define ident string] :Def2
- # | [ident `= number] :Ass1
- # | [ident `= string] :Ass2
- # [`define whitespace ident whitespace? number] :ImportDefNum
- # | [`define whitespace ident whitespace? string] :ImportDefStr
- # | [ident whitespace? `= whitespace? number] :ImportAssignNum
- # | [ident whitespace? `= whitespace? string] :ImportAssignStr
- # | [`define] :Def
- # | [`=] :Eq
- # | [ident] :Ident
- # | [number] :Number
- # | [hex_number] :HexNumber
- # | [comment] :Comment
- # | [string] :String
- # | [whitespace] :Whitespace
- # | [c_any] :Any
-
- host::tok :ImportDefNum
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @number,
- false /* $number->neg */, $number->data,
- $number->length, Literal::Number );
-
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportDefStr
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @string, false,
- $string->data, $string->length, Literal::LitString );
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportAssignNum
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @number,
- false /*$number->neg */, $number->data,
- $number->length, Literal::Number );
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportAssignStr
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @string, false,
- $string->data, $string->length, Literal::LitString );
-
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
-
-end
-
-
-export RagelError: str
-
-# File name. The open is expected to succeed. It is tested before the colm
-# program is called.
-A: list_el<str> = argv->pop_head_el()
-GblFileName = A->value
-
-# Remaining items are include paths.
-while ( argv->length > 0 ) {
- A = argv->pop_head_el()
- GblIncludePaths->push_tail_el( A )
-}
-
-Stream: stream = open( GblFileName, "r" )
-reduce TopLevel start[ Stream ]
-RagelError = error
diff --git a/ragel/host-crack/.gitignore b/ragel/host-crack/.gitignore
deleted file mode 100644
index a68a8a97..00000000
--- a/ragel/host-crack/.gitignore
+++ /dev/null
@@ -1,13 +0,0 @@
-/Makefile
-/Makefile.in
-/.deps
-/.libs
-/ragel-crack
-/ragel-crack.exe
-/rlhc.c
-/rlparse.pack
-/rlparse.c
-/rlreduce.cc
-
-/CMakeFiles
-/cmake_install.cmake
diff --git a/ragel/host-crack/CMakeLists.txt b/ragel/host-crack/CMakeLists.txt
deleted file mode 100644
index e28b4fa7..00000000
--- a/ragel/host-crack/CMakeLists.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-add_custom_command(OUTPUT
- "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc"
- DEPENDS rlparse.lm
- COMMAND colm::colm
- ARGS -I.. -c -b rlparseCrack
- -o "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- -m "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc"
- rlparse.lm
- WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}")
-
-add_custom_command(OUTPUT
- "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- DEPENDS rlhc.lm
- COMMAND colm::colm
- ARGS -I.. -c -b rlhcCrack
- -o "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- rlhc.lm
- WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}")
-
-add_executable(ragel-crack main.cc
- "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc")
-
-target_link_libraries(ragel-crack PRIVATE libragel libfsm)
-
-if(${PROJECT_NAME}_MAKE_INSTALL)
- install(TARGETS ragel-crack
- EXPORT ${_PACKAGE_NAME}-targets
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
-endif()
diff --git a/ragel/host-crack/Makefile.am b/ragel/host-crack/Makefile.am
deleted file mode 100644
index 676c7f25..00000000
--- a/ragel/host-crack/Makefile.am
+++ /dev/null
@@ -1,32 +0,0 @@
-COLM_BIN = ../../colm/colm
-COLM_WRAP = ../../colm/colm-wrap
-COLM_LA = ../../colm/libcolm.la
-COLM_LIBDEP = $(COLM_LA)
-COLM_BINDEP = $(COLM_BIN) $(COLM_WRAP)
-
-bin_PROGRAMS = ragel-crack
-
-ragel_crack_CPPFLAGS = -I$(top_srcdir)/aapl -I$(top_srcdir)/ragel -I$(top_srcdir)/colm/include
-
-dist_ragel_crack_SOURCES = main.cc rlhc.c
-
-nodist_ragel_crack_SOURCES = \
- rlparse.c rlreduce.cc
-
-ragel_crack_LDADD = ../libragel.la ../libfsm.la $(COLM_LA)
-
-BUILT_SOURCES = rlparse.c rlreduce.cc rlhc.c
-
-EXTRA_DIST = rlparse.lm rlhc.lm
-
-rlparse.pack: rlparse.lm $(COLM_BINDEP)
- $(COLM_WRAP) -c -I .. -b rlparseCrack -o $@ -p rlparse.c -m rlreduce.cc $<
-
-rlparse.c: rlparse.pack
- $(COLM_WRAP) -o $@ $<
-
-rlreduce.cc: rlparse.pack
- $(COLM_WRAP) -o $@ $<
-
-rlhc.c: rlhc.lm ../ril.lm $(COLM_BINDEP)
- $(COLM_BIN) -c -I .. -b rlhcCrack -o $@ $<
diff --git a/ragel/host-crack/main.cc b/ragel/host-crack/main.cc
deleted file mode 100644
index dd45fd1b..00000000
--- a/ragel/host-crack/main.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright 2001-2018 Adrian Thurston <thurston@colm.net>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include "inputdata.h"
-
-extern struct colm_sections rlparseCrack;
-extern struct colm_sections rlhcCrack;
-
-/*
- * Crack
- */
-const char *defaultOutFnCrack( const char *inputFileName )
-{
- return fileNameFromStem( inputFileName, ".crk" );
-}
-
-HostType hostTypesCrack[] =
-{
- { "byte", 0, "byte", false, true, true, 0, 0, 0, UCHAR_MAX, 1 },
- { "int32", 0, "int32", true, true, false, S32BIT_MIN, S32BIT_MAX, 0, 0, 4 },
- { "uint32", 0, "uint32", false, true, false, 0, 0, 0, U32BIT_MAX, 4 },
- { "int", 0, "int", true, true, false, INT_MIN, INT_MAX, 0, 0, sizeof(int) },
- { "uint", 0, "uint", false, true, false, 0, 0, 0, UINT_MAX, sizeof(int) },
-};
-
-const HostLang hostLangCrack =
-{
- hostTypesCrack,
- 5,
- 0,
- true,
- false, /* loopLabels */
- Translated,
- BreakFeature,
- &makeCodeGen,
- &defaultOutFnCrack,
- &genLineDirectiveTrans
-};
-
-int main( int argc, const char **argv )
-{
- InputData id( &hostLangCrack, &rlparseCrack, &rlhcCrack );
- return id.rlhcMain( argc, argv );
-}
diff --git a/ragel/host-crack/ragel-crack.lm b/ragel/host-crack/ragel-crack.lm
deleted file mode 100644
index b6480012..00000000
--- a/ragel/host-crack/ragel-crack.lm
+++ /dev/null
@@ -1,150 +0,0 @@
-namespace crack_inline
- lex
- literal `fpc `fc `fcurs `ftargs
- `fentry `fhold `fexec `fgoto `fnext
- `fcall `fret `fbreak `fncall `fnret `fnbreak
-
- token ident /ident/
- token number /digit+/
- token hex_number /'0x' [0-9a-fA-F]+/
-
- token comment
- / c_comment | cpp_comment /
-
- token string
- / s_literal | d_literal /
-
- token whitespace
- / ( [ \t] | NL )+ /
-
- literal
- `{ `} `:: `* `, `( `) `;
-
- token c_any / any /
- end
-
- def inline_expr
- [expr_item*]
-
- def expr_item
- [expr_any] :ExprAny
- | [expr_symbol] :ExprSymbol
- | [expr_interpret] :ExprInterpret
-
- def expr_any
- [whitespace]
- | [comment]
- | [string]
- | [number]
- | [hex_number]
- | [ident]
- | [c_any]
-
- def expr_symbol
- [`,] | [`(] | [`)] | [`*] | [`::]
-
- def expr_interpret
- [`fpc] :Fpc
- | [`fc] :Fc
- | [`fcurs] :Fcurs
- | [`ftargs] :Ftargs
- | [`fentry `( state_ref srlex::`)] :Fentry
-
- def state_ref
- [opt_name_sep state_ref_names]
-
- def opt_name_sep
- [srlex::`::] :ColonColon
- | [] :Empty
-
- # List of names separated by ::
- def state_ref_names
- [state_ref_names srlex::`:: srlex::word] :Rec
- | [srlex::word] :Base
-
- def inline_block
- [block_item*]
-
- def block_item
- [expr_any] :ExprAny
- | [block_symbol] :BlockSymbol
- | [block_interpret] :BlockInterpret
- | [`{ inline_block `}] :RecBlock
-
- def block_symbol
- [`,] | [`;] | [`(] | [`)] | [`*] | [`::]
-
- def block_interpret
- [expr_interpret] :ExprInterpret
- | [`fhold whitespace? `;] :Fhold
- | [`fgoto whitespace? `* inline_expr `;] :FgotoExpr
- | [`fnext whitespace? `* inline_expr `;] :FnextExpr
- | [`fcall whitespace? `* inline_expr `;] :FcallExpr
- | [`fncall whitespace? `* inline_expr `;] :FncallExpr
- | [`fexec inline_expr `;] :Fexec
- | [`fgoto state_ref srlex::`;] :FgotoSr
- | [`fnext state_ref srlex::`;] :FnextSr
- | [`fcall state_ref srlex::`;] :FcallSr
- | [`fncall state_ref srlex::`;] :FncallSr
- | [`fret `;] :Fret
- | [`fnret `;] :Fnret
- | [`fbreak `;] :Fbreak
- | [`fnbreak `;] :Fnbreak
-end
-
-
-namespace crack_host
- lex
- literal `%%{
-
- token slr /'%%' [^{] [^\n]* '\n'/
- {
- input->pull( 2 )
- R: str = input->pull( match_length - 3 )
- input->push( "\n}%%" )
- input->push( R )
- input->push( "%%{" )
- }
-
- rl NL / '\n' /
-
- rl s_literal
- / "'" ([^'\\\n] | '\\' (any | NL))* "'" /
-
- rl d_literal
- / '"' ([^"\\] | NL | '\\' (any | NL))* '"' /
-
- rl bt_literal
- / '`' ([^`\\] | NL | '\\' (any | NL))* '`' /
-
- token ident /ident "'"?/
- token number /digit+/
- token hex_number /'0x' [0-9a-fA-F]+/
-
- token comment
- /c_comment | cpp_comment/
-
- token string
- / s_literal | d_literal | bt_literal /
-
- token whitespace
- / ( [ \t] | NL )+ /
-
- token c_any / any /
- end
-
- def tok
- [ident]
- | [number]
- | [hex_number]
- | [comment]
- | [string]
- | [whitespace]
- | [c_any]
-
- def section
- [`%%{ ragel::ragel_start ragel::`}%%] :MultiLine
- | [tok] :Tok
-end
-
-
diff --git a/ragel/host-crack/rlparse.lm b/ragel/host-crack/rlparse.lm
deleted file mode 100644
index 100a9223..00000000
--- a/ragel/host-crack/rlparse.lm
+++ /dev/null
@@ -1,202 +0,0 @@
-include 'ragel.lm'
-include 'rlreduce.lm'
-
-namespace inline
- lex
- literal `fpc `fc `fcurs `ftargs
- `fentry `fhold `fexec `fgoto `fnext
- `fcall `fret `fbreak `fncall `fnret `fnbreak
-
- token ident /ident/
- token number /digit+/
- token hex_number /'0x' [0-9a-fA-F]+/
- token dec_number /'0x' [0-9a-fA-F]+/
-
- token comment
- / c_comment | cpp_comment /
-
- token string
- / s_literal | d_literal /
-
- token whitespace
- / ( [ \t] | NL )+ /
-
- literal
- `{ `} `:: `* `, `( `) `;
-
- token var_ref
- / "$" [a-zA-Z_][a-zA-Z_0-9]* /
- {
- if GblActionParams
- {
- input->push( make_token(
- typeid<var_ref>, input->pull( match_length ) ) )
- }
- else
- {
- # Just pull one char. Don't consume the word because it may
- # be a keyword.
- input->push( make_token(
- typeid<c_any>, input->pull( 1 ) ) )
- }
- }
-
- token c_any
- / any /
- end
-
-end
-
-namespace host
- lex
- literal `%%{
-
- token close_inc /'}--%%'/
- {
- input->push( make_token( typeid<close_inc>, input->pull( match_length ) ) )
- restoreGlobals()
- }
-
- token close_imp /'}++%%'/
- {
- input->push( make_token( typeid<close_imp>, input->pull( match_length ) ) )
- restoreGlobals()
- }
-
- token slr / '%%' [^{] [^\n]* '\n' /
- {
- # Translates single line to multi-line
- input->pull( 2 )
- R: str = input->pull( match_length - 3 )
- input->push( "}%%" )
- input->push( R )
- input->push( "%%{" )
- }
-
- rl NL / '\n' /
-
- rl s_literal
- / "'" ([^'\\\n] | '\\' (any | NL))* "'" /
-
- rl d_literal
- / '"' ([^"\\] | NL | '\\' (any | NL))* '"' /
-
- literal `define `=
-
- token ident /ident "'"?/
- token number /digit+/
- token hex_number /'0x' [0-9a-fA-F]+/
-
- token comment
- / c_comment | cpp_comment /
-
- token string
- / s_literal | d_literal /
-
- token whitespace
- / ( [ \t] | NL )+ /
-
- token c_any / any /
- end
-
- def tok
- [`define whitespace ident whitespace? number] :ImportDefNum
- | [`define whitespace ident whitespace? string] :ImportDefStr
- | [ident whitespace? `= whitespace? number] :ImportAssignNum
- | [ident whitespace? `= whitespace? string] :ImportAssignStr
- | [`define] :Def
- | [`=] :Eq
- | [ident] :Ident
- | [number] :Number
- | [hex_number] :HexNumber
- | [comment] :Comment
- | [string] :String
- | [whitespace] :Whitespace
- | [c_any] :Any
-end
-
-reduction TopLevel
-
- # Pass Through.
- # def tok
- # [`define ident number] :Def1
- # | [`define ident string] :Def2
- # | [ident `= number] :Ass1
- # | [ident `= string] :Ass2
- # [`define whitespace ident whitespace? number] :ImportDefNum
- # | [`define whitespace ident whitespace? string] :ImportDefStr
- # | [ident whitespace? `= whitespace? number] :ImportAssignNum
- # | [ident whitespace? `= whitespace? string] :ImportAssignStr
- # | [`define] :Def
- # | [`=] :Eq
- # | [ident] :Ident
- # | [number] :Number
- # | [hex_number] :HexNumber
- # | [comment] :Comment
- # | [string] :String
- # | [whitespace] :Whitespace
- # | [c_any] :Any
-
- host::tok :ImportDefNum
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @number,
- false /* $number->neg */, $number->data,
- $number->length, Literal::Number );
-
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportDefStr
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @string, false,
- $string->data, $string->length, Literal::LitString );
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportAssignNum
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @number,
- false /*$number->neg */, $number->data,
- $number->length, Literal::Number );
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportAssignStr
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @string, false,
- $string->data, $string->length, Literal::LitString );
-
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
-
-end
-
-export RagelError: str
-
-# File name. The open is expected to succeed. It is tested before the colm
-# program is called.
-A: list_el<str> = argv->pop_head_el()
-GblFileName = A->value
-
-# Remaining items are include paths.
-while ( argv->length > 0 ) {
- A = argv->pop_head_el()
- GblIncludePaths->push_tail_el( A )
-}
-
-Stream: stream = open( GblFileName, "r" )
-reduce TopLevel start[ Stream ]
-RagelError = error
diff --git a/ragel/host-csharp/.gitignore b/ragel/host-csharp/.gitignore
deleted file mode 100644
index 26f12644..00000000
--- a/ragel/host-csharp/.gitignore
+++ /dev/null
@@ -1,13 +0,0 @@
-/Makefile
-/Makefile.in
-/.deps
-/.libs
-/ragel-csharp
-/ragel-csharp.exe
-/rlhc.c
-/rlparse.pack
-/rlparse.c
-/rlreduce.cc
-
-/CMakeFiles
-/cmake_install.cmake
diff --git a/ragel/host-csharp/CMakeLists.txt b/ragel/host-csharp/CMakeLists.txt
deleted file mode 100644
index 8d70e5a6..00000000
--- a/ragel/host-csharp/CMakeLists.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-add_custom_command(OUTPUT
- "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc"
- DEPENDS rlparse.lm
- COMMAND colm::colm
- ARGS -I.. -c -b rlparseCSharp
- -o "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- -m "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc"
- rlparse.lm
- WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}")
-
-add_custom_command(OUTPUT
- "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- DEPENDS rlhc.lm
- COMMAND colm::colm
- ARGS -I.. -c -b rlhcCSharp
- -o "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- rlhc.lm
- WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}")
-
-add_executable(ragel-csharp main.cc
- "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc")
-
-target_link_libraries(ragel-csharp PRIVATE libragel libfsm)
-
-if(${PROJECT_NAME}_MAKE_INSTALL)
- install(TARGETS ragel-csharp
- EXPORT ${_PACKAGE_NAME}-targets
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
-endif()
diff --git a/ragel/host-csharp/Makefile.am b/ragel/host-csharp/Makefile.am
deleted file mode 100644
index e4f4fd71..00000000
--- a/ragel/host-csharp/Makefile.am
+++ /dev/null
@@ -1,32 +0,0 @@
-COLM_BIN = ../../colm/colm
-COLM_WRAP = ../../colm/colm-wrap
-COLM_LA = ../../colm/libcolm.la
-COLM_LIBDEP = $(COLM_LA)
-COLM_BINDEP = $(COLM_BIN) $(COLM_WRAP)
-
-bin_PROGRAMS = ragel-csharp
-
-ragel_csharp_CPPFLAGS = -I$(top_srcdir)/aapl -I$(top_srcdir)/ragel -I$(top_srcdir)/colm/include
-
-dist_ragel_csharp_SOURCES = main.cc rlhc.c
-
-nodist_ragel_csharp_SOURCES = \
- rlparse.c rlreduce.cc
-
-ragel_csharp_LDADD = ../libragel.la ../libfsm.la $(COLM_LA)
-
-BUILT_SOURCES = rlparse.c rlreduce.cc rlhc.c
-
-EXTRA_DIST = rlparse.lm rlhc.lm
-
-rlparse.pack: rlparse.lm $(COLM_BINDEP)
- $(COLM_WRAP) -c -I .. -b rlparseCSharp -o $@ -p rlparse.c -m rlreduce.cc $<
-
-rlparse.c: rlparse.pack
- $(COLM_WRAP) -o $@ $<
-
-rlreduce.cc: rlparse.pack
- $(COLM_WRAP) -o $@ $<
-
-rlhc.c: rlhc.lm ../ril.lm $(COLM_BINDEP)
- $(COLM_BIN) -c -I .. -b rlhcCSharp -o $@ $<
diff --git a/ragel/host-csharp/main.cc b/ragel/host-csharp/main.cc
deleted file mode 100644
index fa5cb5a9..00000000
--- a/ragel/host-csharp/main.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright 2001-2018 Adrian Thurston <thurston@colm.net>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include "inputdata.h"
-
-extern struct colm_sections rlparseCSharp;
-extern struct colm_sections rlhcCSharp;
-
-/*
- * C#
- */
-
-const char *defaultOutFnCSharp( const char *inputFileName )
-{
- const char *ext = findFileExtension( inputFileName );
- if ( ext != 0 && strcmp( ext, ".rh" ) == 0 )
- return fileNameFromStem( inputFileName, ".h" );
- else
- return fileNameFromStem( inputFileName, ".cs" );
-}
-
-HostType hostTypesCSharp[] =
-{
- { "sbyte", 0, "sbyte", true, true, false, CHAR_MIN, CHAR_MAX, 0, 0, 1 },
- { "byte", 0, "byte", false, true, false, 0, 0, 0, UCHAR_MAX, 1 },
- { "short", 0, "short", true, true, false, SHRT_MIN, SHRT_MAX, 0, 0, 2 },
- { "ushort", 0, "ushort", false, true, false, 0, 0, 0, USHRT_MAX, 2 },
- { "char", 0, "char", false, true, true, 0, 0, 0, USHRT_MAX, 2 },
- { "int", 0, "int", true, true, false, INT_MIN, INT_MAX, 0, 0, 4 },
- { "uint", 0, "uint", false, true, false, 0, 0, 0, UINT_MAX, 4 },
- { "long", 0, "long", true, true, false, LONG_MIN, LONG_MAX, 0, 0, 8 },
- { "ulong", 0, "ulong", false, true, false, 0, 0, 0, ULONG_MAX, 8 },
-};
-
-const HostLang hostLangCSharp =
-{
- hostTypesCSharp,
- 9,
- 4,
- true,
- false, /* loopLabels */
- Translated,
- GotoFeature,
- &makeCodeGen,
- &defaultOutFnCSharp,
- &genLineDirectiveTrans
-};
-
-int main( int argc, const char **argv )
-{
- InputData id( &hostLangCSharp, &rlparseCSharp, &rlhcCSharp );
- return id.rlhcMain( argc, argv );
-}
diff --git a/ragel/host-csharp/rlparse.lm b/ragel/host-csharp/rlparse.lm
deleted file mode 100644
index 100a9223..00000000
--- a/ragel/host-csharp/rlparse.lm
+++ /dev/null
@@ -1,202 +0,0 @@
-include 'ragel.lm'
-include 'rlreduce.lm'
-
-namespace inline
- lex
- literal `fpc `fc `fcurs `ftargs
- `fentry `fhold `fexec `fgoto `fnext
- `fcall `fret `fbreak `fncall `fnret `fnbreak
-
- token ident /ident/
- token number /digit+/
- token hex_number /'0x' [0-9a-fA-F]+/
- token dec_number /'0x' [0-9a-fA-F]+/
-
- token comment
- / c_comment | cpp_comment /
-
- token string
- / s_literal | d_literal /
-
- token whitespace
- / ( [ \t] | NL )+ /
-
- literal
- `{ `} `:: `* `, `( `) `;
-
- token var_ref
- / "$" [a-zA-Z_][a-zA-Z_0-9]* /
- {
- if GblActionParams
- {
- input->push( make_token(
- typeid<var_ref>, input->pull( match_length ) ) )
- }
- else
- {
- # Just pull one char. Don't consume the word because it may
- # be a keyword.
- input->push( make_token(
- typeid<c_any>, input->pull( 1 ) ) )
- }
- }
-
- token c_any
- / any /
- end
-
-end
-
-namespace host
- lex
- literal `%%{
-
- token close_inc /'}--%%'/
- {
- input->push( make_token( typeid<close_inc>, input->pull( match_length ) ) )
- restoreGlobals()
- }
-
- token close_imp /'}++%%'/
- {
- input->push( make_token( typeid<close_imp>, input->pull( match_length ) ) )
- restoreGlobals()
- }
-
- token slr / '%%' [^{] [^\n]* '\n' /
- {
- # Translates single line to multi-line
- input->pull( 2 )
- R: str = input->pull( match_length - 3 )
- input->push( "}%%" )
- input->push( R )
- input->push( "%%{" )
- }
-
- rl NL / '\n' /
-
- rl s_literal
- / "'" ([^'\\\n] | '\\' (any | NL))* "'" /
-
- rl d_literal
- / '"' ([^"\\] | NL | '\\' (any | NL))* '"' /
-
- literal `define `=
-
- token ident /ident "'"?/
- token number /digit+/
- token hex_number /'0x' [0-9a-fA-F]+/
-
- token comment
- / c_comment | cpp_comment /
-
- token string
- / s_literal | d_literal /
-
- token whitespace
- / ( [ \t] | NL )+ /
-
- token c_any / any /
- end
-
- def tok
- [`define whitespace ident whitespace? number] :ImportDefNum
- | [`define whitespace ident whitespace? string] :ImportDefStr
- | [ident whitespace? `= whitespace? number] :ImportAssignNum
- | [ident whitespace? `= whitespace? string] :ImportAssignStr
- | [`define] :Def
- | [`=] :Eq
- | [ident] :Ident
- | [number] :Number
- | [hex_number] :HexNumber
- | [comment] :Comment
- | [string] :String
- | [whitespace] :Whitespace
- | [c_any] :Any
-end
-
-reduction TopLevel
-
- # Pass Through.
- # def tok
- # [`define ident number] :Def1
- # | [`define ident string] :Def2
- # | [ident `= number] :Ass1
- # | [ident `= string] :Ass2
- # [`define whitespace ident whitespace? number] :ImportDefNum
- # | [`define whitespace ident whitespace? string] :ImportDefStr
- # | [ident whitespace? `= whitespace? number] :ImportAssignNum
- # | [ident whitespace? `= whitespace? string] :ImportAssignStr
- # | [`define] :Def
- # | [`=] :Eq
- # | [ident] :Ident
- # | [number] :Number
- # | [hex_number] :HexNumber
- # | [comment] :Comment
- # | [string] :String
- # | [whitespace] :Whitespace
- # | [c_any] :Any
-
- host::tok :ImportDefNum
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @number,
- false /* $number->neg */, $number->data,
- $number->length, Literal::Number );
-
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportDefStr
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @string, false,
- $string->data, $string->length, Literal::LitString );
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportAssignNum
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @number,
- false /*$number->neg */, $number->data,
- $number->length, Literal::Number );
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportAssignStr
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @string, false,
- $string->data, $string->length, Literal::LitString );
-
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
-
-end
-
-export RagelError: str
-
-# File name. The open is expected to succeed. It is tested before the colm
-# program is called.
-A: list_el<str> = argv->pop_head_el()
-GblFileName = A->value
-
-# Remaining items are include paths.
-while ( argv->length > 0 ) {
- A = argv->pop_head_el()
- GblIncludePaths->push_tail_el( A )
-}
-
-Stream: stream = open( GblFileName, "r" )
-reduce TopLevel start[ Stream ]
-RagelError = error
diff --git a/ragel/host-d/.gitignore b/ragel/host-d/.gitignore
deleted file mode 100644
index 353df34b..00000000
--- a/ragel/host-d/.gitignore
+++ /dev/null
@@ -1,13 +0,0 @@
-/Makefile
-/Makefile.in
-/.deps
-/.libs
-/ragel-d
-/ragel-d.exe
-/rlhc.c
-/rlparse.pack
-/rlparse.c
-/rlreduce.cc
-
-/CMakeFiles
-/cmake_install.cmake
diff --git a/ragel/host-d/CMakeLists.txt b/ragel/host-d/CMakeLists.txt
deleted file mode 100644
index c302fabc..00000000
--- a/ragel/host-d/CMakeLists.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-add_custom_command(OUTPUT
- "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc"
- DEPENDS rlparse.lm
- COMMAND colm::colm
- ARGS -I.. -c -b rlparseD
- -o "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- -m "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc"
- rlparse.lm
- WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}")
-
-add_custom_command(OUTPUT
- "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- DEPENDS rlhc.lm
- COMMAND colm::colm
- ARGS -I.. -c -b rlhcD
- -o "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- rlhc.lm
- WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}")
-
-add_executable(ragel-d main.cc
- "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc")
-
-target_link_libraries(ragel-d PRIVATE libragel libfsm)
-
-if(${PROJECT_NAME}_MAKE_INSTALL)
- install(TARGETS ragel-d
- EXPORT ${_PACKAGE_NAME}-targets
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
-endif()
diff --git a/ragel/host-d/Makefile.am b/ragel/host-d/Makefile.am
deleted file mode 100644
index aae8d6fe..00000000
--- a/ragel/host-d/Makefile.am
+++ /dev/null
@@ -1,32 +0,0 @@
-COLM_BIN = ../../colm/colm
-COLM_WRAP = ../../colm/colm-wrap
-COLM_LA = ../../colm/libcolm.la
-COLM_LIBDEP = $(COLM_LA)
-COLM_BINDEP = $(COLM_BIN) $(COLM_WRAP)
-
-bin_PROGRAMS = ragel-d
-
-ragel_d_CPPFLAGS = -I$(top_srcdir)/aapl -I$(top_srcdir)/ragel -I$(top_srcdir)/colm/include
-
-dist_ragel_d_SOURCES = main.cc rlhc.c
-
-nodist_ragel_d_SOURCES = \
- rlparse.c rlreduce.cc
-
-ragel_d_LDADD = ../libragel.la ../libfsm.la $(COLM_LA)
-
-BUILT_SOURCES = rlparse.c rlreduce.cc rlhc.c
-
-EXTRA_DIST = rlparse.lm rlhc.lm
-
-rlparse.pack: rlparse.lm $(COLM_BINDEP)
- $(COLM_WRAP) -c -I .. -b rlparseD -o $@ -p rlparse.c -m rlreduce.cc $<
-
-rlparse.c: rlparse.pack
- $(COLM_WRAP) -o $@ $<
-
-rlreduce.cc: rlparse.pack
- $(COLM_WRAP) -o $@ $<
-
-rlhc.c: rlhc.lm ../ril.lm $(COLM_BINDEP)
- $(COLM_BIN) -c -I .. -b rlhcD -o $@ $<
diff --git a/ragel/host-d/main.cc b/ragel/host-d/main.cc
deleted file mode 100644
index f6eb7cbe..00000000
--- a/ragel/host-d/main.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright 2001-2018 Adrian Thurston <thurston@colm.net>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include "inputdata.h"
-
-extern struct colm_sections rlparseD;
-extern struct colm_sections rlhcD;
-
-/*
- * D
- */
-
-const char *defaultOutFnD( const char *inputFileName )
-{
- const char *ext = findFileExtension( inputFileName );
- if ( ext != 0 && strcmp( ext, ".rh" ) == 0 )
- return fileNameFromStem( inputFileName, ".h" );
- else
- return fileNameFromStem( inputFileName, ".d" );
-}
-
-HostType hostTypesD[] =
-{
- { "byte", 0, "byte", true, true, false, CHAR_MIN, CHAR_MAX, 0, 0, 1 },
- { "ubyte", 0, "ubyte", false, true, false, 0, 0, 0, UCHAR_MAX, 1 },
- { "char", 0, "char", false, true, false, 0, 0, 0, UCHAR_MAX, 1 },
- { "short", 0, "short", true, true, false, SHRT_MIN, SHRT_MAX, 0, 0, 2 },
- { "ushort", 0, "ushort", false, true, false, 0, 0, 0, USHRT_MAX, 2 },
- { "wchar", 0, "wchar", false, true, false, 0, 0, 0, USHRT_MAX, 2 },
- { "int", 0, "int", true, true, false, INT_MIN, INT_MAX, 0, 0, 4 },
- { "uint", 0, "uint", false, true, false, 0, 0, 0, UINT_MAX, 4 },
- { "dchar", 0, "dchar", false, true, false, 0, 0, 0, UINT_MAX, 4 },
-};
-
-const HostLang hostLangD =
-{
- hostTypesD,
- 9,
- 2,
- true,
- false, /* loopLabels */
- Translated,
- GotoFeature,
- &makeCodeGen,
- &defaultOutFnD,
- &genLineDirectiveTrans
-};
-
-int main( int argc, const char **argv )
-{
- InputData id( &hostLangD, &rlparseD, &rlhcD );
- return id.rlhcMain( argc, argv );
-}
diff --git a/ragel/host-d/rlparse.lm b/ragel/host-d/rlparse.lm
deleted file mode 100644
index 05b21ea2..00000000
--- a/ragel/host-d/rlparse.lm
+++ /dev/null
@@ -1,211 +0,0 @@
-include 'ragel.lm'
-include 'rlreduce.lm'
-
-namespace inline
- lex
- literal `fpc `fc `fcurs `ftargs
- `fentry `fhold `fexec `fgoto `fnext
- `fcall `fret `fbreak `fncall `fnret `fnbreak
-
- token ident /ident/
- token number /digit+/
- token hex_number /'0x' [0-9a-fA-F]+/
- token dec_number /'0x' [0-9a-fA-F]+/
-
- token comment
- / c_comment | cpp_comment /
-
- token string
- / s_literal | d_literal /
-
- token whitespace
- / ( [ \t] | NL )+ /
-
- literal
- `{ `} `:: `* `, `( `) `;
-
- token var_ref
- / "$" [a-zA-Z_][a-zA-Z_0-9]* /
- {
- if GblActionParams
- {
- input->push( make_token(
- typeid<var_ref>, input->pull( match_length ) ) )
- }
- else
- {
- # Just pull one char. Don't consume the word because it may
- # be a keyword.
- input->push( make_token(
- typeid<c_any>, input->pull( 1 ) ) )
- }
- }
-
- token c_any
- / any /
- end
-
-end
-
-namespace host
- lex
- literal `%%{
-
- token close_inc /'}--%%'/
- {
- input->push( make_token( typeid<close_inc>, input->pull( match_length ) ) )
- restoreGlobals()
- }
-
- token close_imp /'}++%%'/
- {
- input->push( make_token( typeid<close_imp>, input->pull( match_length ) ) )
- restoreGlobals()
- }
-
- token slr / '%%' [^{] [^\n]* '\n' /
- {
- # Translates single line to multi-line
- input->pull( 2 )
- R: str = input->pull( match_length - 3 )
- input->push( "}%%" )
- input->push( R )
- input->push( "%%{" )
- }
-
- rl NL / '\n' /
-
- rl s_literal
- / "'" ([^'\\\n] | '\\' (any | NL))* "'" /
-
- rl d_literal
- / '"' ([^"\\] | NL | '\\' (any | NL))* '"' /
-
- literal `define `=
-
- token ident /ident "'"?/
- token number /digit+/
- token hex_number /'0x' [0-9a-fA-F]+/
-
- token comment
- / c_comment | cpp_comment /
-
- token string
- / s_literal | d_literal /
-
- token whitespace
- / ( [ \t] | NL )+ /
-
- token c_any / any /
- end
-
- def tok
- [`define whitespace ident whitespace? number] :ImportDefNum
- | [`define whitespace ident whitespace? string] :ImportDefStr
- | [ident whitespace? `= whitespace? number] :ImportAssignNum
- | [ident whitespace? `= whitespace? string] :ImportAssignStr
- | [`define] :Def
- | [`=] :Eq
- | [ident] :Ident
- | [number] :Number
- | [hex_number] :HexNumber
- | [comment] :Comment
- | [string] :String
- | [whitespace] :Whitespace
- | [c_any] :Any
-end
-
-reduction TopLevel
-
- # Pass Through.
- # def tok
- # [`define ident number] :Def1
- # | [`define ident string] :Def2
- # | [ident `= number] :Ass1
- # | [ident `= string] :Ass2
- # [`define whitespace ident whitespace? number] :ImportDefNum
- # | [`define whitespace ident whitespace? string] :ImportDefStr
- # | [ident whitespace? `= whitespace? number] :ImportAssignNum
- # | [ident whitespace? `= whitespace? string] :ImportAssignStr
- # | [`define] :Def
- # | [`=] :Eq
- # | [ident] :Ident
- # | [number] :Number
- # | [hex_number] :HexNumber
- # | [comment] :Comment
- # | [string] :String
- # | [whitespace] :Whitespace
- # | [c_any] :Any
-
- host::tok :ImportDefNum
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @number,
- false /* $number->neg */, $number->data,
- $number->length, Literal::Number );
-
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- else
- {
- if ( includeDepth == 0 ) {
- id->curItem->data.write( "define ", 7 );
- id->curItem->data.write( $ident->data, $ident->length );
- id->curItem->data.write( " ", 1 );
- id->curItem->data.write( $number->data, $number->length );
- }
- }
- }
- host::tok :ImportDefStr
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @string, false,
- $string->data, $string->length, Literal::LitString );
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportAssignNum
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @number,
- false /*$number->neg */, $number->data,
- $number->length, Literal::Number );
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportAssignStr
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @string, false,
- $string->data, $string->length, Literal::LitString );
-
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
-
-end
-
-export RagelError: str
-
-# File name. The open is expected to succeed. It is tested before the colm
-# program is called.
-A: list_el<str> = argv->pop_head_el()
-GblFileName = A->value
-
-# Remaining items are include paths.
-while ( argv->length > 0 ) {
- A = argv->pop_head_el()
- GblIncludePaths->push_tail_el( A )
-}
-
-Stream: stream = open( GblFileName, "r" )
-reduce TopLevel start[ Stream ]
-RagelError = error
diff --git a/ragel/host-go/.gitignore b/ragel/host-go/.gitignore
deleted file mode 100644
index b7a6e0cc..00000000
--- a/ragel/host-go/.gitignore
+++ /dev/null
@@ -1,13 +0,0 @@
-/Makefile
-/Makefile.in
-/.deps
-/.libs
-/ragel-go
-/ragel-go.exe
-/rlhc.c
-/rlparse.pack
-/rlparse.c
-/rlreduce.cc
-
-/CMakeFiles
-/cmake_install.cmake
diff --git a/ragel/host-go/CMakeLists.txt b/ragel/host-go/CMakeLists.txt
deleted file mode 100644
index 2ae44311..00000000
--- a/ragel/host-go/CMakeLists.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-add_custom_command(OUTPUT
- "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc"
- DEPENDS rlparse.lm
- COMMAND colm::colm
- ARGS -I.. -c -b rlparseGo
- -o "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- -m "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc"
- rlparse.lm
- WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}")
-
-add_custom_command(OUTPUT
- "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- DEPENDS rlhc.lm
- COMMAND colm::colm
- ARGS -I.. -c -b rlhcGo
- -o "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- rlhc.lm
- WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}")
-
-add_executable(ragel-go main.cc
- "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc")
-
-target_link_libraries(ragel-go PRIVATE libragel libfsm)
-
-if(${PROJECT_NAME}_MAKE_INSTALL)
- install(TARGETS ragel-go
- EXPORT ${_PACKAGE_NAME}-targets
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
-endif()
diff --git a/ragel/host-go/Makefile.am b/ragel/host-go/Makefile.am
deleted file mode 100644
index e775096d..00000000
--- a/ragel/host-go/Makefile.am
+++ /dev/null
@@ -1,34 +0,0 @@
-COLM_BIN = ../../colm/colm
-COLM_WRAP = ../../colm/colm-wrap
-COLM_LA = ../../colm/libcolm.la
-COLM_LIBDEP = $(COLM_LA)
-COLM_BINDEP = $(COLM_BIN) $(COLM_WRAP)
-
-bin_PROGRAMS = ragel-go
-
-data_DATA = out-go.lm
-
-ragel_go_CPPFLAGS = -I$(top_srcdir)/aapl -I$(top_srcdir)/ragel -I$(top_srcdir)/colm/include
-
-dist_ragel_go_SOURCES = main.cc rlhc.c
-
-nodist_ragel_go_SOURCES = \
- rlparse.c rlreduce.cc
-
-ragel_go_LDADD = ../libragel.la ../libfsm.la $(COLM_LA)
-
-BUILT_SOURCES = rlparse.c rlreduce.cc rlhc.c
-
-EXTRA_DIST = rlparse.lm rlhc.lm out-go.lm
-
-rlparse.pack: rlparse.lm $(COLM_BINDEP)
- $(COLM_WRAP) -c -I .. -b rlparseGo -o $@ -p rlparse.c -m rlreduce.cc $<
-
-rlparse.c: rlparse.pack
- $(COLM_WRAP) -o $@ $<
-
-rlreduce.cc: rlparse.pack
- $(COLM_WRAP) -o $@ $<
-
-rlhc.c: rlhc.lm ../ril.lm $(COLM_BINDEP)
- $(COLM_BIN) -c -I .. -b rlhcGo -o $@ $<
diff --git a/ragel/host-go/main.cc b/ragel/host-go/main.cc
deleted file mode 100644
index 99fb50d7..00000000
--- a/ragel/host-go/main.cc
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2001-2018 Adrian Thurston <thurston@colm.net>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include "inputdata.h"
-
-extern struct colm_sections rlparseGo;
-extern struct colm_sections rlhcGo;
-
-/*
- * Go
- */
-
-const char *defaultOutFnGo( const char *inputFileName )
-{
- return fileNameFromStem( inputFileName, ".go" );
-}
-
-HostType hostTypesGo[] =
-{
- { "byte", 0, "uint8", false, true, false, 0, 0, U8BIT_MIN, U8BIT_MAX, 1 },
- { "int8", 0, "int8", true, true, false, S8BIT_MIN, S8BIT_MAX, 0, 0, 1 },
- { "uint8", 0, "uint8", false, true, false, 0, 0, U8BIT_MIN, U8BIT_MAX, 1 },
- { "int16", 0, "int16", true, true, false, S16BIT_MIN, S16BIT_MAX, 0, 0, 2 },
- { "uint16", 0, "uint16", false, true, false, 0, 0, U16BIT_MIN, U16BIT_MAX, 2 },
- { "int32", 0, "int32", true, true, false, S32BIT_MIN, S32BIT_MAX, 0, 0, 4 },
- { "uint32", 0, "uint32", false, true, false, 0, 0, U32BIT_MIN, U32BIT_MAX, 4 },
- { "int64", 0, "int64", true, true, false, S64BIT_MIN, S64BIT_MAX, 0, 0, 8 },
- { "uint64", 0, "uint64", false, true, false, 0, 0, U64BIT_MIN, U64BIT_MAX, 8 },
- { "rune", 0, "int32", true, true, true, S32BIT_MIN, S32BIT_MAX, 0, 0, 4 },
-};
-
-const HostLang hostLangGo =
-{
- hostTypesGo,
- 10,
- 0,
- false,
- false, /* loopLabels */
- Translated,
- GotoFeature,
- &makeCodeGen,
- &defaultOutFnGo,
- &genLineDirectiveTrans
-};
-
-
-int main( int argc, const char **argv )
-{
- InputData id( &hostLangGo, &rlparseGo, &rlhcGo );
- return id.rlhcMain( argc, argv );
-}
diff --git a/ragel/host-go/out-go.lm b/ragel/host-go/out-go.lm
deleted file mode 100644
index 63d2731b..00000000
--- a/ragel/host-go/out-go.lm
+++ /dev/null
@@ -1,47 +0,0 @@
-namespace out_go
- token _IN_ /''/
- token _EX_ /''/
-
- lex
- token comment /
- '//' any* :> '\n' |
- '/*' any* :>> '*/'
- /
-
- token id
- /[a-zA-Z_][a-zA-Z_0-9]*/
-
- token number /
- [0-9]+
- /
-
- token symbol /
- '!' | '#' | '$' | '%' | '&' | '(' | ')' | '*' |
- '+' | ',' | '-' | '.' | '/' | ':' | ';' | '<' |
- '=' | '>' | '?' | '@' | '[' | ']' | '^' | '|' |
- '~' /
-
- literal `{ `}
-
- token string /
- '"' ( [^"\\] | '\\' any ) * '"' |
- "'" ( [^'\\] | '\\' any ) * "'"
- /
-
- ignore
- /[ \t\v\r\n]+/
- end
-
- def item
- [comment]
- | [id]
- | [number]
- | [symbol]
- | [string]
- | [`{ _IN_ item* _EX_ `} ]
-
- def out_go
- [_IN_ _EX_ item*]
-end
-
-
diff --git a/ragel/host-go/rlparse.lm b/ragel/host-go/rlparse.lm
deleted file mode 100644
index 100a9223..00000000
--- a/ragel/host-go/rlparse.lm
+++ /dev/null
@@ -1,202 +0,0 @@
-include 'ragel.lm'
-include 'rlreduce.lm'
-
-namespace inline
- lex
- literal `fpc `fc `fcurs `ftargs
- `fentry `fhold `fexec `fgoto `fnext
- `fcall `fret `fbreak `fncall `fnret `fnbreak
-
- token ident /ident/
- token number /digit+/
- token hex_number /'0x' [0-9a-fA-F]+/
- token dec_number /'0x' [0-9a-fA-F]+/
-
- token comment
- / c_comment | cpp_comment /
-
- token string
- / s_literal | d_literal /
-
- token whitespace
- / ( [ \t] | NL )+ /
-
- literal
- `{ `} `:: `* `, `( `) `;
-
- token var_ref
- / "$" [a-zA-Z_][a-zA-Z_0-9]* /
- {
- if GblActionParams
- {
- input->push( make_token(
- typeid<var_ref>, input->pull( match_length ) ) )
- }
- else
- {
- # Just pull one char. Don't consume the word because it may
- # be a keyword.
- input->push( make_token(
- typeid<c_any>, input->pull( 1 ) ) )
- }
- }
-
- token c_any
- / any /
- end
-
-end
-
-namespace host
- lex
- literal `%%{
-
- token close_inc /'}--%%'/
- {
- input->push( make_token( typeid<close_inc>, input->pull( match_length ) ) )
- restoreGlobals()
- }
-
- token close_imp /'}++%%'/
- {
- input->push( make_token( typeid<close_imp>, input->pull( match_length ) ) )
- restoreGlobals()
- }
-
- token slr / '%%' [^{] [^\n]* '\n' /
- {
- # Translates single line to multi-line
- input->pull( 2 )
- R: str = input->pull( match_length - 3 )
- input->push( "}%%" )
- input->push( R )
- input->push( "%%{" )
- }
-
- rl NL / '\n' /
-
- rl s_literal
- / "'" ([^'\\\n] | '\\' (any | NL))* "'" /
-
- rl d_literal
- / '"' ([^"\\] | NL | '\\' (any | NL))* '"' /
-
- literal `define `=
-
- token ident /ident "'"?/
- token number /digit+/
- token hex_number /'0x' [0-9a-fA-F]+/
-
- token comment
- / c_comment | cpp_comment /
-
- token string
- / s_literal | d_literal /
-
- token whitespace
- / ( [ \t] | NL )+ /
-
- token c_any / any /
- end
-
- def tok
- [`define whitespace ident whitespace? number] :ImportDefNum
- | [`define whitespace ident whitespace? string] :ImportDefStr
- | [ident whitespace? `= whitespace? number] :ImportAssignNum
- | [ident whitespace? `= whitespace? string] :ImportAssignStr
- | [`define] :Def
- | [`=] :Eq
- | [ident] :Ident
- | [number] :Number
- | [hex_number] :HexNumber
- | [comment] :Comment
- | [string] :String
- | [whitespace] :Whitespace
- | [c_any] :Any
-end
-
-reduction TopLevel
-
- # Pass Through.
- # def tok
- # [`define ident number] :Def1
- # | [`define ident string] :Def2
- # | [ident `= number] :Ass1
- # | [ident `= string] :Ass2
- # [`define whitespace ident whitespace? number] :ImportDefNum
- # | [`define whitespace ident whitespace? string] :ImportDefStr
- # | [ident whitespace? `= whitespace? number] :ImportAssignNum
- # | [ident whitespace? `= whitespace? string] :ImportAssignStr
- # | [`define] :Def
- # | [`=] :Eq
- # | [ident] :Ident
- # | [number] :Number
- # | [hex_number] :HexNumber
- # | [comment] :Comment
- # | [string] :String
- # | [whitespace] :Whitespace
- # | [c_any] :Any
-
- host::tok :ImportDefNum
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @number,
- false /* $number->neg */, $number->data,
- $number->length, Literal::Number );
-
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportDefStr
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @string, false,
- $string->data, $string->length, Literal::LitString );
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportAssignNum
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @number,
- false /*$number->neg */, $number->data,
- $number->length, Literal::Number );
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportAssignStr
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @string, false,
- $string->data, $string->length, Literal::LitString );
-
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
-
-end
-
-export RagelError: str
-
-# File name. The open is expected to succeed. It is tested before the colm
-# program is called.
-A: list_el<str> = argv->pop_head_el()
-GblFileName = A->value
-
-# Remaining items are include paths.
-while ( argv->length > 0 ) {
- A = argv->pop_head_el()
- GblIncludePaths->push_tail_el( A )
-}
-
-Stream: stream = open( GblFileName, "r" )
-reduce TopLevel start[ Stream ]
-RagelError = error
diff --git a/ragel/host-java/.gitignore b/ragel/host-java/.gitignore
deleted file mode 100644
index 9b83d82e..00000000
--- a/ragel/host-java/.gitignore
+++ /dev/null
@@ -1,13 +0,0 @@
-/Makefile
-/Makefile.in
-/.deps
-/.libs
-/ragel-java
-/ragel-java.exe
-/rlhc.c
-/rlparse.pack
-/rlparse.c
-/rlreduce.cc
-
-/CMakeFiles
-/cmake_install.cmake
diff --git a/ragel/host-java/CMakeLists.txt b/ragel/host-java/CMakeLists.txt
deleted file mode 100644
index eb9fb876..00000000
--- a/ragel/host-java/CMakeLists.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-add_custom_command(OUTPUT
- "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc"
- DEPENDS rlparse.lm
- COMMAND colm::colm
- ARGS -I.. -c -b rlparseJava
- -o "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- -m "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc"
- rlparse.lm
- WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}")
-
-add_custom_command(OUTPUT
- "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- DEPENDS rlhc.lm
- COMMAND colm::colm
- ARGS -I.. -c -b rlhcJava
- -o "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- rlhc.lm
- WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}")
-
-add_executable(ragel-java main.cc
- "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc")
-
-target_link_libraries(ragel-java PRIVATE libragel libfsm)
-
-if(${PROJECT_NAME}_MAKE_INSTALL)
- install(TARGETS ragel-java
- EXPORT ${_PACKAGE_NAME}-targets
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
-endif()
diff --git a/ragel/host-java/Makefile.am b/ragel/host-java/Makefile.am
deleted file mode 100644
index 44521de1..00000000
--- a/ragel/host-java/Makefile.am
+++ /dev/null
@@ -1,32 +0,0 @@
-COLM_BIN = ../../colm/colm
-COLM_WRAP = ../../colm/colm-wrap
-COLM_LA = ../../colm/libcolm.la
-COLM_LIBDEP = $(COLM_LA)
-COLM_BINDEP = $(COLM_BIN) $(COLM_WRAP)
-
-bin_PROGRAMS = ragel-java
-
-ragel_java_CPPFLAGS = -I$(top_srcdir)/aapl -I$(top_srcdir)/ragel -I$(top_srcdir)/colm/include
-
-dist_ragel_java_SOURCES = main.cc rlhc.c
-
-nodist_ragel_java_SOURCES = \
- rlparse.c rlreduce.cc
-
-ragel_java_LDADD = ../libragel.la ../libfsm.la $(COLM_LA)
-
-BUILT_SOURCES = rlparse.c rlreduce.cc rlhc.c
-
-EXTRA_DIST = rlparse.lm rlhc.lm
-
-rlparse.pack: rlparse.lm $(COLM_BINDEP)
- $(COLM_WRAP) -c -I .. -b rlparseJava -o $@ -p rlparse.c -m rlreduce.cc $<
-
-rlparse.c: rlparse.pack
- $(COLM_WRAP) -o $@ $<
-
-rlreduce.cc: rlparse.pack
- $(COLM_WRAP) -o $@ $<
-
-rlhc.c: rlhc.lm ../ril.lm $(COLM_BINDEP)
- $(COLM_BIN) -c -I .. -b rlhcJava -o $@ $<
diff --git a/ragel/host-java/main.cc b/ragel/host-java/main.cc
deleted file mode 100644
index d4efd3fc..00000000
--- a/ragel/host-java/main.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright 2001-2018 Adrian Thurston <thurston@colm.net>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include "inputdata.h"
-
-extern struct colm_sections rlparseJava;
-extern struct colm_sections rlhcJava;
-
-/*
- * Java
- */
-
-const char *defaultOutFnJava( const char *inputFileName )
-{
- return fileNameFromStem( inputFileName, ".java" );
-}
-
-HostType hostTypesJava[] =
-{
- { "byte", 0, "byte", true, true, false, CHAR_MIN, CHAR_MAX, 0, 0, 1 },
- { "short", 0, "short", true, true, false, SHRT_MIN, SHRT_MAX, 0, 0, 2 },
- { "char", 0, "char", false, true, false, 0, 0, 0, USHRT_MAX, 2 },
- { "int", 0, "int", true, true, false, INT_MIN, INT_MAX, 0, 0, 4 },
-};
-
-const HostLang hostLangJava =
-{
- hostTypesJava,
- 4,
- 2,
- false,
- true, /* loopLabels */
- Translated,
- BreakFeature,
- &makeCodeGen,
- &defaultOutFnJava,
- &genLineDirectiveTrans
-};
-
-
-int main( int argc, const char **argv )
-{
- InputData id( &hostLangJava, &rlparseJava, &rlhcJava );
- return id.rlhcMain( argc, argv );
-}
diff --git a/ragel/host-java/rlparse.lm b/ragel/host-java/rlparse.lm
deleted file mode 100644
index 100a9223..00000000
--- a/ragel/host-java/rlparse.lm
+++ /dev/null
@@ -1,202 +0,0 @@
-include 'ragel.lm'
-include 'rlreduce.lm'
-
-namespace inline
- lex
- literal `fpc `fc `fcurs `ftargs
- `fentry `fhold `fexec `fgoto `fnext
- `fcall `fret `fbreak `fncall `fnret `fnbreak
-
- token ident /ident/
- token number /digit+/
- token hex_number /'0x' [0-9a-fA-F]+/
- token dec_number /'0x' [0-9a-fA-F]+/
-
- token comment
- / c_comment | cpp_comment /
-
- token string
- / s_literal | d_literal /
-
- token whitespace
- / ( [ \t] | NL )+ /
-
- literal
- `{ `} `:: `* `, `( `) `;
-
- token var_ref
- / "$" [a-zA-Z_][a-zA-Z_0-9]* /
- {
- if GblActionParams
- {
- input->push( make_token(
- typeid<var_ref>, input->pull( match_length ) ) )
- }
- else
- {
- # Just pull one char. Don't consume the word because it may
- # be a keyword.
- input->push( make_token(
- typeid<c_any>, input->pull( 1 ) ) )
- }
- }
-
- token c_any
- / any /
- end
-
-end
-
-namespace host
- lex
- literal `%%{
-
- token close_inc /'}--%%'/
- {
- input->push( make_token( typeid<close_inc>, input->pull( match_length ) ) )
- restoreGlobals()
- }
-
- token close_imp /'}++%%'/
- {
- input->push( make_token( typeid<close_imp>, input->pull( match_length ) ) )
- restoreGlobals()
- }
-
- token slr / '%%' [^{] [^\n]* '\n' /
- {
- # Translates single line to multi-line
- input->pull( 2 )
- R: str = input->pull( match_length - 3 )
- input->push( "}%%" )
- input->push( R )
- input->push( "%%{" )
- }
-
- rl NL / '\n' /
-
- rl s_literal
- / "'" ([^'\\\n] | '\\' (any | NL))* "'" /
-
- rl d_literal
- / '"' ([^"\\] | NL | '\\' (any | NL))* '"' /
-
- literal `define `=
-
- token ident /ident "'"?/
- token number /digit+/
- token hex_number /'0x' [0-9a-fA-F]+/
-
- token comment
- / c_comment | cpp_comment /
-
- token string
- / s_literal | d_literal /
-
- token whitespace
- / ( [ \t] | NL )+ /
-
- token c_any / any /
- end
-
- def tok
- [`define whitespace ident whitespace? number] :ImportDefNum
- | [`define whitespace ident whitespace? string] :ImportDefStr
- | [ident whitespace? `= whitespace? number] :ImportAssignNum
- | [ident whitespace? `= whitespace? string] :ImportAssignStr
- | [`define] :Def
- | [`=] :Eq
- | [ident] :Ident
- | [number] :Number
- | [hex_number] :HexNumber
- | [comment] :Comment
- | [string] :String
- | [whitespace] :Whitespace
- | [c_any] :Any
-end
-
-reduction TopLevel
-
- # Pass Through.
- # def tok
- # [`define ident number] :Def1
- # | [`define ident string] :Def2
- # | [ident `= number] :Ass1
- # | [ident `= string] :Ass2
- # [`define whitespace ident whitespace? number] :ImportDefNum
- # | [`define whitespace ident whitespace? string] :ImportDefStr
- # | [ident whitespace? `= whitespace? number] :ImportAssignNum
- # | [ident whitespace? `= whitespace? string] :ImportAssignStr
- # | [`define] :Def
- # | [`=] :Eq
- # | [ident] :Ident
- # | [number] :Number
- # | [hex_number] :HexNumber
- # | [comment] :Comment
- # | [string] :String
- # | [whitespace] :Whitespace
- # | [c_any] :Any
-
- host::tok :ImportDefNum
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @number,
- false /* $number->neg */, $number->data,
- $number->length, Literal::Number );
-
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportDefStr
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @string, false,
- $string->data, $string->length, Literal::LitString );
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportAssignNum
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @number,
- false /*$number->neg */, $number->data,
- $number->length, Literal::Number );
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportAssignStr
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @string, false,
- $string->data, $string->length, Literal::LitString );
-
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
-
-end
-
-export RagelError: str
-
-# File name. The open is expected to succeed. It is tested before the colm
-# program is called.
-A: list_el<str> = argv->pop_head_el()
-GblFileName = A->value
-
-# Remaining items are include paths.
-while ( argv->length > 0 ) {
- A = argv->pop_head_el()
- GblIncludePaths->push_tail_el( A )
-}
-
-Stream: stream = open( GblFileName, "r" )
-reduce TopLevel start[ Stream ]
-RagelError = error
diff --git a/ragel/host-js/.gitignore b/ragel/host-js/.gitignore
deleted file mode 100644
index 6721152a..00000000
--- a/ragel/host-js/.gitignore
+++ /dev/null
@@ -1,13 +0,0 @@
-/Makefile
-/Makefile.in
-/.deps
-/.libs
-/ragel-js
-/ragel-js.exe
-/rlhc.c
-/rlparse.pack
-/rlparse.c
-/rlreduce.cc
-
-/CMakeFiles
-/cmake_install.cmake
diff --git a/ragel/host-js/CMakeLists.txt b/ragel/host-js/CMakeLists.txt
deleted file mode 100644
index f0795f36..00000000
--- a/ragel/host-js/CMakeLists.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-add_custom_command(OUTPUT
- "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc"
- DEPENDS rlparse.lm
- COMMAND colm::colm
- ARGS -I.. -c -b rlparseJs
- -o "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- -m "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc"
- rlparse.lm
- WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}")
-
-add_custom_command(OUTPUT
- "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- DEPENDS rlhc.lm
- COMMAND colm::colm
- ARGS -I.. -c -b rlhcJs
- -o "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- rlhc.lm
- WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}")
-
-add_executable(ragel-js main.cc
- "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc")
-
-target_link_libraries(ragel-js PRIVATE libragel libfsm)
-
-if(${PROJECT_NAME}_MAKE_INSTALL)
- install(TARGETS ragel-js
- EXPORT ${_PACKAGE_NAME}-targets
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
-endif()
diff --git a/ragel/host-js/Makefile.am b/ragel/host-js/Makefile.am
deleted file mode 100644
index db08d249..00000000
--- a/ragel/host-js/Makefile.am
+++ /dev/null
@@ -1,32 +0,0 @@
-COLM_BIN = ../../colm/colm
-COLM_WRAP = ../../colm/colm-wrap
-COLM_LA = ../../colm/libcolm.la
-COLM_LIBDEP = $(COLM_LA)
-COLM_BINDEP = $(COLM_BIN) $(COLM_WRAP)
-
-bin_PROGRAMS = ragel-js
-
-ragel_js_CPPFLAGS = -I$(top_srcdir)/aapl -I$(top_srcdir)/ragel -I$(top_srcdir)/colm/include
-
-dist_ragel_js_SOURCES = main.cc rlhc.c
-
-nodist_ragel_js_SOURCES = \
- rlparse.c rlreduce.cc
-
-ragel_js_LDADD = ../libragel.la ../libfsm.la $(COLM_LA)
-
-BUILT_SOURCES = rlparse.c rlreduce.cc rlhc.c
-
-EXTRA_DIST = rlparse.lm rlhc.lm
-
-rlparse.pack: rlparse.lm $(COLM_BINDEP)
- $(COLM_WRAP) -c -I .. -b rlparseJs -o $@ -p rlparse.c -m rlreduce.cc $<
-
-rlparse.c: rlparse.pack
- $(COLM_WRAP) -o $@ $<
-
-rlreduce.cc: rlparse.pack
- $(COLM_WRAP) -o $@ $<
-
-rlhc.c: rlhc.lm ../ril.lm $(COLM_BINDEP)
- $(COLM_BIN) -c -I .. -b rlhcJs -o $@ $<
diff --git a/ragel/host-js/main.cc b/ragel/host-js/main.cc
deleted file mode 100644
index 44796436..00000000
--- a/ragel/host-js/main.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright 2001-2018 Adrian Thurston <thurston@colm.net>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include "inputdata.h"
-
-extern struct colm_sections rlparseJs;
-extern struct colm_sections rlhcJs;
-
-/*
- * JavaScript
- */
-
-const char *defaultOutFnJs( const char *inputFileName )
-{
- return fileNameFromStem( inputFileName, ".js" );
-}
-
-HostType hostTypesJS[] =
-{
- { "s8", 0, "int8", true, true, false, CHAR_MIN, CHAR_MAX, 0, 0, 1 },
- { "u8", 0, "uint8", false, true, false, 0, 0, 0, UCHAR_MAX, 1 },
- { "s16", 0, "int16", true, true, false, SHRT_MIN, SHRT_MAX, 0, 0, 2 },
- { "u16", 0, "uint16", false, true, false, 0, 0, 0, USHRT_MAX, 2 },
- { "i32", 0, "int32", true, true, false, INT_MIN, INT_MAX, 0, 0, 4 },
- { "u32", 0, "uint32", false, true, false, 0, 0, 0, UINT_MAX, 4 },
- { "number", 0, "number", true, true, false, LONG_MIN, LONG_MAX, 0, 0, 8 },
-};
-
-const HostLang hostLangJS =
-{
- hostTypesJS,
- 7,
- 1,
- false,
- true, /* loopLabels */
- Translated,
- BreakFeature,
- &makeCodeGen,
- &defaultOutFnJs,
- &genLineDirectiveTrans
-};
-
-int main( int argc, const char **argv )
-{
- InputData id( &hostLangJS, &rlparseJs, &rlhcJs );
- return id.rlhcMain( argc, argv );
-}
diff --git a/ragel/host-js/rlparse.lm b/ragel/host-js/rlparse.lm
deleted file mode 100644
index 100a9223..00000000
--- a/ragel/host-js/rlparse.lm
+++ /dev/null
@@ -1,202 +0,0 @@
-include 'ragel.lm'
-include 'rlreduce.lm'
-
-namespace inline
- lex
- literal `fpc `fc `fcurs `ftargs
- `fentry `fhold `fexec `fgoto `fnext
- `fcall `fret `fbreak `fncall `fnret `fnbreak
-
- token ident /ident/
- token number /digit+/
- token hex_number /'0x' [0-9a-fA-F]+/
- token dec_number /'0x' [0-9a-fA-F]+/
-
- token comment
- / c_comment | cpp_comment /
-
- token string
- / s_literal | d_literal /
-
- token whitespace
- / ( [ \t] | NL )+ /
-
- literal
- `{ `} `:: `* `, `( `) `;
-
- token var_ref
- / "$" [a-zA-Z_][a-zA-Z_0-9]* /
- {
- if GblActionParams
- {
- input->push( make_token(
- typeid<var_ref>, input->pull( match_length ) ) )
- }
- else
- {
- # Just pull one char. Don't consume the word because it may
- # be a keyword.
- input->push( make_token(
- typeid<c_any>, input->pull( 1 ) ) )
- }
- }
-
- token c_any
- / any /
- end
-
-end
-
-namespace host
- lex
- literal `%%{
-
- token close_inc /'}--%%'/
- {
- input->push( make_token( typeid<close_inc>, input->pull( match_length ) ) )
- restoreGlobals()
- }
-
- token close_imp /'}++%%'/
- {
- input->push( make_token( typeid<close_imp>, input->pull( match_length ) ) )
- restoreGlobals()
- }
-
- token slr / '%%' [^{] [^\n]* '\n' /
- {
- # Translates single line to multi-line
- input->pull( 2 )
- R: str = input->pull( match_length - 3 )
- input->push( "}%%" )
- input->push( R )
- input->push( "%%{" )
- }
-
- rl NL / '\n' /
-
- rl s_literal
- / "'" ([^'\\\n] | '\\' (any | NL))* "'" /
-
- rl d_literal
- / '"' ([^"\\] | NL | '\\' (any | NL))* '"' /
-
- literal `define `=
-
- token ident /ident "'"?/
- token number /digit+/
- token hex_number /'0x' [0-9a-fA-F]+/
-
- token comment
- / c_comment | cpp_comment /
-
- token string
- / s_literal | d_literal /
-
- token whitespace
- / ( [ \t] | NL )+ /
-
- token c_any / any /
- end
-
- def tok
- [`define whitespace ident whitespace? number] :ImportDefNum
- | [`define whitespace ident whitespace? string] :ImportDefStr
- | [ident whitespace? `= whitespace? number] :ImportAssignNum
- | [ident whitespace? `= whitespace? string] :ImportAssignStr
- | [`define] :Def
- | [`=] :Eq
- | [ident] :Ident
- | [number] :Number
- | [hex_number] :HexNumber
- | [comment] :Comment
- | [string] :String
- | [whitespace] :Whitespace
- | [c_any] :Any
-end
-
-reduction TopLevel
-
- # Pass Through.
- # def tok
- # [`define ident number] :Def1
- # | [`define ident string] :Def2
- # | [ident `= number] :Ass1
- # | [ident `= string] :Ass2
- # [`define whitespace ident whitespace? number] :ImportDefNum
- # | [`define whitespace ident whitespace? string] :ImportDefStr
- # | [ident whitespace? `= whitespace? number] :ImportAssignNum
- # | [ident whitespace? `= whitespace? string] :ImportAssignStr
- # | [`define] :Def
- # | [`=] :Eq
- # | [ident] :Ident
- # | [number] :Number
- # | [hex_number] :HexNumber
- # | [comment] :Comment
- # | [string] :String
- # | [whitespace] :Whitespace
- # | [c_any] :Any
-
- host::tok :ImportDefNum
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @number,
- false /* $number->neg */, $number->data,
- $number->length, Literal::Number );
-
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportDefStr
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @string, false,
- $string->data, $string->length, Literal::LitString );
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportAssignNum
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @number,
- false /*$number->neg */, $number->data,
- $number->length, Literal::Number );
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportAssignStr
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @string, false,
- $string->data, $string->length, Literal::LitString );
-
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
-
-end
-
-export RagelError: str
-
-# File name. The open is expected to succeed. It is tested before the colm
-# program is called.
-A: list_el<str> = argv->pop_head_el()
-GblFileName = A->value
-
-# Remaining items are include paths.
-while ( argv->length > 0 ) {
- A = argv->pop_head_el()
- GblIncludePaths->push_tail_el( A )
-}
-
-Stream: stream = open( GblFileName, "r" )
-reduce TopLevel start[ Stream ]
-RagelError = error
diff --git a/ragel/host-julia/.gitignore b/ragel/host-julia/.gitignore
deleted file mode 100644
index 7bd1258f..00000000
--- a/ragel/host-julia/.gitignore
+++ /dev/null
@@ -1,13 +0,0 @@
-/Makefile
-/Makefile.in
-/.deps
-/.libs
-/ragel-julia
-/ragel-julia.exe
-/rlhc.c
-/rlparse.pack
-/rlparse.c
-/rlreduce.cc
-
-/CMakeFiles
-/cmake_install.cmake
diff --git a/ragel/host-julia/CMakeLists.txt b/ragel/host-julia/CMakeLists.txt
deleted file mode 100644
index 89b466e5..00000000
--- a/ragel/host-julia/CMakeLists.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-add_custom_command(OUTPUT
- "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc"
- DEPENDS rlparse.lm
- COMMAND colm::colm
- ARGS -I.. -c -b rlparseJulia
- -o "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- -m "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc"
- rlparse.lm
- WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}")
-
-add_custom_command(OUTPUT
- "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- DEPENDS rlhc.lm
- COMMAND colm::colm
- ARGS -I.. -c -b rlhcJulia
- -o "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- rlhc.lm
- WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}")
-
-add_executable(ragel-julia main.cc
- "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc")
-
-target_link_libraries(ragel-julia PRIVATE libragel libfsm)
-
-if(${PROJECT_NAME}_MAKE_INSTALL)
- install(TARGETS ragel-julia
- EXPORT ${_PACKAGE_NAME}-targets
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
-endif()
diff --git a/ragel/host-julia/Makefile.am b/ragel/host-julia/Makefile.am
deleted file mode 100644
index f7f193b8..00000000
--- a/ragel/host-julia/Makefile.am
+++ /dev/null
@@ -1,32 +0,0 @@
-COLM_BIN = ../../colm/colm
-COLM_WRAP = ../../colm/colm-wrap
-COLM_LA = ../../colm/libcolm.la
-COLM_LIBDEP = $(COLM_LA)
-COLM_BINDEP = $(COLM_BIN) $(COLM_WRAP)
-
-bin_PROGRAMS = ragel-julia
-
-ragel_julia_CPPFLAGS = -I$(top_srcdir)/aapl -I$(top_srcdir)/ragel -I$(top_srcdir)/colm/include
-
-dist_ragel_julia_SOURCES = main.cc rlhc.c
-
-nodist_ragel_julia_SOURCES = \
- rlparse.c rlreduce.cc
-
-ragel_julia_LDADD = ../libragel.la ../libfsm.la $(COLM_LA)
-
-BUILT_SOURCES = rlparse.c rlreduce.cc rlhc.c
-
-EXTRA_DIST = rlparse.lm rlhc.lm
-
-rlparse.pack: rlparse.lm $(COLM_BINDEP)
- $(COLM_WRAP) -c -I .. -b rlparseJulia -o $@ -p rlparse.c -m rlreduce.cc $<
-
-rlparse.c: rlparse.pack
- $(COLM_WRAP) -o $@ $<
-
-rlreduce.cc: rlparse.pack
- $(COLM_WRAP) -o $@ $<
-
-rlhc.c: rlhc.lm ../ril.lm $(COLM_BINDEP)
- $(COLM_BIN) -c -I .. -b rlhcJulia -o $@ $<
diff --git a/ragel/host-julia/main.cc b/ragel/host-julia/main.cc
deleted file mode 100644
index f06d7493..00000000
--- a/ragel/host-julia/main.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 2001-2018 Adrian Thurston <thurston@colm.net>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include "inputdata.h"
-
-extern struct colm_sections rlparseJulia;
-extern struct colm_sections rlhcJulia;
-
-/*
- * Julia
- */
-const char *defaultOutFnJulia( const char *inputFileName )
-{
- return fileNameFromStem( inputFileName, ".jl" );
-}
-
-HostType hostTypesJulia[] =
-{
- { "u8", 0, "byte", true, true, false, 0, UCHAR_MAX, 0, 0, 4 },
-};
-
-const HostLang hostLangJulia =
-{
- hostTypesJulia,
- 1,
- 0,
- false,
- false, /* loopLabels */
- Translated,
- GotoFeature,
- &makeCodeGen,
- &defaultOutFnJulia,
- &genLineDirectiveTrans
-};
-
-
-int main( int argc, const char **argv )
-{
- InputData id( &hostLangJulia, &rlparseJulia, &rlhcJulia );
- return id.rlhcMain( argc, argv );
-}
diff --git a/ragel/host-julia/rlparse.lm b/ragel/host-julia/rlparse.lm
deleted file mode 100644
index 100a9223..00000000
--- a/ragel/host-julia/rlparse.lm
+++ /dev/null
@@ -1,202 +0,0 @@
-include 'ragel.lm'
-include 'rlreduce.lm'
-
-namespace inline
- lex
- literal `fpc `fc `fcurs `ftargs
- `fentry `fhold `fexec `fgoto `fnext
- `fcall `fret `fbreak `fncall `fnret `fnbreak
-
- token ident /ident/
- token number /digit+/
- token hex_number /'0x' [0-9a-fA-F]+/
- token dec_number /'0x' [0-9a-fA-F]+/
-
- token comment
- / c_comment | cpp_comment /
-
- token string
- / s_literal | d_literal /
-
- token whitespace
- / ( [ \t] | NL )+ /
-
- literal
- `{ `} `:: `* `, `( `) `;
-
- token var_ref
- / "$" [a-zA-Z_][a-zA-Z_0-9]* /
- {
- if GblActionParams
- {
- input->push( make_token(
- typeid<var_ref>, input->pull( match_length ) ) )
- }
- else
- {
- # Just pull one char. Don't consume the word because it may
- # be a keyword.
- input->push( make_token(
- typeid<c_any>, input->pull( 1 ) ) )
- }
- }
-
- token c_any
- / any /
- end
-
-end
-
-namespace host
- lex
- literal `%%{
-
- token close_inc /'}--%%'/
- {
- input->push( make_token( typeid<close_inc>, input->pull( match_length ) ) )
- restoreGlobals()
- }
-
- token close_imp /'}++%%'/
- {
- input->push( make_token( typeid<close_imp>, input->pull( match_length ) ) )
- restoreGlobals()
- }
-
- token slr / '%%' [^{] [^\n]* '\n' /
- {
- # Translates single line to multi-line
- input->pull( 2 )
- R: str = input->pull( match_length - 3 )
- input->push( "}%%" )
- input->push( R )
- input->push( "%%{" )
- }
-
- rl NL / '\n' /
-
- rl s_literal
- / "'" ([^'\\\n] | '\\' (any | NL))* "'" /
-
- rl d_literal
- / '"' ([^"\\] | NL | '\\' (any | NL))* '"' /
-
- literal `define `=
-
- token ident /ident "'"?/
- token number /digit+/
- token hex_number /'0x' [0-9a-fA-F]+/
-
- token comment
- / c_comment | cpp_comment /
-
- token string
- / s_literal | d_literal /
-
- token whitespace
- / ( [ \t] | NL )+ /
-
- token c_any / any /
- end
-
- def tok
- [`define whitespace ident whitespace? number] :ImportDefNum
- | [`define whitespace ident whitespace? string] :ImportDefStr
- | [ident whitespace? `= whitespace? number] :ImportAssignNum
- | [ident whitespace? `= whitespace? string] :ImportAssignStr
- | [`define] :Def
- | [`=] :Eq
- | [ident] :Ident
- | [number] :Number
- | [hex_number] :HexNumber
- | [comment] :Comment
- | [string] :String
- | [whitespace] :Whitespace
- | [c_any] :Any
-end
-
-reduction TopLevel
-
- # Pass Through.
- # def tok
- # [`define ident number] :Def1
- # | [`define ident string] :Def2
- # | [ident `= number] :Ass1
- # | [ident `= string] :Ass2
- # [`define whitespace ident whitespace? number] :ImportDefNum
- # | [`define whitespace ident whitespace? string] :ImportDefStr
- # | [ident whitespace? `= whitespace? number] :ImportAssignNum
- # | [ident whitespace? `= whitespace? string] :ImportAssignStr
- # | [`define] :Def
- # | [`=] :Eq
- # | [ident] :Ident
- # | [number] :Number
- # | [hex_number] :HexNumber
- # | [comment] :Comment
- # | [string] :String
- # | [whitespace] :Whitespace
- # | [c_any] :Any
-
- host::tok :ImportDefNum
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @number,
- false /* $number->neg */, $number->data,
- $number->length, Literal::Number );
-
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportDefStr
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @string, false,
- $string->data, $string->length, Literal::LitString );
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportAssignNum
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @number,
- false /*$number->neg */, $number->data,
- $number->length, Literal::Number );
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportAssignStr
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @string, false,
- $string->data, $string->length, Literal::LitString );
-
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
-
-end
-
-export RagelError: str
-
-# File name. The open is expected to succeed. It is tested before the colm
-# program is called.
-A: list_el<str> = argv->pop_head_el()
-GblFileName = A->value
-
-# Remaining items are include paths.
-while ( argv->length > 0 ) {
- A = argv->pop_head_el()
- GblIncludePaths->push_tail_el( A )
-}
-
-Stream: stream = open( GblFileName, "r" )
-reduce TopLevel start[ Stream ]
-RagelError = error
diff --git a/ragel/host-ocaml/.gitignore b/ragel/host-ocaml/.gitignore
deleted file mode 100644
index fe7038f5..00000000
--- a/ragel/host-ocaml/.gitignore
+++ /dev/null
@@ -1,13 +0,0 @@
-/Makefile
-/Makefile.in
-/.deps
-/.libs
-/ragel-ocaml
-/ragel-ocaml.exe
-/rlhc.c
-/rlparse.pack
-/rlparse.c
-/rlreduce.cc
-
-/CMakeFiles
-/cmake_install.cmake
diff --git a/ragel/host-ocaml/CMakeLists.txt b/ragel/host-ocaml/CMakeLists.txt
deleted file mode 100644
index eff80ce9..00000000
--- a/ragel/host-ocaml/CMakeLists.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-add_custom_command(OUTPUT
- "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc"
- DEPENDS rlparse.lm
- COMMAND colm::colm
- ARGS -I.. -c -b rlparseOCaml
- -o "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- -m "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc"
- rlparse.lm
- WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}")
-
-add_custom_command(OUTPUT
- "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- DEPENDS rlhc.lm
- COMMAND colm::colm
- ARGS -I.. -c -b rlhcOCaml
- -o "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- rlhc.lm
- WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}")
-
-add_executable(ragel-ocaml main.cc
- "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc")
-
-target_link_libraries(ragel-ocaml PRIVATE libragel libfsm)
-
-if(${PROJECT_NAME}_MAKE_INSTALL)
- install(TARGETS ragel-ocaml
- EXPORT ${_PACKAGE_NAME}-targets
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
-endif()
diff --git a/ragel/host-ocaml/Makefile.am b/ragel/host-ocaml/Makefile.am
deleted file mode 100644
index 1e268bce..00000000
--- a/ragel/host-ocaml/Makefile.am
+++ /dev/null
@@ -1,34 +0,0 @@
-COLM_BIN = ../../colm/colm
-COLM_WRAP = ../../colm/colm-wrap
-COLM_LA = ../../colm/libcolm.la
-COLM_LIBDEP = $(COLM_LA)
-COLM_BINDEP = $(COLM_BIN) $(COLM_WRAP)
-
-bin_PROGRAMS = ragel-ocaml
-
-ragel_ocaml_CPPFLAGS = -I$(top_srcdir)/aapl -I$(top_srcdir)/ragel -I$(top_srcdir)/colm/include
-
-dist_ragel_ocaml_SOURCES = main.cc rlhc.c
-
-nodist_ragel_ocaml_SOURCES = \
- rlparse.c rlreduce.cc
-
-ragel_ocaml_LDADD = ../libragel.la ../libfsm.la $(COLM_LA)
-
-BUILT_SOURCES = rlparse.c rlreduce.cc rlhc.c
-
-EXTRA_DIST = rlparse.lm rlhc.lm
-
-rlparse.pack: rlparse.lm $(COLM_BINDEP)
- $(COLM_WRAP) -c -I .. -b rlparseOCaml -o $@ -p rlparse.c -m rlreduce.cc $<
-
-rlparse.c: rlparse.pack
- $(COLM_WRAP) -o $@ $<
-
-rlreduce.cc: rlparse.pack
- $(COLM_WRAP) -o $@ $<
-
-rlhc.c: rlhc.lm ../ril.lm $(COLM_BINDEP)
- $(COLM_BIN) -c -I .. -b rlhcOCaml -o $@ $<
-
-
diff --git a/ragel/host-ocaml/main.cc b/ragel/host-ocaml/main.cc
deleted file mode 100644
index 36f3d030..00000000
--- a/ragel/host-ocaml/main.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright 2001-2018 Adrian Thurston <thurston@colm.net>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include "inputdata.h"
-
-extern struct colm_sections rlparseOCaml;
-extern struct colm_sections rlhcOCaml;
-
-/*
- * OCaml
- */
-const char *defaultOutFnOCaml( const char *inputFileName )
-{
- return fileNameFromStem( inputFileName, ".ml" );
-}
-
-HostType hostTypesOCaml[] =
-{
- { "int", 0, "int", true, true, false, S31BIT_MIN, S31BIT_MAX, 0, 0, 4 },
-};
-
-const HostLang hostLangOCaml =
-{
- hostTypesOCaml,
- 1,
- 0,
- false,
- false, /* loopLabels */
- Translated,
- VarFeature,
- &makeCodeGen,
- &defaultOutFnOCaml,
- &genLineDirectiveTrans
-};
-
-int main( int argc, const char **argv )
-{
- InputData id( &hostLangOCaml, &rlparseOCaml, &rlhcOCaml );
- return id.rlhcMain( argc, argv );
-}
diff --git a/ragel/host-ocaml/rlparse.lm b/ragel/host-ocaml/rlparse.lm
deleted file mode 100644
index 911e3ea6..00000000
--- a/ragel/host-ocaml/rlparse.lm
+++ /dev/null
@@ -1,204 +0,0 @@
-include 'ragel.lm'
-include 'rlreduce.lm'
-
-namespace inline
- lex
- literal `fpc `fc `fcurs `ftargs
- `fentry `fhold `fexec `fgoto `fnext
- `fcall `fret `fbreak `fncall `fnret `fnbreak
-
- token ident /ident/
- token number /digit+/
- token hex_number /'0x' [0-9a-fA-F]+/
- token dec_number /'0x' [0-9a-fA-F]+/
-
- token comment
- / c_comment | cpp_comment /
-
- token string
- / s_literal | d_literal /
-
- token whitespace
- / ( [ \t] | NL )+ /
-
- literal
- `{ `} `:: `* `, `( `) `;
-
- token var_ref
- / "$" [a-zA-Z_][a-zA-Z_0-9]* /
- {
- if GblActionParams
- {
- input->push( make_token(
- typeid<var_ref>, input->pull( match_length ) ) )
- }
- else
- {
- # Just pull one char. Don't consume the word because it may
- # be a keyword.
- input->push( make_token(
- typeid<c_any>, input->pull( 1 ) ) )
- }
- }
-
- token c_any
- / any /
- end
-
-end
-
-
-namespace host
- lex
- literal `%%{
-
- token close_inc /'}--%%'/
- {
- input->push( make_token( typeid<close_inc>, input->pull( match_length ) ) )
- restoreGlobals()
- }
-
- token close_imp /'}++%%'/
- {
- input->push( make_token( typeid<close_imp>, input->pull( match_length ) ) )
- restoreGlobals()
- }
-
- token slr / '%%' [^{] [^\n]* '\n' /
- {
- # Translates single line to multi-line
- input->pull( 2 )
- R: str = input->pull( match_length - 3 )
- input->push( "}%%" )
- input->push( R )
- input->push( "%%{" )
- }
-
- rl NL / '\n' /
-
- rl s_literal
- / "'" ([^'\\\n] | '\\' (any | NL))* "'" /
-
- rl d_literal
- / '"' ([^"\\] | NL | '\\' (any | NL))* '"' /
-
- literal `define `=
-
- token ident /ident "'"?/
- token number /digit+/
- token hex_number /'0x' [0-9a-fA-F]+/
-
- token comment
- / c_comment | cpp_comment /
-
- token string
- / s_literal | d_literal /
-
- token whitespace
- / ( [ \t] | NL )+ /
-
- token c_any / any /
- end
-
- def tok
- [`define whitespace ident whitespace? number] :ImportDefNum
- | [`define whitespace ident whitespace? string] :ImportDefStr
- | [ident whitespace? `= whitespace? number] :ImportAssignNum
- | [ident whitespace? `= whitespace? string] :ImportAssignStr
- | [`define] :Def
- | [`=] :Eq
- | [ident] :Ident
- | [number] :Number
- | [hex_number] :HexNumber
- | [comment] :Comment
- | [string] :String
- | [whitespace] :Whitespace
- | [c_any] :Any
-end
-
-reduction TopLevel
-
- # Pass Through.
- # def tok
- # [`define ident number] :Def1
- # | [`define ident string] :Def2
- # | [ident `= number] :Ass1
- # | [ident `= string] :Ass2
- # [`define whitespace ident whitespace? number] :ImportDefNum
- # | [`define whitespace ident whitespace? string] :ImportDefStr
- # | [ident whitespace? `= whitespace? number] :ImportAssignNum
- # | [ident whitespace? `= whitespace? string] :ImportAssignStr
- # | [`define] :Def
- # | [`=] :Eq
- # | [ident] :Ident
- # | [number] :Number
- # | [hex_number] :HexNumber
- # | [comment] :Comment
- # | [string] :String
- # | [whitespace] :Whitespace
- # | [c_any] :Any
-
- host::tok :ImportDefNum
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @number,
- false /* $number->neg */, $number->data,
- $number->length, Literal::Number );
-
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportDefStr
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @string, false,
- $string->data, $string->length, Literal::LitString );
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportAssignNum
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @number,
- false /*$number->neg */, $number->data,
- $number->length, Literal::Number );
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportAssignStr
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @string, false,
- $string->data, $string->length, Literal::LitString );
-
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
-
-end
-
-
-export RagelError: str
-
-# File name. The open is expected to succeed. It is tested before the colm
-# program is called.
-A: list_el<str> = argv->pop_head_el()
-GblFileName = A->value
-
-# Remaining items are include paths.
-while ( argv->length > 0 ) {
- A = argv->pop_head_el()
- GblIncludePaths->push_tail_el( A )
-}
-
-Stream: stream = open( GblFileName, "r" )
-reduce TopLevel start[ Stream ]
-RagelError = error
diff --git a/ragel/host-ruby/.gitignore b/ragel/host-ruby/.gitignore
deleted file mode 100644
index f61713c7..00000000
--- a/ragel/host-ruby/.gitignore
+++ /dev/null
@@ -1,13 +0,0 @@
-/Makefile.in
-/Makefile
-/.deps
-/.libs
-/ragel-ruby
-/ragel-ruby.exe
-/rlparse.pack
-/rlparse.c
-/rlreduce.cc
-/rlhc.c
-
-/CMakeFiles
-/cmake_install.cmake
diff --git a/ragel/host-ruby/CMakeLists.txt b/ragel/host-ruby/CMakeLists.txt
deleted file mode 100644
index 4ec4e387..00000000
--- a/ragel/host-ruby/CMakeLists.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-add_custom_command(OUTPUT
- "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc"
- DEPENDS rlparse.lm
- COMMAND colm::colm
- ARGS -I.. -c -b rlparseRuby
- -o "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- -m "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc"
- rlparse.lm
- WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}")
-
-add_custom_command(OUTPUT
- "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- DEPENDS rlhc.lm
- COMMAND colm::colm
- ARGS -I.. -c -b rlhcRuby
- -o "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- rlhc.lm
- WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}")
-
-add_executable(ragel-ruby main.cc
- "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc")
-
-target_link_libraries(ragel-ruby PRIVATE libragel libfsm)
-
-if(${PROJECT_NAME}_MAKE_INSTALL)
- install(TARGETS ragel-ruby
- EXPORT ${_PACKAGE_NAME}-targets
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
-endif()
diff --git a/ragel/host-ruby/Makefile.am b/ragel/host-ruby/Makefile.am
deleted file mode 100644
index 60423939..00000000
--- a/ragel/host-ruby/Makefile.am
+++ /dev/null
@@ -1,32 +0,0 @@
-COLM_BIN = ../../colm/colm
-COLM_WRAP = ../../colm/colm-wrap
-COLM_LA = ../../colm/libcolm.la
-COLM_LIBDEP = $(COLM_LA)
-COLM_BINDEP = $(COLM_BIN) $(COLM_WRAP)
-
-bin_PROGRAMS = ragel-ruby
-
-ragel_ruby_CPPFLAGS = -I$(top_srcdir)/aapl -I$(top_srcdir)/ragel -I$(top_srcdir)/colm/include
-
-dist_ragel_ruby_SOURCES = main.cc rlhc.c
-
-nodist_ragel_ruby_SOURCES = \
- rlparse.c rlreduce.cc
-
-ragel_ruby_LDADD = ../libragel.la ../libfsm.la $(COLM_LA)
-
-BUILT_SOURCES = rlparse.c rlreduce.cc rlhc.c
-
-EXTRA_DIST = rlparse.lm rlhc.lm
-
-rlparse.pack: rlparse.lm $(COLM_BINDEP)
- $(COLM_WRAP) -c -I .. -b rlparseRuby -o $@ -p rlparse.c -m rlreduce.cc $<
-
-rlparse.c: rlparse.pack
- $(COLM_WRAP) -o $@ $<
-
-rlreduce.cc: rlparse.pack
- $(COLM_WRAP) -o $@ $<
-
-rlhc.c: rlhc.lm ../ril.lm $(COLM_BINDEP)
- $(COLM_BIN) -c -I .. -b rlhcRuby -o $@ $<
diff --git a/ragel/host-ruby/main.cc b/ragel/host-ruby/main.cc
deleted file mode 100644
index 3fed52e3..00000000
--- a/ragel/host-ruby/main.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright 2001-2018 Adrian Thurston <thurston@colm.net>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include "inputdata.h"
-
-extern struct colm_sections rlparseRuby;
-extern struct colm_sections rlhcRuby;
-
-/* What are the appropriate types for ruby? */
-static HostType hostTypesRuby[] =
-{
- { "char", 0, "char", true, true, false, CHAR_MIN, CHAR_MAX, 0, 0, 1 },
- { "int", 0, "int", true, true, false, INT_MIN, INT_MAX, 0, 0, 4 },
-};
-
-const char *defaultOutFnRuby( const char *inputFileName )
-{
- return fileNameFromStem( inputFileName, ".rb" );
-}
-
-static const HostLang hostLangRuby =
-{
- hostTypesRuby,
- 2,
- 0,
- false,
- false, /* loopLabels. */
- Translated,
- BreakFeature,
- &makeCodeGen,
- &defaultOutFnRuby,
- &genLineDirectiveTrans
-};
-
-int main( int argc, const char **argv )
-{
- InputData id( &hostLangRuby, &rlparseRuby, &rlhcRuby );
- return id.rlhcMain( argc, argv );
-}
diff --git a/ragel/host-ruby/rlparse.lm b/ragel/host-ruby/rlparse.lm
deleted file mode 100644
index 99811877..00000000
--- a/ragel/host-ruby/rlparse.lm
+++ /dev/null
@@ -1,203 +0,0 @@
-include 'ragel.lm'
-include 'rlreduce.lm'
-
-namespace inline
- lex
- literal `fpc `fc `fcurs `ftargs
- `fentry `fhold `fexec `fgoto `fnext
- `fcall `fret `fbreak `fncall `fnret `fnbreak
-
- token ident /ident/
- token number /digit+/
- token hex_number /'0x' [0-9a-fA-F]+/
- token dec_number /'0x' [0-9a-fA-F]+/
-
- token comment
- / ruby_comment /
-
- token string
- / s_literal | d_literal | host_re_literal /
-
- token whitespace
- / ( [ \t] | NL )+ /
-
- literal
- `{ `} `:: `* `, `( `) `;
-
- token var_ref
- / "$" [a-zA-Z_][a-zA-Z_0-9]* /
- {
- if GblActionParams
- {
- input->push( make_token(
- typeid<var_ref>, input->pull( match_length ) ) )
- }
- else
- {
- # Just pull one char. Don't consume the word because it may
- # be a keyword.
- input->push( make_token(
- typeid<c_any>, input->pull( 1 ) ) )
- }
- }
-
- token c_any
- / any /
- end
-
-end
-
-namespace host
- lex
- literal `%%{
-
- token close_inc /'}--%%'/
- {
- input->push( make_token( typeid<close_inc>, input->pull( match_length ) ) )
- restoreGlobals()
- }
-
- token close_imp /'}++%%'/
- {
- input->push( make_token( typeid<close_imp>, input->pull( match_length ) ) )
- restoreGlobals()
- }
-
- token slr / '%%' [^{] [^\n]* '\n' /
- {
- # Translates single line to multi-line
- input->pull( 2 )
- R: str = input->pull( match_length - 3 )
- input->push( "}%%" )
- input->push( R )
- input->push( "%%{" )
- }
-
- rl NL / '\n' /
-
- rl s_literal
- / "'" ([^'\\\n] | '\\' (any | NL))* "'" /
-
- rl d_literal
- / '"' ([^"\\] | NL | '\\' (any | NL))* '"' /
-
- literal `define `=
-
- token ident /ident "'"?/
- token number /digit+/
- token hex_number /'0x' [0-9a-fA-F]+/
-
- token comment
- / ruby_comment /
-
- token string
- / s_literal | d_literal | host_re_literal /
-
- token whitespace
- / ( [ \t] | NL )+ /
-
- token c_any / any /
- end
-
- def tok
- [`define whitespace ident whitespace? number] :ImportDefNum
- | [`define whitespace ident whitespace? string] :ImportDefStr
- | [ident whitespace? `= whitespace? number] :ImportAssignNum
- | [ident whitespace? `= whitespace? string] :ImportAssignStr
- | [`define] :Def
- | [`=] :Eq
- | [ident] :Ident
- | [number] :Number
- | [hex_number] :HexNumber
- | [comment] :Comment
- | [string] :String
- | [whitespace] :Whitespace
- | [c_any] :Any
-
-end
-
-reduction TopLevel
-
- # Pass Through.
- # def tok
- # [`define ident number] :Def1
- # | [`define ident string] :Def2
- # | [ident `= number] :Ass1
- # | [ident `= string] :Ass2
- # [`define whitespace ident whitespace? number] :ImportDefNum
- # | [`define whitespace ident whitespace? string] :ImportDefStr
- # | [ident whitespace? `= whitespace? number] :ImportAssignNum
- # | [ident whitespace? `= whitespace? string] :ImportAssignStr
- # | [`define] :Def
- # | [`=] :Eq
- # | [ident] :Ident
- # | [number] :Number
- # | [hex_number] :HexNumber
- # | [comment] :Comment
- # | [string] :String
- # | [whitespace] :Whitespace
- # | [c_any] :Any
-
- host::tok :ImportDefNum
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @number,
- false /* $number->neg */, $number->data,
- $number->length, Literal::Number );
-
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportDefStr
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @string, false,
- $string->data, $string->length, Literal::LitString );
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportAssignNum
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @number,
- false /*$number->neg */, $number->data,
- $number->length, Literal::Number );
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportAssignStr
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @string, false,
- $string->data, $string->length, Literal::LitString );
-
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
-
-end
-
-export RagelError: str
-
-# File name. The open is expected to succeed. It is tested before the colm
-# program is called.
-A: list_el<str> = argv->pop_head_el()
-GblFileName = A->value
-
-# Remaining items are include paths.
-while ( argv->length > 0 ) {
- A = argv->pop_head_el()
- GblIncludePaths->push_tail_el( A )
-}
-
-Stream: stream = open( GblFileName, "r" )
-reduce TopLevel start[ Stream ]
-RagelError = error
diff --git a/ragel/host-ruby/ruby.dsc b/ragel/host-ruby/ruby.dsc
deleted file mode 100644
index 75342663..00000000
--- a/ragel/host-ruby/ruby.dsc
+++ /dev/null
@@ -1,2 +0,0 @@
-char NIL char true true false CHAR_MIN CHAR_MAX 0 0 1
-int NIL int true true false INT_MIN INT_MAX 0 0 4
diff --git a/ragel/host-rust/.gitignore b/ragel/host-rust/.gitignore
deleted file mode 100644
index acd5559a..00000000
--- a/ragel/host-rust/.gitignore
+++ /dev/null
@@ -1,13 +0,0 @@
-/Makefile
-/Makefile.in
-/.deps
-/.libs
-/ragel-rust
-/ragel-rust.exe
-/rlhc.c
-/rlparse.pack
-/rlparse.c
-/rlreduce.cc
-
-/CMakeFiles
-/cmake_install.cmake
diff --git a/ragel/host-rust/CMakeLists.txt b/ragel/host-rust/CMakeLists.txt
deleted file mode 100644
index 272ef9f6..00000000
--- a/ragel/host-rust/CMakeLists.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-add_custom_command(OUTPUT
- "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc"
- DEPENDS rlparse.lm
- COMMAND colm::colm
- ARGS -I.. -c -b rlparseRust
- -o "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- -m "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc"
- rlparse.lm
- WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}")
-
-add_custom_command(OUTPUT
- "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- DEPENDS rlhc.lm
- COMMAND colm::colm
- ARGS -I.. -c -b rlhcRust
- -o "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- rlhc.lm
- WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}")
-
-add_executable(ragel-rust main.cc
- "${CMAKE_CURRENT_BINARY_DIR}/rlhc.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlparse.c"
- "${CMAKE_CURRENT_BINARY_DIR}/rlreduce.cc")
-
-target_link_libraries(ragel-rust PRIVATE libragel libfsm)
-
-if(${PROJECT_NAME}_MAKE_INSTALL)
- install(TARGETS ragel-rust
- EXPORT ${_PACKAGE_NAME}-targets
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
-endif()
diff --git a/ragel/host-rust/Makefile.am b/ragel/host-rust/Makefile.am
deleted file mode 100644
index 4282cddc..00000000
--- a/ragel/host-rust/Makefile.am
+++ /dev/null
@@ -1,32 +0,0 @@
-COLM_BIN = ../../colm/colm
-COLM_WRAP = ../../colm/colm-wrap
-COLM_LA = ../../colm/libcolm.la
-COLM_LIBDEP = $(COLM_LA)
-COLM_BINDEP = $(COLM_BIN) $(COLM_WRAP)
-
-bin_PROGRAMS = ragel-rust
-
-ragel_rust_CPPFLAGS = -I$(top_srcdir)/aapl -I$(top_srcdir)/ragel -I$(top_srcdir)/colm/include
-
-dist_ragel_rust_SOURCES = main.cc rlhc.c
-
-nodist_ragel_rust_SOURCES = \
- rlparse.c rlreduce.cc
-
-ragel_rust_LDADD = ../libragel.la ../libfsm.la $(COLM_LA)
-
-BUILT_SOURCES = rlparse.c rlreduce.cc rlhc.c
-
-EXTRA_DIST = rlparse.lm rlhc.lm
-
-rlparse.pack: rlparse.lm $(COLM_BINDEP)
- $(COLM_WRAP) -c -I .. -b rlparseRust -o $@ -p rlparse.c -m rlreduce.cc $<
-
-rlparse.c: rlparse.pack
- $(COLM_WRAP) -o $@ $<
-
-rlreduce.cc: rlparse.pack
- $(COLM_WRAP) -o $@ $<
-
-rlhc.c: rlhc.lm ../ril.lm $(COLM_BINDEP)
- $(COLM_BIN) -c -I .. -b rlhcRust -o $@ $<
diff --git a/ragel/host-rust/main.cc b/ragel/host-rust/main.cc
deleted file mode 100644
index 93c5147d..00000000
--- a/ragel/host-rust/main.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 2001-2018 Adrian Thurston <thurston@colm.net>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include "inputdata.h"
-
-extern struct colm_sections rlparseRust;
-extern struct colm_sections rlhcRust;
-
-/*
- * Rust
- */
-const char *defaultOutFnRust( const char *inputFileName )
-{
- return fileNameFromStem( inputFileName, ".rs" );
-}
-
-HostType hostTypesRust[] =
-{
- { "u8", 0, "byte", true, true, false, 0, UCHAR_MAX, 0, 0, 4 },
-};
-
-const HostLang hostLangRust =
-{
- hostTypesRust,
- 1,
- 0,
- false,
- false, /* loopLabels */
- Translated,
- BreakFeature,
- &makeCodeGen,
- &defaultOutFnRust,
- &genLineDirectiveTrans
-};
-
-
-int main( int argc, const char **argv )
-{
- InputData id( &hostLangRust, &rlparseRust, &rlhcRust );
- return id.rlhcMain( argc, argv );
-}
diff --git a/ragel/host-rust/rlparse.lm b/ragel/host-rust/rlparse.lm
deleted file mode 100644
index 100a9223..00000000
--- a/ragel/host-rust/rlparse.lm
+++ /dev/null
@@ -1,202 +0,0 @@
-include 'ragel.lm'
-include 'rlreduce.lm'
-
-namespace inline
- lex
- literal `fpc `fc `fcurs `ftargs
- `fentry `fhold `fexec `fgoto `fnext
- `fcall `fret `fbreak `fncall `fnret `fnbreak
-
- token ident /ident/
- token number /digit+/
- token hex_number /'0x' [0-9a-fA-F]+/
- token dec_number /'0x' [0-9a-fA-F]+/
-
- token comment
- / c_comment | cpp_comment /
-
- token string
- / s_literal | d_literal /
-
- token whitespace
- / ( [ \t] | NL )+ /
-
- literal
- `{ `} `:: `* `, `( `) `;
-
- token var_ref
- / "$" [a-zA-Z_][a-zA-Z_0-9]* /
- {
- if GblActionParams
- {
- input->push( make_token(
- typeid<var_ref>, input->pull( match_length ) ) )
- }
- else
- {
- # Just pull one char. Don't consume the word because it may
- # be a keyword.
- input->push( make_token(
- typeid<c_any>, input->pull( 1 ) ) )
- }
- }
-
- token c_any
- / any /
- end
-
-end
-
-namespace host
- lex
- literal `%%{
-
- token close_inc /'}--%%'/
- {
- input->push( make_token( typeid<close_inc>, input->pull( match_length ) ) )
- restoreGlobals()
- }
-
- token close_imp /'}++%%'/
- {
- input->push( make_token( typeid<close_imp>, input->pull( match_length ) ) )
- restoreGlobals()
- }
-
- token slr / '%%' [^{] [^\n]* '\n' /
- {
- # Translates single line to multi-line
- input->pull( 2 )
- R: str = input->pull( match_length - 3 )
- input->push( "}%%" )
- input->push( R )
- input->push( "%%{" )
- }
-
- rl NL / '\n' /
-
- rl s_literal
- / "'" ([^'\\\n] | '\\' (any | NL))* "'" /
-
- rl d_literal
- / '"' ([^"\\] | NL | '\\' (any | NL))* '"' /
-
- literal `define `=
-
- token ident /ident "'"?/
- token number /digit+/
- token hex_number /'0x' [0-9a-fA-F]+/
-
- token comment
- / c_comment | cpp_comment /
-
- token string
- / s_literal | d_literal /
-
- token whitespace
- / ( [ \t] | NL )+ /
-
- token c_any / any /
- end
-
- def tok
- [`define whitespace ident whitespace? number] :ImportDefNum
- | [`define whitespace ident whitespace? string] :ImportDefStr
- | [ident whitespace? `= whitespace? number] :ImportAssignNum
- | [ident whitespace? `= whitespace? string] :ImportAssignStr
- | [`define] :Def
- | [`=] :Eq
- | [ident] :Ident
- | [number] :Number
- | [hex_number] :HexNumber
- | [comment] :Comment
- | [string] :String
- | [whitespace] :Whitespace
- | [c_any] :Any
-end
-
-reduction TopLevel
-
- # Pass Through.
- # def tok
- # [`define ident number] :Def1
- # | [`define ident string] :Def2
- # | [ident `= number] :Ass1
- # | [ident `= string] :Ass2
- # [`define whitespace ident whitespace? number] :ImportDefNum
- # | [`define whitespace ident whitespace? string] :ImportDefStr
- # | [ident whitespace? `= whitespace? number] :ImportAssignNum
- # | [ident whitespace? `= whitespace? string] :ImportAssignStr
- # | [`define] :Def
- # | [`=] :Eq
- # | [ident] :Ident
- # | [number] :Number
- # | [hex_number] :HexNumber
- # | [comment] :Comment
- # | [string] :String
- # | [whitespace] :Whitespace
- # | [c_any] :Any
-
- host::tok :ImportDefNum
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @number,
- false /* $number->neg */, $number->data,
- $number->length, Literal::Number );
-
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportDefStr
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @string, false,
- $string->data, $string->length, Literal::LitString );
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportAssignNum
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @number,
- false /*$number->neg */, $number->data,
- $number->length, Literal::Number );
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
- host::tok :ImportAssignStr
- {
- if ( isImport )
- {
- Literal *lit = new Literal( @string, false,
- $string->data, $string->length, Literal::LitString );
-
- string name( $ident->data, $ident->length );
- import( @ident, name, lit );
- }
- }
-
-end
-
-export RagelError: str
-
-# File name. The open is expected to succeed. It is tested before the colm
-# program is called.
-A: list_el<str> = argv->pop_head_el()
-GblFileName = A->value
-
-# Remaining items are include paths.
-while ( argv->length > 0 ) {
- A = argv->pop_head_el()
- GblIncludePaths->push_tail_el( A )
-}
-
-Stream: stream = open( GblFileName, "r" )
-reduce TopLevel start[ Stream ]
-RagelError = error
diff --git a/ragel/host-c/rlhc.lm b/ragel/rlhc-c.lm
index 0a2b6d97..0a2b6d97 100644
--- a/ragel/host-c/rlhc.lm
+++ b/ragel/rlhc-c.lm
diff --git a/ragel/host-crack/rlhc.lm b/ragel/rlhc-crack.lm
index bebe7cd5..bebe7cd5 100644
--- a/ragel/host-crack/rlhc.lm
+++ b/ragel/rlhc-crack.lm
diff --git a/ragel/host-csharp/rlhc.lm b/ragel/rlhc-csharp.lm
index 078157c5..078157c5 100644
--- a/ragel/host-csharp/rlhc.lm
+++ b/ragel/rlhc-csharp.lm
diff --git a/ragel/host-d/rlhc.lm b/ragel/rlhc-d.lm
index 2a047e68..2a047e68 100644
--- a/ragel/host-d/rlhc.lm
+++ b/ragel/rlhc-d.lm
diff --git a/ragel/host-go/rlhc.lm b/ragel/rlhc-go.lm
index ab75477d..21aa1cee 100644
--- a/ragel/host-go/rlhc.lm
+++ b/ragel/rlhc-go.lm
@@ -1,6 +1,52 @@
include 'ril.lm'
-include 'out-go.lm'
+namespace out_go
+ token _IN_ /''/
+ token _EX_ /''/
+
+ lex
+ token comment /
+ '//' any* :> '\n' |
+ '/*' any* :>> '*/'
+ /
+
+ token id
+ /[a-zA-Z_][a-zA-Z_0-9]*/
+
+ token number /
+ [0-9]+
+ /
+
+ token symbol /
+ '!' | '#' | '$' | '%' | '&' | '(' | ')' | '*' |
+ '+' | ',' | '-' | '.' | '/' | ':' | ';' | '<' |
+ '=' | '>' | '?' | '@' | '[' | ']' | '^' | '|' |
+ '~' /
+
+ literal `{ `}
+
+ token string /
+ '"' ( [^"\\] | '\\' any ) * '"' |
+ "'" ( [^'\\] | '\\' any ) * "'"
+ /
+
+ ignore
+ /[ \t\v\r\n]+/
+ end
+
+ def item
+ [comment]
+ | [id]
+ | [number]
+ | [symbol]
+ | [string]
+ | [`{ _IN_ item* _EX_ `} ]
+
+ def out_go
+ [_IN_ _EX_ item*]
+end
+
+
namespace go_gen
diff --git a/ragel/host-java/rlhc.lm b/ragel/rlhc-java.lm
index a458369f..a458369f 100644
--- a/ragel/host-java/rlhc.lm
+++ b/ragel/rlhc-java.lm
diff --git a/ragel/host-js/rlhc.lm b/ragel/rlhc-js.lm
index 29a61346..29a61346 100644
--- a/ragel/host-js/rlhc.lm
+++ b/ragel/rlhc-js.lm
diff --git a/ragel/host-julia/rlhc.lm b/ragel/rlhc-julia.lm
index 72108994..72108994 100644
--- a/ragel/host-julia/rlhc.lm
+++ b/ragel/rlhc-julia.lm
diff --git a/ragel/host-ocaml/rlhc.lm b/ragel/rlhc-ocaml.lm
index f68b61be..f68b61be 100644
--- a/ragel/host-ocaml/rlhc.lm
+++ b/ragel/rlhc-ocaml.lm
diff --git a/ragel/host-ruby/rlhc.lm b/ragel/rlhc-ruby.lm
index 87119465..87119465 100644
--- a/ragel/host-ruby/rlhc.lm
+++ b/ragel/rlhc-ruby.lm
diff --git a/ragel/host-rust/rlhc.lm b/ragel/rlhc-rust.lm
index 57cd66e1..57cd66e1 100644
--- a/ragel/host-rust/rlhc.lm
+++ b/ragel/rlhc-rust.lm