aboutsummaryrefslogtreecommitdiff
path: root/unix/boot/spp/rpp/rpprat/eatup.r
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /unix/boot/spp/rpp/rpprat/eatup.r
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'unix/boot/spp/rpp/rpprat/eatup.r')
-rw-r--r--unix/boot/spp/rpp/rpprat/eatup.r69
1 files changed, 69 insertions, 0 deletions
diff --git a/unix/boot/spp/rpp/rpprat/eatup.r b/unix/boot/spp/rpp/rpprat/eatup.r
new file mode 100644
index 00000000..df001caf
--- /dev/null
+++ b/unix/boot/spp/rpp/rpprat/eatup.r
@@ -0,0 +1,69 @@
+#-h- eatup 1137 local 12/01/80 15:53:50
+# eatup - process rest of statement; interpret continuations
+ include defs
+
+ subroutine eatup
+
+ character ptoken (MAXTOK), t, token (MAXTOK)
+ character gettok
+ integer nlpar, equal
+ include COMMON_BLOCKS
+ string serror "error"
+
+ nlpar = 0
+ token(1) = EOS
+
+ repeat {
+ call outstr (token)
+ t = gettok (token, MAXTOK)
+ } until (t != BLANK & t != TAB)
+
+ if (t == ALPHA) { # is it a "call error" stmt?
+ if (equal (token, serror) == YES) {
+ # call errorc (token)
+ # return
+
+ # ERROR statement is now simply error checked like any other
+ # external procedure, so that it may be used the same way.
+ ername = YES
+ }
+ }
+ goto 10
+
+ repeat {
+ t = gettok (token, MAXTOK)
+10 if (t == SEMICOL | t == NEWLINE)
+ break
+ if (t == RBRACE | t == LBRACE) {
+ call pbstr (token)
+ break
+ }
+ if (t == EOF) {
+ call synerr ("unexpected EOF.")
+ call pbstr (token)
+ break
+ }
+ if (t == COMMA | t == PLUS | t == MINUS | t == STAR |
+ (t == SLASH & body == YES) |
+ t == LPAREN | t == AND | t == BAR | t == BANG | t == TILDE |
+ t == NOT | t == CARET | t == EQUALS | t == UNDERLINE) {
+ while (gettok (ptoken, MAXTOK) == NEWLINE)
+ ;
+ call pbstr (ptoken)
+ if (t == UNDERLINE)
+ token (1) = EOS
+ }
+ if (t == LPAREN)
+ nlpar = nlpar + 1
+ else if (t == RPAREN)
+ nlpar = nlpar - 1
+ if (t == ALPHA)
+ call squash (token)
+ call outstr (token)
+ } until (nlpar < 0)
+
+ if (nlpar != 0)
+ call synerr ("unbalanced parentheses.")
+
+ return
+ end