File: bug7.txt

package info (click to toggle)
jlex 1.2.6-13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 444 kB
  • sloc: java: 5,554; sh: 8; makefile: 5
file content (69 lines) | stat: -rw-r--r-- 1,275 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69

The following JavaLex input file is in error;
an undefined macro is referenced in the rules section.
However, JavaLex generates errors into infinity,
which it shouldn't do.  
				-- Elliot

****************************************************************************

//
//      (c) Copyright 1996 PrinceNet, Inc.
//      All Rights Reserved.
//
// ------------------------------------------------------------------
//


import java.io.*;

%%

%type java_cup.runtime.Symbol
%char
%line

%{
int           firstCharinLine;
int           tabs = 0;
boolean       MacroHeaderDetected = false;

private int stringstart;
private StringBuffer charBuf = null;

private java_cup.runtime.Symbol tok(int kind) {
	return new java_cup.runtime.Symbol(kind, yychar, yychar+yylength());
}

private java_cup.runtime.Symbol tok(int kind, Object o) {
	return new java_cup.runtime.Symbol(kind, yychar, yychar+yylength(), o);
}

private void error(int line, String text) {
	System.out.println("Invalid text on line " + line + " " + text);
}

%}

%eofval{
	return tok(sym.EOF);
%eofval}


%%



<YYINITIAL>'{'	{ return tok(sym.LBRACE); }

<YYINITIAL>\}	{ return tok(sym.RBRACE); }

<YYINITIAL>" "	{ }

<YYINITIAL>\n { firstCharinLine = yychar+1; }

<YYINITIAL>. { 
	error(yyline+1, yytext());
}