summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorvern <vern>1995-03-05 20:37:26 +0000
committervern <vern>1995-03-05 20:37:26 +0000
commit904d8d2b8f8b11743967cf75741c8086f64206cc (patch)
tree7e83016ea89debafd3bed0505ee48865687fde4f /main.c
parent8afe518ac26bbc147e2864c8433b8dc3fdd0fcf8 (diff)
downloadflex-904d8d2b8f8b11743967cf75741c8086f64206cc.tar.gz
added yyclass
Diffstat (limited to 'main.c')
-rw-r--r--main.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/main.c b/main.c
index 006cfc9..0dd3ff0 100644
--- a/main.c
+++ b/main.c
@@ -32,7 +32,7 @@ char copyright[] =
All rights reserved.\n";
#endif /* not lint */
-/* $Header: /cvsroot/flex/flex/main.c,v 2.56 1995/03/05 16:37:51 vern Exp $ */
+/* $Header: /cvsroot/flex/flex/main.c,v 2.57 1995/03/05 20:37:53 vern Exp $ */
#include "flexdef.h"
@@ -66,7 +66,7 @@ char *action_array;
int action_size, defs1_offset, prolog_offset, action_offset, action_index;
char *infilename = NULL, *outfilename = NULL;
int did_outfilename;
-char *prefix;
+char *prefix, *yyclass;
int do_stdinit, use_stdout;
int onestate[ONE_STACK_SIZE], onesym[ONE_STACK_SIZE];
int onenext[ONE_STACK_SIZE], onedef[ONE_STACK_SIZE], onesp;
@@ -576,6 +576,7 @@ char **argv;
performance_report = 0;
did_outfilename = 0;
prefix = "yy";
+ yyclass = 0;
use_read = use_stdout = false;
sawcmpflag = false;
@@ -965,8 +966,22 @@ _( "Variable trailing context rules entail a large performance penalty\n" ) );
}
if ( C_plus_plus )
+ {
outn( "\n#include <FlexLexer.h>" );
+ if ( yyclass )
+ {
+ outn( "int yyFlexLexer::yylex()" );
+ outn( "\t{" );
+ outn(
+"\tLexerError( \"yyFlexLexer::yylex invoked but %option yyclass used\" );" );
+ outn( "\t}" );
+
+ out_str( "\n#define YY_DECL int %s::yylex()\n",
+ yyclass );
+ }
+ }
+
else
{
if ( yytext_is_array )
@@ -977,6 +992,10 @@ _( "Variable trailing context rules entail a large performance penalty\n" ) );
outn( "extern char *yytext;" );
outn( "#define yytext_ptr yytext" );
}
+
+ if ( yyclass )
+ flexerror(
+ _( "%option yyclass only meaningful for C++ scanners" ) );
}
if ( useecs )