Hi all
I've found a number of interesting discussion about functions
User defined functions within the grammer
http://groups.google.com/group/comp.compilers.tools.javacc/browse_thread/thread/d66f4e0d1a6703a7/af249d6a7c2564b8?lnk=gst&q=functions#af249d6a7c2564b8
"Dynamic" tokens and definitions
http://groups.google.com/group/comp.compilers.tools.javacc/browse_thread/thread/e81eb26a1cbbc051/4dff7a79d43c6de6?lnk=gst&q=function+signature#4dff7a79d43c6de6
The
void Arguments() :
void PrimaryPrefix() :
void PrimarySuffix():
along with the
void MethodDeclaration() :
productions for the well known Java javacc grammar (see
javacc-4.0\examples
\JavaGrammars\Java1.0.2LS.jj) are useful to understand how to deal
with the issue working with a general approach (signature based)
approach (pattern).
I state in advance that the language has a limited number of builtin
functions (less than 20 functions, with simple and similar
signatures). The system will grant to the end programmers (clients) to
extend the language by defining some Java class implementing their own
functions to be used as factors and terms in the expressions.
This is not yet a technical specific issue but, instead, an
architectural one.
Do you have any hint about how to face this issue?
I am a javacc beginner yet and I have no idea about how to face the
problem in a pretty good way (I mean good in terms of software
engineering).
In other words I do not know if there is a "function pattern" for
JavaCC grammars or, better,
some patterns as
"built in function pattern" or
"general functin pattern based on signature" (besides the one found in
the Java grammas, see above) for javaCC.
On the other hand I guess that only few engineers whic dedigned
interpreters and compilers had already studied and solved the issue in
the past... ;) I would like not to reinvent the whell, if possible.
Any do***entation about this issue?
Any less or more experienced opinion about the issue?
Any suggestion will be appreciated.
Thanks in advance.
ciao
Cesare