You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Jason van Zyl <jv...@periapt.com> on 2000/08/31 14:39:07 UTC

Queries about WM Introspection engine

Hi,

I've just finished overhauling the parser once again. I'm off
to bed but before I go here's a few notes.

Here are a couple of examples of what the parser does. What
I would like to be able to do is feed the list of
Identifiers and StringLiterals directly into the WM
Introspection engine:


$this.Person.Is.There.To.get($this,$that,$the,$the.Other,"way")

Reference
 Identifier -> this
 Identifier -> Person
 Identifier -> Is
 Identifier -> There
 Identifier -> To
 Identifier -> get
 Parameters
  Parameter
   Reference
    Identifier -> this
  Parameter
   Reference
    Identifier -> that
  Parameter
   Reference
    Identifier -> the
  Parameter
   Reference
    Identifier -> the
    Identifier -> Other
  Parameter
   StringLiteral -> "way"

$link.setPage("ScarabLogout.wm").setAction("LogoutUser")

Reference
 Identifier -> link
 Identifier -> setPage
 Parameters
  Parameter
   StringLiteral -> "ScarabLogout.wm"
 Identifier -> setAction
 Parameters
  Parameter
   StringLiteral -> "LogoutUser"

You can use any combination of properties, methods.
Parameters to methods can be variables, properties, methods
and string literals. It can all be nested. I believe
the WM Intro engine can deal with this.

I'm ready to feed the intro engine value. So if a
change has to be made I'd just like to figure out
whether it would easier/more efficient to massage
the data while it's being parsed or slightly
change the signature of the intro engine to take
the output from the parser. This might be more
useful given it's super PITA writing parsers, and
all recursive-decent parsers will produce output
similiar to the above. Then we could play around
with other compiler-compilers like Antlr or
SableCC. Hopefully some JavaCC people will step
forward. I'd really like to bounce some ideas
of someone :)

jvz.

-- 

Jason van Zyl
jvanzyl@periapt.com


Re: Queries about WM Introspection engine

Posted by Jason van Zyl <jv...@periapt.com>.
Hi,

Here's a cleaner version. I suppressed the creation
of the Parameters node, and the Parameter(). I'm looking
for a way to suppress the Reference nodes inside a Reference
so that I can get a straight list i.e. something like

Reference
 Identifier
 Identifier
 Identifer
 .
 .
 .
 Identifier

There's a way. I'm just looking :) Then it can be
straight fed into the introspection engine. My
the intro engine could just take a node and
walk it instead of taking an array of objects.

Just thinking out loud.

Anyway here's a cleaned up version:


$this.Person.Is.There.To.get($this,$that,$the,$the.Other,"way")

Reference
 Identifier -> this
 Identifier -> Person
 Identifier -> Is
 Identifier -> There
 Identifier -> To
 Identifier -> get
 Reference
  Identifier -> this
 Reference
  Identifier -> that
 Reference
  Identifier -> the
 Reference
  Identifier -> the
  Identifier -> Other
 StringLiteral -> "way"


$link.setPage("ScarabLogout.wm").setAction("LogoutUser")

Reference
 Identifier -> link
 Identifier -> setPage
 StringLiteral -> "ScarabLogout.wm"
 Identifier -> setAction
 StringLiteral -> "LogoutUser"


jvz.

-- 

Jason van Zyl
jvanzyl@periapt.com