File: sample.rex

package info (click to toggle)
ruby-oedipus-lex 2.6.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 240 kB
  • sloc: ruby: 1,218; lisp: 12; ansic: 5; makefile: 4
file content (15 lines) | stat: -rw-r--r-- 250 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#
# sample.rex
# lexical definition sample for rex
#

class Sample
macro
  BLANK         /[\ \t]+/
rule
  /{{BLANK}}/   # no action
  /\d+/         { [:digit, text.to_i] }
  /\w+/         { [:word, text] }
  /\n/
  /./           { [text, text] }
end