From 1fdd3d6b44f1eececda6e23e7f044d911bb9a8eb Mon Sep 17 00:00:00 2001 From: dos-reis <gdr@axiomatics.org> Date: Wed, 8 Oct 2008 22:18:38 +0000 Subject: Allow compound argument types in Boot signatures. * boot/parser.boot (bpArgtypeList): New. (bpMapping); Use it. * boot/tokens.boot: Define neutral element for CONCAT. --- src/ChangeLog | 7 +++++++ src/boot/parser.boot | 18 +++++++++++++----- src/boot/tokens.boot | 1 + 3 files changed, 21 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index be8dd539..97f2c847 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2008-10-08 Gabriel Dos Reis <gdr@cs.tamu.edu> + + Allow compound argument types in Boot signatures. + * boot/parser.boot (bpArgtypeList): New. + (bpMapping); Use it. + * boot/tokens.boot: Define neutral element for CONCAT. + 2008-10-08 Gabriel Dos Reis <gdr@cs.tamu.edu> * boot/ast.boot (bfReduce): Check neutral value for original diff --git a/src/boot/parser.boot b/src/boot/parser.boot index 2ad0bac5..b881ffe2 100644 --- a/src/boot/parser.boot +++ b/src/boot/parser.boot @@ -458,8 +458,8 @@ bpModule() == ++ Parse a module import, or a import declaration for a foreign entity. ++ Import: -++ IMPORT Name for Signature -++ IMPORT QUOTE String +++ IMPORT Signature FOR Name +++ IMPORT Name bpImport() == bpEqKey "IMPORT" => a := bpState() @@ -498,12 +498,20 @@ bpSimpleMapping() == true false +++ ArgtypeList: +++ ( ArgtypeSequence ) +++ ArgtypeSequence: +++ Application +++ Application , ArgtypeSequence +bpArgtypeList() == + bpTuple function bpApplication + ++ Parse a mapping expression ++ Mapping: -++ (IdList) -> Application -++ SimpleMapping +++ ArgtypeList -> Application +++ SimpleMapping bpMapping() == - bpParenthesized function bpIdList and + bpParenthesized function bpArgtypeList and bpEqKey "ARROW" and bpApplication() and bpPush Mapping(bpPop1(), bfUntuple bpPop1()) or bpSimpleMapping() diff --git a/src/boot/tokens.boot b/src/boot/tokens.boot index 53dc38a9..6a98317a 100644 --- a/src/boot/tokens.boot +++ b/src/boot/tokens.boot @@ -208,6 +208,7 @@ for i in [ _ ["lcm", 1] , _ ["STRCONC", '""] , _ ["strconc", '""] , _ + ["CONCAT", '""] , _ ["MAX", -999999] , _ ["MIN", 999999] , _ ["*", 1] , _ -- cgit v1.2.3