Permalink
Browse files

Added assign sample, parses fine, now onto some rules =D

  • Loading branch information...
1 parent f3e8dad commit 21f6cfd5b1ad2a9d25c9adafa3ec113c6279553c @fasterthanlime committed Sep 28, 2009
Showing with 14 additions and 6 deletions.
  1. +6 −1 Makefile
  2. +1 −0 samples/assign.ooc
  3. +5 −3 source/Lexer.ooc
  4. +2 −2 source/rules/TokenRule.ooc
View
@@ -1,10 +1,15 @@
+TESTFILE=source/Lexer.ooc
+GDBCOMMANDS_PATH=/tmp/gdbcommands
.PHONY:all clean mrproper
all:
ooc meta -sourcepath=source/:../rock/source/ -g ${OOC_FLAGS}
test:
- make all && ./meta
+ make all && ./meta ${TESTFILE}
+
+debug:
+ echo run ${TESTFILE} >> ${GDBCOMMANDS_PATH} && gdb ./meta -command=${GDBCOMMANDS_PATH} && rm ${GDBCOMMANDS_PATH}
clean:
rm -rf ooc_tmp/
View
@@ -0,0 +1 @@
+var1=var2
View
@@ -16,18 +16,20 @@ Lexer: class {
rules: ArrayList<Rule>
init: func {
- rules := ArrayList<Rule> new()
+
+ rules = ArrayList<Rule> new()
+
}
parse: func (path: String) {
sReader := SourceReader getReaderFromPath(path)
tokens := Tokenizer new() parse(sReader)
- "Got tokens: " println()
for(token: Token in tokens) {
- printf("%s ", token toString())
+ printf("%s ", token toString(sReader))
}
+ println()
for(rule in rules) {
@@ -1,7 +1,7 @@
import frontend/SourceReader
-import MetaNode
+import ../Lexer
-TokenMetaNode: class extends MetaNode {
+TokenRule: class extends MetaNode {
string : String

0 comments on commit 21f6cfd

Please sign in to comment.