close-group tokens and error messages

Mike Austin <>
Thu, 18 Dec 2008 22:23:32 -0800

          From comp.compilers

Related articles
close-group tokens and error messages (Mike Austin) (2008-12-18)
| List of all articles for this month |

From: Mike Austin <>
Newsgroups: comp.compilers
Date: Thu, 18 Dec 2008 22:23:32 -0800
Organization: at&t
Keywords: smalltalk, parse, question
Posted-Date: 19 Dec 2008 05:33:12 EST

Hi all, and pre-happy-holidays :) I've got a question about
close-group tokens and error messages. If anybody has thoughts on the
subject I'd appreciate the help. Say you have the following *invalid*
Smalltalk expression:

(5 sin 10)

I'd like to print an error message if something other than an
identifier or operator is found after a message ("sin" in this case).
Close-paren is also not valid, but not an error either - it simply
exits the recursive message parsing function.

Testing for close-paren doesn't seem like the right thing to do, since
there may be other types of grouping tokens such as [], {}, etc. I
could test for literals, but testing something for *not* being there
seems odd, and there may be other tokens that are not valid.

Any insights?

Thanks much,

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.