|
From: Roger H. <rog...@mi...> - 2007-05-14 18:15:00
|
On 14 May, 2007, at 17:23, James W. Walker wrote: > On May 14, 2007, at 2:21 AM, Roger Holmes wrote: > >> >> On 14 May, 2007, at 00:32, James W. Walker wrote: >> >>> >>> On May 12, 2007, at 9:10 AM, Stefan Huber wrote: >>> >>>> Please ignore the previous mail. So once again... >>>> >>>> "Apple Computer, Inc.:NameElement" and "Apple Computer, Inc.: >>>> URLElement" are not very parser friendly. >>>> >>>> The problem is in E3FFR_3DMF_Text.c/ >>>> e3fformat_3dmf_text_readobjecttype. >>>> E3FileFormat_GenericReadText_ReadUntilChars with argument blank = >>>> true cannot read object types with blanks in their name. So the >>>> parser tries to handle an object "Apple" and runs into trouble. >>> >>> I wish Apple had published a formal grammar for ASCII 3DMF. It is >>> not clear to me how the parser is supposed to know where an object >>> type ends, or how to tell the difference between a label and an >>> object type. >> >> I agree. But here, can't we just read everything up to the colon? > > That takes you to the middle of the name element object type. Then > what? From the only two samples so far mentioned, the spaces are only in the first part of the name element object type. The rest is a normal identifier terminated by white space or any non alpha-numeric character. > It appears that in a label, the colon should always be > followed by a line break. So, if it's not followed by a line break, > we continue reading up to the open parenthesis? A parser or any lexical analyser does not need to apply the same rules to a symbol in all circumstances. A label can have different rules to a name element object type. Any compiler can treat a colon in a comment differently from a colon in a statement. |