chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] how should I handle callbacks into eggs?


From: Alan Post
Subject: [Chicken-users] how should I handle callbacks into eggs?
Date: Sun, 5 Dec 2010 19:42:32 -0700

In the PEG grammar recognized by genturfa'i, I can associate code
with rules:

grammar <- a / b
a <- "a" {procedure-a}
b <- "b" {procedure-b}

|procedure-a| will be called if the input is "a", and |procedure-b|
will be called if the input is "b".

In jbogenturfa'i, I keep the grammar in a separate library called
jbogerna.  This egg also has an executable program called
jbogenturfahi.  The dependency graph looks like this:

jbogenturfahi(cmd)       # the executable parser
 `-> jbogenturfahi(lib)  # the support code for the executable parser
  `-> jbogerna(lib)      # the grammar we try to parse

jbogenturfahi the executable command uses the library jbogenturfahi
which uses the library jbogerna.  I'm going to add a library to this
dependency for the code executed after a successful parse:

jbogenturfahi(cmd)       # ...same
 `-> jbogenturfahi(lib)  # ...same
  `-> jbogerna(lib)      # ...same
   `-> jbosamselpla(lib) # the code executed on the parse tree

I understand how to do everything up to this point.  I also want to
add another executable for dealing specifically with the morphology
portion of the Lojban grammar, and for that executable I want to
have different code executed after a successful parse.  My
dependency tree for this command looks like this:

jborafsketurfahi(cmd)          # different command
 `-> jbogenturfahi(lib)        # ...same
  `-> jbogerna(lib)            # ...same
   `-> jborafskesamselpla(lib) # different library

I'm not sure how to compile jbogerna and mark all of the symbols
called by jbogerna but present in either of jbosamselpla or
jborafskesamselpla as procedures that I promise will be available
at runtime.

How do I tell jbogerna that it is making a bunch of procedure calls
that it won't be able to resolve at compile-time, so I can specify
the actual library having those calls at that point?

-Alan
-- 
.i ko djuno fi le do sevzi



reply via email to

[Prev in Thread] Current Thread [Next in Thread]