diff options
author | dos-reis <gdr@axiomatics.org> | 2012-05-23 02:49:30 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2012-05-23 02:49:30 +0000 |
commit | a8faa740f1e13fce63ac23326a227655bca7a0b2 (patch) | |
tree | a4d6165c93449b677aaaa45e609131546198fb1b /src/boot/pile.boot | |
parent | eae4d54c648d019b9db583b4e8d2c432f8d7bb16 (diff) | |
download | open-axiom-a8faa740f1e13fce63ac23326a227655bca7a0b2.tar.gz |
* boot/tokens.boot (%Token): New datatype.
(makeToken): New.
* boot/includer.boot: Use %token accessors.
* boot/parser.boot: Likewise.
* boot/pile.boot: Likewise.
* boot/scanner.boot: Likewise.
* boot/utility.boot: Export subString.
Diffstat (limited to 'src/boot/pile.boot')
-rw-r--r-- | src/boot/pile.boot | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/boot/pile.boot b/src/boot/pile.boot index fa19c102..f789067d 100644 --- a/src/boot/pile.boot +++ b/src/boot/pile.boot @@ -1,6 +1,6 @@ -- Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd. -- All rights reserved. --- Copyright (C) 2007-2010, Gabriel Dos Reis. +-- Copyright (C) 2007-2012, Gabriel Dos Reis. -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without @@ -38,19 +38,19 @@ namespace BOOTTRAN module pile shoeFirstTokPosn t == - shoeTokPosn CAAR t + tokenPosition CAAR t shoeLastTokPosn t== - shoeTokPosn second t + tokenPosition second t shoePileColumn t== - rest shoeTokPosn CAAR t + rest tokenPosition CAAR t -- s is a token-dq-stream shoePileInsert (s)== bStreamNull s => [[],:s] - toktype := shoeTokType CAAAR s + toktype := tokenClass CAAAR s toktype = "LISP" or toktype = "LINE" => [[first s],:rest s] a:=shoePileTree(-1,s) [[a.2],:a.3] @@ -104,11 +104,11 @@ shoePileCforest x== shoePileCoagulate(a,b)== b = nil => [a] c := first b - shoeTokPart CAAR c = "THEN" or shoeTokPart CAAR c = "ELSE" => + tokenValue CAAR c = "THEN" or tokenValue CAAR c = "ELSE" => shoePileCoagulate (dqAppend(a,c),rest b) d := second a - e := shoeTokPart d - d is ["KEY",:.] and + e := tokenValue d + tokenClass d = "KEY" and (e has SHOEINF or e = "COMMA" or e = "SEMICOLON") => shoePileCoagulate(dqAppend(a,c),rest b) [a,:shoePileCoagulate(c,rest b)] @@ -117,11 +117,11 @@ shoeSeparatePiles x== x = nil => [] rest x = nil => first x a := first x - semicolon := dqUnit shoeTokConstruct("KEY", "BACKSET",shoeLastTokPosn a) + semicolon := dqUnit mk%Token("KEY", "BACKSET",shoeLastTokPosn a) dqConcat [a,semicolon,shoeSeparatePiles rest x] shoeEnPile x== - dqConcat [dqUnit shoeTokConstruct("KEY","SETTAB",shoeFirstTokPosn x), + dqConcat [dqUnit mk%Token("KEY","SETTAB",shoeFirstTokPosn x), x, _ - dqUnit shoeTokConstruct("KEY","BACKTAB",shoeLastTokPosn x)] + dqUnit mk%Token("KEY","BACKTAB",shoeLastTokPosn x)] |