%{ // // $Id$ //----------------------------------------------------------------------- // // (c) Copyright 2002 by GATS, Inc., // 11864 Canon Blvd, Suite 101, Newport News VA 23606 // // All Rights Reserved. No part of this software or publication may be // reproduced, stored in a retrieval system, or transmitted, in any form // or by any means, electronic, mechanical, photocopying, recording, or // otherwise without the prior written permission of GATS, Inc. // //----------------------------------------------------------------------- // // Module: ConfigLexer.l // // Author: John Burton // // Date: Fri Nov 8 17:37:16 2002 // //----------------------------------------------------------------------- // // Modification History: // // $Log$ // //----------------------------------------------------------------------- // //----------------------------------------------------------------------- // Include Files: //----------------------------------------------------------------------- // #include #include #include #include #include "ConfigFile.h" #include "Value.h" #include "ConfigLexer.h" #include "errno.h" // //----------------------------------------------------------------------- // Defines and Macros: //----------------------------------------------------------------------- // // //----------------------------------------------------------------------- // Global Variables: //----------------------------------------------------------------------- // // //----------------------------------------------------------------------- // Utility Routines: //----------------------------------------------------------------------- // %} %option noyywrap %option caseless %option yylineno %option never-interactive %s SECTION_NAME intvalue (-?[0-9]+) realvalue (-?(([0-9]+)|([0-9]*\.[0-9]*)([eE][-+]?[0-9]+)?)) %% [ \t]+ ; /* ignore blanks */ \[ { BEGIN SECTION_NAME;} [ \t]+ ; /* ignore blanks */ [a-zA-Z][a-zA-Z0-9\._]* {return SECTIONNAME;} \] { BEGIN 0;} \n { BEGIN 0; } (\/\/).*\n { } TRUE {return IVALUE;} FALSE {return IVALUE;} {intvalue} {return IVALUE;} {realvalue} {return RVALUE;} \"[^"\n]*["\n] {return CHRSTR;} \"[^"\n]*$ {fprintf(stderr,"Unterminated string - %s",yytext); return CHRSTR;} \'[^'\n]*['\n] {return CHRSTR;} \'[^'\n]*$ {fprintf(stderr,"Unterminated string - %s",yytext); return CHRSTR;} [ \f\t]+\n {} [-_A-Za-z/"."][-_A-Za-z0-9/"."]* {return SYMBOL;} = {return ASSIGN;} \} {return RBRACE;} \{ {return LBRACE;} "," {return COMMA;} \n { } . {fprintf(stderr,"CHAR - %c\n",yytext[0]); return yytext[0];} <> { return EOF; } %%