summaryrefslogtreecommitdiff
path: root/src/nsgenbind-lexer.l
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2015-07-21 23:48:45 +0100
committerVincent Sanders <vince@kyllikki.org>2015-07-21 23:48:45 +0100
commit1288d8c535edd2ce29eebdc4acca6b2beab89841 (patch)
tree162bd2d090e03a7ffb9523797c1dd2aebbce236f /src/nsgenbind-lexer.l
parent94137186a3e2270e9b96f243a82a77a590c17f01 (diff)
downloadnsgenbind-1288d8c535edd2ce29eebdc4acca6b2beab89841.tar.gz
nsgenbind-1288d8c535edd2ce29eebdc4acca6b2beab89841.tar.bz2
Change binding grammar to new approach.
Diffstat (limited to 'src/nsgenbind-lexer.l')
-rw-r--r--src/nsgenbind-lexer.l39
1 files changed, 26 insertions, 13 deletions
diff --git a/src/nsgenbind-lexer.l b/src/nsgenbind-lexer.l
index 4b5e225..f7b6528 100644
--- a/src/nsgenbind-lexer.l
+++ b/src/nsgenbind-lexer.l
@@ -72,7 +72,9 @@ cblockopen \%\{
cblockclose \%\}
/* used for #include directive */
-poundsign ^{whitespace}*#
+poundsign ^{whitespace}*#
+
+dblcolon \:\:
%x cblock
@@ -88,44 +90,55 @@ poundsign ^{whitespace}*#
yylloc->last_column = 0;
}
- /* terminals */
+ /* binding terminals */
-webidlfile return TOK_IDLFILE;
+binding return TOK_BINDING;
-hdrcomment return TOK_HDR_COMMENT;
+webidl return TOK_WEBIDL;
-preamble return TOK_PREAMBLE;
+preface return TOK_PREFACE;
prologue return TOK_PROLOGUE;
epilogue return TOK_EPILOGUE;
-binding return TOK_BINDING;
+postface return TOK_POSTFACE;
-interface return TOK_INTERFACE;
-flags return TOK_FLAGS;
+ /* class member terminals */
-type return TOK_TYPE;
+class return TOK_CLASS;
private return TOK_PRIVATE;
internal return TOK_INTERNAL;
+flags return TOK_FLAGS;
+
+type return TOK_TYPE;
+
unshared return TOK_UNSHARED;
shared return TOK_SHARED;
property return TOK_PROPERTY;
-operation return TOK_OPERATION;
+ /* implementation terminals */
+
+init return TOK_INIT;
-api return TOK_API;
+fini return TOK_FINI;
+
+method return TOK_METHOD;
getter return TOK_GETTER;
setter return TOK_SETTER;
+ /* other terminals */
+
+{dblcolon} return TOK_DBLCOLON;
+
{cblockopen} BEGIN(cblock);
{identifier} {
@@ -140,7 +153,7 @@ setter return TOK_SETTER;
{multicomment} /* nothing */
-{poundsign}include BEGIN(incl);
+{poundsign}include BEGIN(incl);
{other} return (int) yytext[0];
@@ -151,7 +164,7 @@ setter return TOK_SETTER;
<cblock>\% yylval->text = strdup(yytext); return TOK_CCODE_LITERAL;
-<incl>[ \t]*\" /* eat the whitespace and open quotes */
+<incl>[ \t]*\" /* eat the whitespace and open quotes */
<incl>[^\t\n\"]+ {
/* got the include file name */