Path: utzoo!utgpu!attcan!uunet!seismo!sundc!pitstop!sun!decwrl!labrea!rutgers!njin!princeton!phoenix!haahr From: haahr@phoenix.Princeton.EDU (Paul Gluckauf Haahr) Newsgroups: comp.lang.misc Subject: Re: Dumb Lexical Analyzers are Smart Message-ID: <3723@phoenix.Princeton.EDU> Date: 21 Sep 88 21:06:07 GMT References: <5200026@m.cs.uiuc.edu> Reply-To: haahr@princeton.edu (Paul Gluckauf Haahr) Organization: Princeton University, Princeton NJ Lines: 20 in article <5200026@m.cs.uiuc.edu> wsmith@m.cs.uiuc.edu writes: > What I would like to do in a new language is make the lexical analyzer > have more lexical categories. For example, TypeIdentifier and > variableidentifier would be lexically different because the first has > an initial uppercase letter while the second doesn't. If other > categories of identifiers are needed, they may be defined to be > identifiers-with-a-minus-sign or under_scored or Under_Scored each > could belong to a different category if there was a valid semantic > reason to distinguish between them. a suggestion: how about reserving all identifiers that start with i through n (the first two letters of "integer") for integers, and assuming all other identifiers are real. that way, a compiler would not have to put information about the type in the symbol table, it could just look at the first character, and we can do away with declarations. i believe there was once a programming language that did this :-) paul (princeton!haahr)