diff options
Diffstat (limited to 'sched')
-rw-r--r-- | sched/Makefile | 2 | ||||
-rw-r--r-- | sched/_tags | 3 | ||||
-rw-r--r-- | sched/netlist_lexer.mll | 9 |
3 files changed, 11 insertions, 3 deletions
diff --git a/sched/Makefile b/sched/Makefile index 4d36b96..35d6ddc 100644 --- a/sched/Makefile +++ b/sched/Makefile @@ -3,7 +3,7 @@ IN=graph.ml main.ml netlist_ast.ml netlist_dumb.ml netlist_lexer.mll netlist.ml all: sched sched: $(IN) - ocamlbuild -libs unix main.native + ocamlbuild main.native mv main.native sched clean: diff --git a/sched/_tags b/sched/_tags index 503ce62..007e22c 100644 --- a/sched/_tags +++ b/sched/_tags @@ -1,3 +1,4 @@ true: use_menhir <*.ml>: debug -<*.byte>: use_unix, debug
\ No newline at end of file +<*.byte>: use_unix, debug +<*.native>: use_unix diff --git a/sched/netlist_lexer.mll b/sched/netlist_lexer.mll index 60cb223..ec27367 100644 --- a/sched/netlist_lexer.mll +++ b/sched/netlist_lexer.mll @@ -1,5 +1,6 @@ { open Netlist_parser +open Lexing exception Eof let keyword_list = @@ -22,10 +23,16 @@ let keyword_list = "XOR", XOR; ] +let newline lexbuf = + let pos = lexbuf.lex_curr_p in + lexbuf.lex_curr_p <- + { pos with pos_lnum = pos.pos_lnum + 1; pos_bol = pos.pos_cnum } + } rule token = parse - [' ' '\t' '\n'] { token lexbuf } (* skip blanks *) + | '\n' { newline lexbuf ; token lexbuf } + | [' ' '\t'] { token lexbuf } (* skip blanks *) | "=" { EQUAL } | ":" { COLON } | "," { COMMA } |