From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=BAYES_00,FROM_ADDR_WS autolearn=no autolearn_force=no version=3.4.5-pre1 Date: 5 Feb 93 17:04:25 GMT From: cis.ohio-state.edu!news.sei.cmu.edu!firth@ucbvax.Berkeley.EDU (Robert Fi rth) Subject: Re: Help with Meridian compiler, please Message-ID: <1993Feb5.120425.19613@sei.cmu.edu> List-Id: In article eachus@dr_no.mitre.org (Robert I. Eachus) writes: > A: Natural range 0..2:=0; > > The reason Meridan trips up (and yes it is a compiler bug) is >probably that 2:1101: is a legal numeric literal (with a decimal value >of 13). I think you're right. This situation requires a two-character lookahead, which is a problem with some scanners, especially machine-generated ones. Also, unlike the almost-ambiguous 'X (attribute or character literal?), the left syntactic context is no help. The solution, of course, is to do the two-character lookahead. My own disgusting hack, on finding "2:=", is to put back just one character, a synthetic lexical token that means ":=", and then we're back in sync. Odd, though, that it should fail on the colon, having already solved the identical problem of distinguishing between a range starting "0." and a real constant starting "0.".