summaryrefslogtreecommitdiffstats
path: root/taccle/examples/interactive_calculator.tac
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2017-07-27 20:41:06 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2017-07-27 20:41:06 (GMT)
commit3071f542c5b8d2957f22f92e8382006d9c7446d3 (patch)
tree5af359bb04c40bac592b81b9c83d0a10b5a753b2 /taccle/examples/interactive_calculator.tac
parenta89231ca666294b1855b4469fcd8907ccb5c846f (diff)
downloadblt-3071f542c5b8d2957f22f92e8382006d9c7446d3.zip
blt-3071f542c5b8d2957f22f92e8382006d9c7446d3.tar.gz
blt-3071f542c5b8d2957f22f92e8382006d9c7446d3.tar.bz2
backout parser changes
Diffstat (limited to 'taccle/examples/interactive_calculator.tac')
-rwxr-xr-xtaccle/examples/interactive_calculator.tac42
1 files changed, 0 insertions, 42 deletions
diff --git a/taccle/examples/interactive_calculator.tac b/taccle/examples/interactive_calculator.tac
deleted file mode 100755
index ac8a3ba..0000000
--- a/taccle/examples/interactive_calculator.tac
+++ /dev/null
@@ -1,42 +0,0 @@
-# $Id: interactive_calculator.tac,v 1.2 2004/09/08 21:38:44 tang Exp $
-
-# This example expands the simple calculator to be interactive from
-# the command line. Note the use of an empty rule (i.e., epsilon
-# transition). Also featured are the error token and error recovery.
-
-%{
-#!/usr/bin/tclsh
-
-%}
-
-%token ID NEWLINE
-
-%%
-
-start: line NEWLINE start
- | line
- ;
-
-line: E { puts " = $1" }
- | error { puts " -- error" }
- | # empty
- ;
-
-E: E '+' T { set _ [expr {$1 + $3}] }
- | E '-' T { set _ [expr {$1 - $3}] }
- | T
- ;
-
-T: T '*' F { set _ [expr {$1 * $3}] }
- | T '/' F { set _ [expr {$1 / $3}] }
- | F
- ;
-
-F: '(' E ')' { set _ $2 }
- | ID { set _ $::yylval }
- ;
-
-%%
-
-source simple_scanner.tcl
-yyparse