Update of /var/lib/cvs/fundev/Sources/runtime-manager/debugger-nub/gdb-mi
In directory cantor:/tmp/cvs-serv20963
Modified Files:
Tag: fundev-2-1-gdb-nub
gdb-access.dylan
Log Message:
warn if parallel gets two real
matches
Index: gdb-access.dylan
===================================================================
RCS file:
/var/lib/cvs/fundev/Sources/runtime-manager/debugger-nub/gdb-mi/Attic/gdb-access.dylan,v
retrieving revision 1.1.2.32
retrieving revision 1.1.2.33
diff -u -d -r1.1.2.32 -r1.1.2.33
--- gdb-access.dylan 13 Apr 2004 18:46:09 -0000 1.1.2.32
+++ gdb-access.dylan 14 Apr 2004 10:53:33 -0000 1.1.2.33
@@ -1,5 +1,5 @@
module: gdb-access
-synopsis:
+synopsis:
author: gabor@xxxxxxx
copyright: see below
qoute-of-the-day: Intelligence is the ability to avoid work, yet getting work
done. -- Linus Torvalds
@@ -9,24 +9,24 @@
//
// Copyright (c) 2004 Gwydion Dylan Maintainers
// All rights reserved.
-//
+//
// Use and copying of this software and preparation of derivative
// works based on this software are permitted, including commercial
// use, provided that the following conditions are observed:
-//
+//
// 1. This copyright notice must be retained in full on any copies
// and on appropriate parts of any derivative works.
// 2. Documentation (paper or online) accompanying any system that
// incorporates this software, or any part of it, must acknowledge
// the contribution of the Gwydion Dylan Maintainers.
-//
+//
// This software is made available "as is". Neither the authors nor
// the Gwydion Dylan Maintainers make any warranty about the software,
// its performance, or its conformity to any specification.
-//
+//
// Bug reports should be sent to <gd-bugs@xxxxxxxxxxxxxxxx>; questions,
// comments and suggestions are welcome at <gd-hackers@xxxxxxxxxxxxxxxx>.
-// Also, see http://www.gwydiondylan.org/ for updates and documentation.
+// Also, see http://www.gwydiondylan.org/ for updates and documentation.
//
//======================================================================
@@ -37,8 +37,8 @@
define constant test-transcript
= #[
-
-
+
+
#[
"34-eee"
"34^error,msg=\"Undefined MI command: eee\""
@@ -95,7 +95,7 @@
//
define class <gdb-mi-session>(<object>)
- //
+ //
// pending: associating sent (but not yet answered) tokens with commands
//
slot session-pending :: <deque> = make(<deque>);// ###bug### when writing
<dequeue>
@@ -105,11 +105,11 @@
slot session-history :: <stretchy-vector> = make(<stretchy-vector>);
//
// results: associating results with tokens
- //
+ //
slot session-results :: <table> = make(<table>);
//
// commands: associating commands with tokens
- //
+ //
slot session-commands :: <table> = make(<table>);
end;
@@ -125,6 +125,7 @@
define constant <operation> = <symbol>;
define constant <positive> = <integer>; // for now... ####
+define constant <parser> = <function>;
define abstract class <mi-command>(<command>)
@@ -147,8 +148,8 @@
?sequence-slot;
end;
}
-
-
+
+
{ define class-for-regular mi-operation ?:name(?regular-class-options) end }
=>
{
@@ -187,7 +188,7 @@
let got :: singleton(1) = matched.size;
return(matched.head(?name ## "-<result>"));
end;
-
+
let parsers = list(?p-sequence, finish);
parsers.head(mi-reply, #(), parsers.tail);
end block;
@@ -261,7 +262,7 @@
parse-sequence:
{} => {}
{ ?parse-directive; ... } => { ?parse-directive, ... }
-
+
parse-directive:
{ resulting ?:name } => { method(inp, matched, more) => (); let m =
match(inp, "^" ?"name"); more.head(inp, pair(if (m & m.empty?) make.curry else
#f.always end if, matched), more.tail) end method }
{ resulting ?:name => ?parser:expression } => { method(inp, matched, more)
=> (); let m = match(inp, "^" ?"name"); more.head(inp, pair(if (m)
rcurry(?parser, m) else #f.always end if, matched), more.tail) end method }
@@ -276,7 +277,7 @@
{ ?flag:name ?:name } => { ?flag ?name :: <boolean>;(init-keyword:
?#"flag", init-value: #f) }
{ ?flag:name ?:name :: ?:expression } => { ?flag ?name ::
?expression;(required-init-keyword: ?#"flag") }
{ ?:name :: ?:expression } => { ?name ?name ::
?expression;(required-init-keyword: ?#"name") }
-
+
alternate:
{ } => { }
{ ?option; ... } => { [ ?option ] ... }
@@ -408,7 +409,7 @@
more.tail)
end
}
-
+
{ define class-for-tuple mi-parser ?:name(?tag:name) {?tuple-slots} end }
=>
{
@@ -425,11 +426,11 @@
define tuple-value mi-parser ?name(?tag) {?fields} {?fields} end;
define class-for-tuple mi-parser ?name(?tag) {?fields} end
}
-
+
fields:
{ } => { }
{ ?field; ... } => { ?field; ... }
-
+
field:
// optional field { [ ?:name :: ?:expression ] } => { ?name
false-or(?expression) }
{ ?:name :: ?:expression } => { ?name ?expression }
@@ -453,7 +454,7 @@
tuple-slots:
{ } => { }
- { ?tag:name ?type:expression; ... }
+ { ?tag:name ?type:expression; ... }
=>
{ slot /* ?=?"name" ## */ ?tag :: ?type, required-init-keyword: ?#"tag" }
end;
@@ -474,7 +475,7 @@
begin
let inp =
"bkpt={number=\"1\",addr=\"0x0001072c\",file=\"recursive2.c\",line=\"4\"}1234";
-
+
block (outta-here)
local method final(rest, matches, more)
let igno :: singleton(1) = matches.size;
@@ -702,55 +703,55 @@
end;
/*
-define mi-operation
+define mi-operation
end;
-define mi-operation
+define mi-operation
end;
-define mi-operation
+define mi-operation
end;
-define mi-operation
+define mi-operation
end;
-define mi-operation
+define mi-operation
end;
-define mi-operation
+define mi-operation
end;
-define mi-operation
+define mi-operation
end;
-define mi-operation
+define mi-operation
end;
-define mi-operation
+define mi-operation
end;
-define mi-operation
+define mi-operation
end;
-define mi-operation
+define mi-operation
end;
-define mi-operation
+define mi-operation
end;
-define mi-operation
+define mi-operation
end;
*/
@@ -977,8 +978,8 @@
// juxtapose -- run two parsers sequentially
// the second consuming what the first left back
//
-define function juxtapose(p1 :: <function>, p2 :: <function>, #key connective
:: <function> = list)
- => juxtaposition :: <function>;
+define function juxtapose(p1 :: <parser>, p2 :: <parser>, #key connective ::
<function> = list)
+ => juxtaposition :: <parser>;
method(inp :: <byte-string>, matched :: <list>, more) // => no-result ::
<never-returns>;
let (ign1, matched-by-p1)
= block (done-first)
@@ -1013,7 +1014,7 @@
begin
let inp =
"bkpt={number=\"1\",addr=\"0x0001072c\",file=\"recursive2.c\",line=\"4\"}bkpt={number=\"2\",addr=\"0x0001072c\",file=\"recursive2.c\",line=\"4\"}zzzzz";
-
+
block (outta-here)
local method final(rest, matches, more)
let igno :: singleton(1) = matches.size;
@@ -1030,8 +1031,8 @@
// parallel -- run two parsers side-by-side
// both consuming the same input
//
-define function parallel(p1 :: <function>, p2 :: <function>, #key connective
:: <function> = list)
- => parallel :: <function>;
+define function parallel(p1 :: <parser>, p2 :: <parser>, #key connective ::
<function> = list)
+ => parallel :: <parser>;
method(inp :: <byte-string>, matched :: <list>, more) // => no-result ::
<never-returns>;
let (ign1, matched)
@@ -1044,6 +1045,11 @@
else
let (rest1, product1) = matched.head();
let (rest2, product2) = ~matched.tail.empty? & matched.tail.head();
+
+ rest1 & rest2 & product1 & product2
+ & signal("a parallel parser matched both alternatives (%s, %s) and
delivered two results (%=, %=)",
+ rest2, rest1, product2, product1);
+
more.head(inp,
pair(method()
values(rest2 | rest1, connective(product2, product1))
@@ -1072,7 +1078,7 @@
// producing something when input has been
// consumed, #f otherwise
//
-define function optional(p :: <function>)
- => optional :: <function>;
+define function optional(p :: <parser>)
+ => optional :: <parser>;
parallel(p, epsilon, connective: identity)
end;
!DSPAM:407d1833210108593915054!
_______________________________________________
Gd-chatter mailing list
Gd-chatter@xxxxxxxxxxxxxxxx
http://www.gwydiondylan.org/mailman/listinfo/gd-chatter
|