To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.off-topic.geekOpen lugnet.off-topic.geek in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Off-Topic / Geek / 160
159  |  161
Subject: 
"Well-Formed" LDraw (Was: regular expressions for DAT file subpart lines)
Newsgroups: 
lugnet.off-topic.geek, lugnet.cad.dev
Date: 
Wed, 23 Jun 1999 22:09:53 GMT
Reply-To: 
JSPROAT@GEOCITIESspamcake.COM
Viewed: 
867 times
  
Steve Bliss wrote:
Oops, I forgot a few other odd things.  I *think* your expression allows
these, but I'm not sure:
.1
Nope, won't take a fraction w/o the integer part; gotta fix that

-.1
Nope, same reason as above

0.
Nope, won't take a fraction w/o the fraction part, gotta fix that

-0.
Nope, same reason as above

001
Yep!  Woo-Hoo!!!  :-,

1E
Nope, I can't even figure out what this is supposed to be without the
mantissa!  Is it just 1?

The hard part about using a single regular expression to detect scientific
notation is that it might allow things like "+.E." to represent a number,
which any respectable atoi() would choke on.  I gotta think about this some
more, see if it's even worth my time at the moment...

BTW, the color-code can be in scientific notation.  The line-type can't, at
least, it can't in LDLite.  I'm betting LDraw would recognize 1E0 as a
valid line-type.

Hmmm...  But LEdit doesn't output scientific notation in these areas.  I'm
inclined to be more liberal than restrictive, but some of these cases don't
make any sense; i.e. fractional colors.

What about line-breaks?  LDraw allows those in the middle of the line.  And
anything extra after the filename is ignored, I think.  At least, on
line-types 2 through 5, anything after the last parameter and before a line
break is ignored.

Arg.  Broken lines would obviate a line-based parser.  Pascal parsers tend
to be character-based, while Perl makes it much easier to write line-based
parsers.

I wonder if we should start to differentiate between "valid" and
"well-formed" LDraw files, a la XML...?

Cheers,
- jsproat

--
Jeremy H. Sproat <jsproat@geocities.com>
http://www.geocities.com/SiliconValley/Horizon/5249/
Darth Sideous the wicked ruled his world -- Sidious spoke in class today



Message has 1 Reply:
  Re: "Well-Formed" LDraw (Was: regular expressions for DAT file subpart lines)
 
(...) Both of the above are common output from LDAO code. (...) Well, I was just throwing stuff out. I don't know if LDraw would take that one, or not. (...) Darned context-sensitive constructions. (...) I didn't say they made sense. Just that they (...) (25 years ago, 24-Jun-99, to lugnet.off-topic.geek, lugnet.cad.dev)

Message is in Reply To:
  Re: regular expressions for DAT file subpart lines
 
Oops, I forgot a few other odd things. I *think* your expression allows these, but I'm not sure: .1 -.1 0. -0. 001 1E BTW, the color-code can be in scientific notation. The line-type can't, at least, it can't in LDLite. I'm betting LDraw would (...) (25 years ago, 23-Jun-99, to lugnet.off-topic.geek)

9 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR