File: calc3.rex

package info (click to toggle)
ruby-oedipus-lex 2.6.3-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-- 238 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#
# calc3.rex
# lexical scanner definition for rex
#

class Calculator3 < Racc::Parser
macro
  BLANK         /\s+/
  DIGIT         /\d+/
rule
  /{{BLANK}}/
  /{{DIGIT}}/  { [:NUMBER, text.to_i] }
  /.|\n/       { [text, text] }
inner
end