diff options
author | Vincent Sanders <vincent.sanders@collabora.co.uk> | 2012-09-05 11:38:56 +0100 |
---|---|---|
committer | Vincent Sanders <vincent.sanders@collabora.co.uk> | 2012-09-05 20:06:05 +0100 |
commit | 26dc8906aeb0783cf36bde31e9051b29a193eb23 (patch) | |
tree | 0921de4f6a92c3dc6571c1ba693e4ff19d76df8d /src/genjsbind-lexer.l | |
parent | 1c7bc7e17ace1e457c4c0336353f142aef36d254 (diff) | |
download | nsgenbind-26dc8906aeb0783cf36bde31e9051b29a193eb23.tar.gz nsgenbind-26dc8906aeb0783cf36bde31e9051b29a193eb23.tar.bz2 |
make tests work
add basic commandlien handling
Diffstat (limited to 'src/genjsbind-lexer.l')
-rw-r--r-- | src/genjsbind-lexer.l | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/genjsbind-lexer.l b/src/genjsbind-lexer.l new file mode 100644 index 0000000..e976a8f --- /dev/null +++ b/src/genjsbind-lexer.l @@ -0,0 +1,52 @@ +/* + * binding generator lexer + */ + +/* lexer options */ +%option never-interactive +%option bison-bridge +%option nodefault +%option warn +%option prefix="genjsbind_" +%option nounput + +/* header block */ +%{ + +#include <stdbool.h> +#include <stdio.h> +#include <string.h> + +#include "genjsbind-parser.h" + +%} + + /* other Unicode “space separator” */ +USP (\xe1\x9a\x80)|(\xe1\xa0\x8e)|(\xe2\x80[\x80-\x8a])|(\xe2\x80\xaf)|(\xe2\x81\x9f)|(\xe3\x80\x80) + +/* non breaking space \u00A0 */ +NBSP (\xc2\xa0) + +whitespace ([ \t\v\f\n]|{NBSP}|{USP}) + +multicomment \/\*(([^*])|(\*[^/]))*\*\/ + +quotedstring [^\"\\\n\r] + +other [^\t\n\r 0-9A-Z_a-z] + +%% + +{whitespace} /* nothing */ + +webidlfile return TOK_IDLFILE; + +\"{quotedstring}*\" yylval->text = strndup(yytext + 1,strlen(yytext+1) - 1 ); return TOK_STRING_LITERAL; + +{multicomment} /* nothing */ + +{other} return (int) yytext[0]; + +. /* nothing */ + +%% |