caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* GenerateFold
@ 2007-05-31 12:18 Joel Reymont
  2007-05-31 15:29 ` GenerateFold Nicolas Pouillard
  0 siblings, 1 reply; 13+ messages in thread
From: Joel Reymont @ 2007-05-31 12:18 UTC (permalink / raw)
  To: OCaml List; +Cc: Nicolas Pouillard

What is the proper use of GenerateFold here?

What I'm trying to do is dig into my AST tree, starting with a list  
of statements at the top, to find out if I have any `FunArgDecl bits.

At the top of the AST I have

statement =
     [
     | `InputDecls of input_decl list
     ]

and then

input_decl =
     [
     | `InputDecl of id * ty * expr
     | `FunArgDecl of id * ty * subscript
     ]

I tried the following approach but it's obviously wrong.

class fold = Camlp4Filters.GenerateFold.generated;;

let is_fun_arg = object
   inherit fold as super
   method input_decl x =
     match super#input_decl x with
       | `FunArgDecl _ -> true
       | _             -> false
end

let is_fun x = is_fun_arg#statement x;;

	Thanks, Joel

--
http://topdog.cc      - EasyLanguage to C# translator
http://wagerlabs.com  - Blog






^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-06-05 12:25 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-31 12:18 GenerateFold Joel Reymont
2007-05-31 15:29 ` GenerateFold Nicolas Pouillard
2007-05-31 17:41   ` GenerateFold Joel Reymont
2007-05-31 18:58   ` GenerateFold Joel Reymont
2007-05-31 22:05     ` GenerateFold Nicolas Pouillard
2007-05-31 22:16       ` GenerateFold Joel Reymont
2007-05-31 22:34       ` GenerateFold Joel Reymont
2007-06-01  6:08         ` [Caml-list] GenerateFold Edgar Friendly
2007-06-01 13:22           ` Joel Reymont
2007-06-01 13:30             ` Nicolas Pouillard
2007-06-01 13:44               ` Joel Reymont
2007-06-01 16:07                 ` Nicolas Pouillard
2007-06-05 12:25                   ` Nicolas Pouillard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).