summaryrefslogtreecommitdiff
path: root/grammar
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2019-12-01 09:05:03 -0800
committerAdrian Thurston <thurston@colm.net>2019-12-01 09:05:03 -0800
commit5a4407de2c4c03083f1c25b5c7fdb849cdc08a12 (patch)
tree4436efeb998fd54de016723d92d74c400d48e070 /grammar
parent479376c313208ee764d212846892cb904b8e5b89 (diff)
downloadcolm-5a4407de2c4c03083f1c25b5c7fdb849cdc08a12.tar.gz
moved grammars out to their own dirs
We also want some testing/validation support for each grammar. This dir will get quite messy if we move files.
Diffstat (limited to 'grammar')
-rw-r--r--grammar/.gitignore8
-rw-r--r--grammar/Makefile18
-rw-r--r--grammar/dns/.gitignore2
-rw-r--r--grammar/dns/Makefile9
-rw-r--r--grammar/dns/dns.rl (renamed from grammar/dns.rl)0
-rw-r--r--grammar/pcre/.gitignore4
-rw-r--r--grammar/pcre/Makefile11
-rw-r--r--grammar/pcre/pcre.lm (renamed from grammar/pcre.lm)0
-rw-r--r--grammar/pcre/pcre.rl (renamed from grammar/pcre.rl)0
-rw-r--r--grammar/rust/.gitignore4
-rw-r--r--grammar/rust/Makefile7
-rw-r--r--grammar/rust/parserust.lm (renamed from grammar/parserust.lm)0
-rw-r--r--grammar/rust/rust.lm (renamed from grammar/rust.lm)0
13 files changed, 40 insertions, 23 deletions
diff --git a/grammar/.gitignore b/grammar/.gitignore
deleted file mode 100644
index acbf5ac9..00000000
--- a/grammar/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-/rust.c
-/rust
-/pcre.c
-/pcre
-/pcre-colm.c
-/pcre-colm
-/dns.cc
-/dns
diff --git a/grammar/Makefile b/grammar/Makefile
index 35f244f5..21a2603a 100644
--- a/grammar/Makefile
+++ b/grammar/Makefile
@@ -1,18 +1,6 @@
-all: rust pcre pcre-colm dns
+SUBDIRS = "rust pcre dns"
-RAGEL = ../ragel/ragel
-COLM = ../colm/colm
+all: rust pcre dns
+ for d in $(SUBDIRS); do cd $$d && $(MAKE); done
-rust: rust.lm parserust.lm $(COLM)
- $(COLM) -o rust parserust.lm
-pcre: pcre.rl $(RAGEL)
- $(RAGEL) -G2 pcre.rl
- gcc -g -Wall -o pcre pcre.c
-
-pcre-colm: pcre.lm
- $(COLM) -o pcre-colm pcre.lm
-
-dns: dns.rl
- $(RAGEL) -G2 -o dns.cc dns.rl
- g++ -g -Wall -o dns dns.cc -lpcap
diff --git a/grammar/dns/.gitignore b/grammar/dns/.gitignore
new file mode 100644
index 00000000..f2c6cd5b
--- /dev/null
+++ b/grammar/dns/.gitignore
@@ -0,0 +1,2 @@
+/dns.cc
+/dns
diff --git a/grammar/dns/Makefile b/grammar/dns/Makefile
new file mode 100644
index 00000000..b1a87107
--- /dev/null
+++ b/grammar/dns/Makefile
@@ -0,0 +1,9 @@
+COLM = ../../colm/colm
+RAGEL = ../../ragel/ragel
+
+all: dns
+
+dns: dns.rl
+ $(RAGEL) -G2 -o dns.cc dns.rl
+ g++ -g -Wall -o dns dns.cc -lpcap
+
diff --git a/grammar/dns.rl b/grammar/dns/dns.rl
index 215c61bd..215c61bd 100644
--- a/grammar/dns.rl
+++ b/grammar/dns/dns.rl
diff --git a/grammar/pcre/.gitignore b/grammar/pcre/.gitignore
new file mode 100644
index 00000000..05b136b8
--- /dev/null
+++ b/grammar/pcre/.gitignore
@@ -0,0 +1,4 @@
+/pcre-colm.c
+/pcre-colm
+/pcre-ragel.c
+/pcre-ragel
diff --git a/grammar/pcre/Makefile b/grammar/pcre/Makefile
new file mode 100644
index 00000000..6f895485
--- /dev/null
+++ b/grammar/pcre/Makefile
@@ -0,0 +1,11 @@
+COLM = ../../colm/colm
+RAGEL = ../../ragel/ragel
+
+all: pcre-colm pcre-ragel
+
+pcre-colm: pcre.lm
+ $(COLM) -o $@ pcre.lm
+
+pcre-ragel: pcre.rl $(RAGEL)
+ $(RAGEL) -G2 pcre.rl
+ gcc -g -Wall -o $@ pcre.c
diff --git a/grammar/pcre.lm b/grammar/pcre/pcre.lm
index 691b1307..691b1307 100644
--- a/grammar/pcre.lm
+++ b/grammar/pcre/pcre.lm
diff --git a/grammar/pcre.rl b/grammar/pcre/pcre.rl
index 307d5467..307d5467 100644
--- a/grammar/pcre.rl
+++ b/grammar/pcre/pcre.rl
diff --git a/grammar/rust/.gitignore b/grammar/rust/.gitignore
new file mode 100644
index 00000000..5bf8231b
--- /dev/null
+++ b/grammar/rust/.gitignore
@@ -0,0 +1,4 @@
+/rust.c
+/rust
+/query.c
+/query
diff --git a/grammar/rust/Makefile b/grammar/rust/Makefile
new file mode 100644
index 00000000..20e3edeb
--- /dev/null
+++ b/grammar/rust/Makefile
@@ -0,0 +1,7 @@
+COLM = ../../colm/colm
+RAGEL = ../../ragel/ragel
+
+all: rust
+
+rust: rust.lm parserust.lm $(COLM)
+ $(COLM) -o rust parserust.lm
diff --git a/grammar/parserust.lm b/grammar/rust/parserust.lm
index 3e17a3b6..3e17a3b6 100644
--- a/grammar/parserust.lm
+++ b/grammar/rust/parserust.lm
diff --git a/grammar/rust.lm b/grammar/rust/rust.lm
index f6dd8c15..f6dd8c15 100644
--- a/grammar/rust.lm
+++ b/grammar/rust/rust.lm