Re: How to in Python

2007-12-22 Thread MartinRinehart
Chris Mellon wrote: > You don't seem to be implementing the > lexer in Python I am absolutely implementing my language in Python, a language I have now been writing for two entire weeks. This list has been more than helpful, tolerating numerous newbie questions. -- http://mail.python.org/mailma

Re: How to in Python

2007-12-21 Thread Chris Mellon
On Dec 21, 2007 1:02 PM, <[EMAIL PROTECTED]> wrote: > > > Chris Mellon wrote: > > Is there some reason that you think Python is incapable of > > implementing lexers that do this, just because Python lexer accepts > > it? > > Absolutely not. My opinion is that it's a bug. A very, very minor bug, >

Re: How to in Python

2007-12-21 Thread MartinRinehart
Chris Mellon wrote: > Is there some reason that you think Python is incapable of > implementing lexers that do this, just because Python lexer accepts > it? Absolutely not. My opinion is that it's a bug. A very, very minor bug, but still six-legged. > Note that if you're using your lexer to mar

Re: How to in Python

2007-12-21 Thread Chris Mellon
On Dec 21, 2007 7:25 AM, <[EMAIL PROTECTED]> wrote: > > > John Machin wrote: > > Use a proper lexer written by somebody who knows what they are doing, > > as has already been recommended to you. > > My lexer returns a MALFORMED_NUMBER token on '0x' or '0x '. Try that > in Python. > Is there some

Re: How to in Python

2007-12-21 Thread MartinRinehart
If I get to add multi-line strings today, I'll have a complete tokenizer. Interior looks a lot like C minus semi-colons. (Though I did figure out that there wasn't any need for tokens that didn't come from a real to have a doubleValue field. In C++ or Java all the Tokens had a doubleValue, because

Re: How to in Python

2007-12-21 Thread MartinRinehart
Gabriel Genellina wrote: > Do you have to validate input based on that grammar? I've built a standalone tokenizer. It returns an array of Token objects. These include tokens such as UNCLOSED_QUOTE and MALFORMED_NUMBER ('1E' not followed by sign or digit, for instance). You could use this in a c

Re: How to in Python

2007-12-21 Thread MartinRinehart
John Machin wrote: > Use a proper lexer written by somebody who knows what they are doing, > as has already been recommended to you. My lexer returns a MALFORMED_NUMBER token on '0x' or '0x '. Try that in Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to in Python

2007-12-19 Thread John Machin
On Dec 20, 4:02 am, [EMAIL PROTECTED] wrote: > I've got a pointer to a position in a line of code that contains > either a digit or a period (decimal point). I've got this comment: > > Numbers are one of these: > integers: > digit+ >

Re: How to in Python

2007-12-19 Thread Gabriel Genellina
En Wed, 19 Dec 2007 14:02:00 -0300, <[EMAIL PROTECTED]> escribi�: > I've got a pointer to a position in a line of code that contains > either a digit or a period (decimal point). I've got this comment: > > Numbers are one of these: > integers: > digi

How to in Python

2007-12-19 Thread MartinRinehart
I've got a pointer to a position in a line of code that contains either a digit or a period (decimal point). I've got this comment: Numbers are one of these: integers: digit+ 0xhex_digit+ decimals: