From: Lane S. <la...@op...> - 2003-02-13 00:44:08
|
macro invocations do not have blocks. The macro name cannot have embedded <WS>. calling: #ccBasicTransaction( $Tran, $App ) results in: calling:<FORM ACTION="https:.... note: the <WS> before the #ccBasicTransaction() is now eaten. -Lane kea...@na... wrote: > So I guess a MacroBuilder needs to have enough information to > reconstitute the original text. (This is similar to the issue of > reconstructing shredded XML documents from a database.) This means > we'd have to save references to all the <WS> or just the entire > unparsed text. Fortunately macro calls can't have blocks (right?) so > it shouldn't be too horrible -- just one line of text plus preceding > <WS> I think. But it's still a parser hack. > > Keats > > > -----Original Message----- > > From: Eric B. Ridge [mailto:eb...@tc...] > > Sent: Wednesday, February 12, 2003 5:40 PM > > To: kea...@na... > > Cc: la...@op...; br...@qu...; ma...@an...; > > web...@li... > > Subject: Re: [Webmacro-devel] Handling Dreamweaver stuff > > > > > > On Wednesday, February 12, 2003, at 05:35 PM, > > kea...@na... wrote: > > > > > This is where we enter the world of javacc which is terra > > incognito to > > > me, but AFAICT we'd need to make a "lookahead production" that > > > determines if something is indeed a directive/macro and > > then push it > > > back on the stream if it isn't. Along the way the EEH could decide > > > whether to spew, or let this stand as text. > > > > Problem is, this is a "buildtime" problem, not a "parsetime" problem. > > > > Because of the #macro business, unknown directives can't be > > determined > > until after everything has been parsed. > > > > eric > > > > > > > > Any idea how to do this? > > > > > > Keats > > > > > > > -----Original Message----- > > > > From: Eric B. Ridge [mailto:eb...@tc...] > > > > Sent: Wednesday, February 12, 2003 5:29 PM > > > > To: kea...@na... > > > > Cc: la...@op...; br...@qu...; ma...@an...; > > > > web...@li... > > > > Subject: Re: [Webmacro-devel] Handling Dreamweaver stuff > > > > > > > > > > > > On Wednesday, February 12, 2003, at 05:26 PM, > > > > kea...@na... wrote: > > > > > > > > > I guess I was a bit hasty in my post ... it appears the > > solution is > > > > > not quite as trivial as I had thought. The problem is how > > > > to recreate > > > > > the original template text after it has already been > > > > parsed, with all > > > > > the proper whitespace, etc. This seems like a parser hack, > > > > i.e., if > > > > > the MacroBuilder spews a NoSuchDirectiveException, then > > the parser > > > > > needs to push back all the whitespace and the # directive name. > > > > > > > > > > Bleck! > > > > > > > > eww, I didn't even consider the <WS> eating. Bleck! is right. > > > > > > > > Now what? > > > > > > > > eric > > > > > > > > > > > > > > Keats > > > > > > > > > > > -----Original Message----- > > > > > > From: Keats Kirsch > > > > > > Sent: Wednesday, February 12, 2003 5:10 PM > > > > > > To: 'Eric B. Ridge'; Keats Kirsch > > > > > > Cc: la...@op...; br...@qu...; ma...@an...; > > > > > > web...@li... > > > > > > Subject: RE: [Webmacro-devel] Handling Dreamweaver stuff > > > > > > > > > > > > > > > > > > You're right, I was mislead by some apparently dead code in > > > > > > the parser: > > > > > > > > > > > > throw new ParseException("No such directive #" + > > directive); > > > > > > > > > > > > Apparently, this now gets handled by the > > > > > > MacroBuilder.build(), which throws: > > > > > > > > > > > > throw new BuildException ("#" + name + ": no such > > > > > > Macro or Directive"); > > > > > > > > > > > > This should make things much simpler. > > > > > > > > > > > > So you could just say: > > > > > > > > > > > > > > bc.getEvaluationExceptionHandler().evaluate(null, bc, > > > > > > new BuildException ("#" + name + ": no such Macro > > > > > > or Directive")); > > > > > > > > > > > > This would actually fail with the DefaultEEH, as it currently > > > > > > doesn't check for a null variable arg. Easily fixed, but > > > > > > better would be to create a new PropertyException, like > > > > > > PropertyException.NoSuchDirectiveOrMacro and throw that. > > > > > > > > > > > > I could try to make these changes if you'd like. > > > > > > > > > > > > Keats > > > > > > > > > > > > > -----Original Message----- > > > > > > > From: Eric B. Ridge [mailto:eb...@tc...] > > > > > > > Sent: Wednesday, February 12, 2003 4:36 PM > > > > > > > To: kea...@na... > > > > > > > Cc: la...@op...; br...@qu...; > > ma...@an...; > > > > > > > web...@li... > > > > > > > Subject: Re: [Webmacro-devel] Handling Dreamweaver stuff > > > > > > > > > > > > > > > > > > > > > On Wednesday, February 12, 2003, at 04:01 PM, > > > > > > > kea...@na... wrote: > > > > > > > > > > > > > > > I think using the EEH would be great, but it does present > > > some > > > > > > > > challenges as Eric has pointed out. The unknown directive > > > > > > > exceptions > > > > > > > > are thrown by the parser. The parser does have a > > > > > > reference to the > > > > > > > > broker, so it should be able to get the EEH and pass > > > > > > > exceptions back > > > > > > > > to it. > > > > > > > > > > > > > > Technically, it's a BuildException, not a ParseException. > > > > > > > > > > > > > > > > > > > > > > > Unfortunately the EEH interface was designed to > > > > handle evaluation > > > > > > > > exceptions (hence the name). To handle parse > > > > exceptions we would > > > > > > > > probably want a new method in the interface (like > > > > > > "parse()"). This > > > > > > > > would require a change in all existing EEH > > implementations. > > > > > > > Probably > > > > > > > > not a huge problem, but something to consider. > > > > > > > > > > > > > > > > Also the name wouldn't be quite appropriate if we expand > > > > > > > the scope of > > > > > > > > this. It should probably be just ExceptionHandler or > > > > > > > > WMExceptionHandler. Maybe an o.w.ExceptionHandler > > > > > > interface could > > > > > > > > extend EvaluationExceptionHandler and add the new method. > > > > > > > Then if you > > > > > > > > configure an ExceptionHandler, it would automatically set > > > > > > > the EEH as > > > > > > > > well. This should preserve backwards compatability. > > > > > > > > > > > > > > I don't think we'll need to change the interface for > > > > EEH. But we > > > > > > > could/should change the name... > > > > > > > > > > > > > > > > > > > > > > > In any case, someone would need to tweek the parser -- and > > > > > > > I know of > > > > > > > > only two candidates ... > > > > > > > > > > > > > > The parser won't need to be touched. I don't believe. > > > > > > > > > > > > > > > > > > > > > > > Keats > > > > > > > > > > > > > > > > > -----Original Message----- > > > > > > > > > From: Eric B. Ridge [mailto:eb...@tc...] > > > > > > > > > Sent: Tuesday, February 11, 2003 8:05 PM > > > > > > > > > To: la...@op... > > > > > > > > > Cc: Brian Goetz; ma...@an...; > > > > > > > > > web...@li... > > > > > > > > > Subject: Re: [Webmacro-devel] Handling Dreamweaver stuff > > > > > > > > > > > > > > > > > > > > > > > > > > > On Tuesday, February 11, 2003, at 04:12 PM, > > Lane Sharman > > > > > wrote: > > > > > > > > > > > > > > > > > > > ebr: > > > > > > > > > > > > > > > > > > > > Can you make a stab at modifying eeh so that > > we can try > > > > > > > this out? > > > > > > > > > > > > > > > > > > I can, yes... when I find the time. > > > > > > > > > > > > > > > > > > The issue here is that EEH is used as a "runtime" > > > > thing, not a > > > > > > > > > "buildtime" thing, so I'm not sure how it will > > > > interact with > > > > > the > > > > > > > > > BuildContext (if it all). > > > > > > > > > > > > > > > > > > Assuming I can work that out, I guess we want: > > > > > > > > > CrankyEEH to *always* throw on #unknown directives > > > > > > > > > DefaultEEH to *always* pass #unknown > > directives to > > > the > > > > > > > > > stream as > > > > > > > > > string literals > > > > > > > > > MarcEEH to do whatever Marc wants, to be > > > > > > > written by him. > > > > > > > > :) > > > > > > > > > > > > > > > > > > eric > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -l > > > > > > > > > > > > > > > > > > > > Eric B. Ridge wrote: > > > > > > > > > > > > > > > > > > > >> On Tuesday, February 11, 2003, at 03:35 PM, Brian > > > > > > Goetz wrote: > > > > > > > > > >> > > > > > > > > > >>>> This problem is elegantly solved thru the > > > > introduction of > > > > > a > > > > > > > > > >>>> property, > > > > > > > > > >>>> StrictDirectiveTypeChecking. Invariably, > > there will be > > > > > > > > > times when > > > > > > > > > >>>> you > > > > > > > > > >>>> cannot "include as text" a DW file because you will > > > > > > > want to add > > > > > > > > > >>>> some WM > > > > > > > > > >>>> var reference to it! > > > > > > > > > >>> > > > > > > > > > >>> > > > > > > > > > >>> I'd rather see "strict directive checking" > > > > rolled in with > > > > > > > > > other forms > > > > > > > > > >>> of strict checking (like the Cranky EEH), > > rather than > > > > > > > have seven > > > > > > > > > >>> different > > > > > > > > > >>> things a user would have to do to get > > strict checking. > > > > > > > > > >> > > > > > > > > > >> > > > > > > > > > >> Better yet (maybe), roll this thing through EEH... if > > > > > > > that's even > > > > > > > > > >> possible. > > > > > > > > > >> > > > > > > > > > >> eric > > > > > > > > > >> > > > > > > > > > >> > > > > > > > > > >> > > > > > > > > > >> > > ------------------------------------------------------- > > > > > > > > > >> This SF.NET email is sponsored by: > > > > > > > > > >> SourceForge Enterprise Edition + IBM + LinuxWorld = > > > > > > > > > Something 2 See! > > > > > > > > > >> http://www.vasoftware.com > > > > > > > > > >> _______________________________________________ > > > > > > > > > >> Webmacro-devel mailing list > > > > > > > > > >> Web...@li... > > > > > > > > > >> > > > > https://lists.sourceforge.net/lists/listinfo/webmacro-devel > > > > > > > > > >> > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > > Lane Sharman > > > > > > > > > > http://opendoors.com Conga, GoodTimes and Application > > > > > > > > > Hosting Services > > > > > > > > > > http://opendoors.com/lane.pdf BIO > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > > > > > > > This SF.NET email is sponsored by: > > > > > > > > > > SourceForge Enterprise Edition + IBM + LinuxWorld = > > > > > > Something 2 > > > > > > > > See! > > > > > > > > > > http://www.vasoftware.com > > > > > > > > > > _______________________________________________ > > > > > > > > > > Webmacro-devel mailing list > > > > > > > > > > Web...@li... > > > > > > > > > > > > > > https://lists.sourceforge.net/lists/listinfo/webmacro-devel > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > > > > > > This SF.NET email is sponsored by: > > > > > > > > > SourceForge Enterprise Edition + IBM + LinuxWorld = > > > > > > > Something 2 See! > > > > > > > > > http://www.vasoftware.com > > > > > > > > > _______________________________________________ > > > > > > > > > Webmacro-devel mailing list > > > > > > > > > Web...@li... > > > > > > > > > > https://lists.sourceforge.net/lists/listinfo/webmacro-devel > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- Lane Sharman http://opendoors.com Conga, GoodTimes and Application Hosting Services http://opendoors.com/lane.pdf BIO |