From d55f73ddbb0dc099b1471f3493e505142ce94a97 Mon Sep 17 00:00:00 2001 From: Balbir Singh Date: Wed, 19 Mar 2008 14:53:07 +0000 Subject: First initial revision. Look for TODOs and BUGs git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/src@1 4f4bb910-9a46-0410-90c8-c897d4f1cd53 --- lex.l | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 lex.l (limited to 'lex.l') diff --git a/lex.l b/lex.l new file mode 100644 index 0000000..f9cc1ae --- /dev/null +++ b/lex.l @@ -0,0 +1,33 @@ +/* + * Copyright IBM Corporation. 2007 + * + * Authors: Balbir Singh + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2.1 of the GNU Lesser General Public License + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +%{ +#include "y.tab.h" +int line_no = 1; + +%} + +%% +\n {line_no++;} +[ \t] {/* DO NOTHING */} +^#.*[ \t]* {/* Comments */} +^\*.*[ \t]* {/* Comments */} +"mount" {return MOUNT;} +"task" {return TASK;} +"admin" {return ADMIN;} +"perm" {return PERM;} +"group" {return GROUP;} +[a-zA-Z0-9_\-\/\.]+ {yylval.name = strdup(yytext); return ID;} +. {return yytext[0];} +%% + -- cgit