diff options
author | dos-reis <gdr@axiomatics.org> | 2011-10-11 01:33:26 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2011-10-11 01:33:26 +0000 |
commit | 5c9c9d744bf4f5c71b952f0ef0be9e04a6f92e49 (patch) | |
tree | c3f78291e4bfc4ba1269c2495f88ee1e2b398972 /src/interp/spad-parser.boot | |
parent | 69e0541ffec8beb86c5e0fc04d9bec811be451cd (diff) | |
download | open-axiom-5c9c9d744bf4f5c71b952f0ef0be9e04a6f92e49.tar.gz |
* interp/metalex.lisp (DEFUN-PARSE-TOKEN): Remove.
Move remaining to parsing.lisp.
* interp/fnewmeta.lisp (PARSE-IntegerTok): Remove.
(PARSE-FloatTok): Likewise.
(PARSE-FormalParameter): Likewise.
(PARSE-FormalParameterTok): Likewise.
(PARSE-String): Likewise.
(PARSE-Name): Likewise.
Diffstat (limited to 'src/interp/spad-parser.boot')
-rw-r--r-- | src/interp/spad-parser.boot | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/interp/spad-parser.boot b/src/interp/spad-parser.boot index 719f7258..3ab5c41a 100644 --- a/src/interp/spad-parser.boot +++ b/src/interp/spad-parser.boot @@ -42,10 +42,33 @@ -- -- gdr/2007-11-02 -- -import metalex +import parsing import parse namespace BOOT +--% + +parseToken tt == + tok := matchCurrentToken tt => + pushReduction(makeSymbol strconc(symbolName tt,'"Token"),tokenSymbol tok) + advanceToken() + true + false + +parseString() == + parseToken 'SPADSTRING + +parseInteger() == + parseToken 'NUMBER + +parseName() == + parseToken 'IDENTIFIER and pushReduction('parseName,popStack1()) + +parseFormalParameter() == + parseToken 'ARGUMENT_-DESIGNATOR + +--% + ++ Given a pathname to a source file containing Spad code, returns ++ a list of (old) AST objects representing the toplevel expressions ++ in that file. |