lexer working with pcre, not building any objects for handling tokens yet
This commit is contained in:
1 parent
25888fe55a
commit
96010ea9ae
5 files changed
+37
-5
No files matched your search
@@ -6,7 +6,7 @@ LDFLAGS := -lpcre
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET):
|
||||
$(TARGET): $(shell which imbecile)
|
||||
imbecile $(I_SOURCE).I
|
||||
$(CXX) -o $@ *.cc $(LDFLAGS)
|
||||
|
||||
|
||||
+8
-3
@@ -1,9 +1,14 @@
|
||||
|
||||
[tokens]
|
||||
|
||||
ASSIGN :=
|
||||
DASSIGN :==
|
||||
IDENTIFIER [a-zA-Z_][a-zA-Z_0-9]*
|
||||
AND and
|
||||
OR or
|
||||
NOT not
|
||||
LPAREN \(
|
||||
RPAREN \)
|
||||
WS \s+
|
||||
EQUALS =
|
||||
IDENTIFIER [a-zA-Z_][a-zA-Z_0-9]*
|
||||
|
||||
[rules]
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
#include "itest.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main(int argc, char * argv[])
|
||||
{
|
||||
Parser p;
|
||||
stringstream t(string(
|
||||
"hi there (one and two and three and four) or (two = nine)"
|
||||
));
|
||||
p.parse(t);
|
||||
}
|
||||
Reference in new issue
Block a user