From 3baeb11a8fbcfcdbc31976d421f17b85503b3ecd Mon Sep 17 00:00:00 2001 From: WuKong Date: Fri, 4 Sep 2015 09:25:34 +0200 Subject: init attribute-based encryption Change-Id: Iba1a3d722110abf747a0fba366f3ebc911d25b25 --- moon-abe/pbc-0.5.14/pbc/parser.lex | 56 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 moon-abe/pbc-0.5.14/pbc/parser.lex (limited to 'moon-abe/pbc-0.5.14/pbc/parser.lex') diff --git a/moon-abe/pbc-0.5.14/pbc/parser.lex b/moon-abe/pbc-0.5.14/pbc/parser.lex new file mode 100644 index 00000000..1d0b9f23 --- /dev/null +++ b/moon-abe/pbc-0.5.14/pbc/parser.lex @@ -0,0 +1,56 @@ +%{ +#include +#include +#include // for intptr_t +#include +#include "pbc_utils.h" +#include "pbc_field.h" + +#include "pbc_tree.h" +#define YYSTYPE tree_ptr +#include "parser.tab.h" + +extern int option_easy; + +%} + +%option nounput noinput + +%x COMMENT +%% +\/\* BEGIN(COMMENT); // Open C-style comment. +\*\/ BEGIN(0); // Close C-style comment. +. // Within a C-style comment. +\n // Within a C-style comment. +#.*$ // Comment. +[ \t\r]* // Whitespace. + +define return DEFINE; +[0-9]+ yylval = tree_new_z(yytext); return NUM; +[a-zA-Z_][a-zA-Z0-9_]* yylval = tree_new_id(yytext); return ID; +:= return ASSIGN; +== return EQ; +!= return NE; +\< return LT; +\> return T_GT; +\<= return LE; +\>= return GE; +\+ return PLUS; +- return MINUS; +\/ return DIVIDE; +\* return TIMES; +\^ return POW; +; return TERMINATOR; +\, return COMMA; +\? return QUESTION; +: return COLON; +\( return LPAR; +\) return RPAR; +\[ return LSQU; +\] return RSQU; +\{ return LBRACE; +\} return RBRACE; +\n if (option_easy) return TERMINATOR; += return option_easy ? ASSIGN : UNKNOWN; +. return UNKNOWN; +%% -- cgit 1.2.3-korg