source: other-projects/rsyntax-textarea/devel-packages/jflex-1.4.3/examples/standalone-maven/src/main/jflex/standalone.flex@ 25584

Last change on this file since 25584 was 25584, checked in by davidb, 12 years ago

Initial cut an a text edit area for GLI that supports color syntax highlighting

File size: 1.8 KB
Line 
1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2 * Copyright (C) 1998-2009 Gerwin Klein <[email protected]> *
3 * All rights reserved. *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License. See the file *
7 * COPYRIGHT for more information. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License along *
15 * with this program; if not, write to the Free Software Foundation, Inc., *
16 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
17 * *
18 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
19
20
21/**
22 This is a small example of a standalone text substitution scanner
23 It reads a name after the keyword name and substitutes all occurences
24 of "hello" with "hello <name>!". There is a sample input file
25 "sample.inp" provided in this directory
26*/
27
28package de.jflex.example.standalone;
29
30%%
31
32%public
33%class Subst
34%standalone
35
36%unicode
37
38%{
39 String name;
40%}
41
42%%
43
44"name " [a-zA-Z]+ { name = yytext().substring(5); }
45[Hh] "ello" { System.out.print(yytext()+" "+name+"!"); }
Note: See TracBrowser for help on using the repository browser.