forked from xapi-project/xenopsd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request xapi-project#4 from djs55/add-lexer
Re-add xl config file lexer, from xen-api history
- Loading branch information
Showing
2 changed files
with
18 additions
and
209 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
open Xn_cfg_parser | ||
let unquote x = String.sub x 1 (String.length x - 2) | ||
} | ||
rule token = parse | ||
['a'-'z']['_''0'-'9''a'-'z']* as x { IDENT x } | ||
| ['0'-'9']['0'-'9''a'-'f''x']* as x { INT (int_of_string x) } | ||
| '\''([^'\'''\n']|'.')*'\'' as x { STRING (unquote x) } | ||
| '"'([^'"''\n']|'.')*'"' as x { STRING (unquote x) } | ||
| ',' { COMMA } | ||
| '[' { LBRACKET } | ||
| ']' { RBRACKET } | ||
| '=' { EQ } | ||
| ';' { SEMICOLON } | ||
| '\n' | ||
| '#'[^'\n']*'\n' { NEWLINE } | ||
| [' ' '\t' ] { token lexbuf } | ||
| eof { EOF } |