File: test2.g

package info (click to toggle)
pccts 1.33MR33-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,212 kB
  • ctags: 5,280
  • sloc: ansic: 46,051; cpp: 3,234; makefile: 957
file content (22 lines) | stat: -rw-r--r-- 384 bytes parent folder | download | duplicates (19)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* This is test2.g which is a copy of test.g and tests linking
 * multiple scanners/parsers together; DLG-based scanner
 */

<<
typedef ANTLRCommonToken ANTLRToken;
>>

#token "[\ \t\n]+"	<<skip();>>
#token Eof "@"

class B {

e	:	IDENTIFIER NUMBER
		<<fprintf(stderr, "text is %s,%s\n", $1->getText(), $2->getText());>>
		Eof
	;

}

#token IDENTIFIER	"[a-z]+"
#token NUMBER	"[0-9]+"