aboutsummaryrefslogtreecommitdiff
path: root/src/nbc/substitution.lex
diff options
context:
space:
mode:
authorCalvin <calvin@EESI>2013-05-28 10:47:11 -0400
committerCalvin <calvin@EESI>2013-05-28 10:47:11 -0400
commitdd38d0d1dda2be42bf280aeca110542f2f2fef1b (patch)
treec921dc0690e29f1b7b913aaa72b9c12539faa5a1 /src/nbc/substitution.lex
parent2f33e34ae06b96c3f3e4456ce960172903f60bfb (diff)
removed files
Diffstat (limited to 'src/nbc/substitution.lex')
-rw-r--r--src/nbc/substitution.lex54
1 files changed, 0 insertions, 54 deletions
diff --git a/src/nbc/substitution.lex b/src/nbc/substitution.lex
deleted file mode 100644
index e460121..0000000
--- a/src/nbc/substitution.lex
+++ /dev/null
@@ -1,54 +0,0 @@
-type svalue = Tokens.svalue
-type ('a, 'b) token = ('a, 'b) Tokens.token
-type pos = int
-type lexresult = (svalue, pos) token
-type arg = int ref
-fun eof _ = Tokens.EOF (~1, ~1)
-%%
-%full
-%header (functor SubstitutionLexFun (structure Tokens: SubstitutionGrm_TOKENS));
-%arg (nesting);
-%s VARIABLE PARENTHESIZED BRACED;
-text = ([^$] | "\\$")+;
-dollar = "$";
-leftparenthesis = "(";
-rightparenthesis = ")";
-notparenthesis = [^()]+;
-leftbrace = "{";
-rightbrace = "}";
-notbrace = [^{}]+;
-other = [A-Za-z0-9_]+;
-%%
-<INITIAL>{text} => (Tokens.TEXT (yytext, yypos, yypos + size yytext));
-<INITIAL>{dollar} => (YYBEGIN VARIABLE; Tokens.DOLLAR (yypos, yypos + 1));
-<INITIAL>{dollar}{leftparenthesis} => (
- YYBEGIN PARENTHESIZED
- ; nesting := !nesting + 1
- ; Tokens.LEFT_PARENTHESIS (yypos, yypos + 1)
-);
-<INITIAL>{dollar}{leftbrace} => (
- YYBEGIN BRACED
- ; nesting := !nesting + 1
- ; Tokens.LEFT_BRACE (yypos, yypos + 1)
-);
-<VARIABLE>{other} => (YYBEGIN INITIAL; Tokens.TEXT (yytext, yypos, yypos + size yytext));
-<PARENTHESIZED>{notparenthesis} => (Tokens.TEXT (yytext, yypos, yypos + size yytext));
-<PARENTHESIZED>{leftparenthesis} => (
- nesting := !nesting + 1
- ; Tokens.LEFT_PARENTHESIS (yypos, yypos + 1)
-);
-<PARENTHESIZED>{rightparenthesis} => (
- nesting := !nesting - 1
- ; if !nesting = 0 then YYBEGIN INITIAL else ()
- ; Tokens.RIGHT_PARENTHESIS (yypos, yypos + 1)
-);
-<BRACED>{notbrace} => (Tokens.TEXT (yytext, yypos, yypos + size yytext));
-<BRACED>{leftbrace} => (
- nesting := !nesting + 1
- ; Tokens.LEFT_BRACE (yypos, yypos + 1)
-);
-<BRACED>{rightbrace} => (
- nesting := !nesting - 1
- ; if !nesting = 0 then YYBEGIN INITIAL else ()
- ; Tokens.RIGHT_BRACE (yypos, yypos + 1)
-);