Related articles |
---|
Javacc& JTree Jacek.Skrzypiec@sybernet.ie (Jacek skrzypiec) (1998-11-06) |
Javacc& JTree KPRASAD@us.oracle.com (KPRASAD.US.ORACLE.COM) (1998-11-07) |
Re: Javacc& JTree janusz.szpilewski@alcatel.pl (Janusz Szpilewski) (1998-11-12) |
From: | Janusz Szpilewski <janusz.szpilewski@alcatel.pl> |
Newsgroups: | comp.compilers |
Date: | 12 Nov 1998 01:32:15 -0500 |
Organization: | Alcatel Polska |
References: | 98-11-048 |
Keywords: | Java, tools |
Jacek skrzypiec wrote:
>
> I would be interested in exchanging the views with
> somebody who has worked with the Javacc.
>
There is a mailing list dedicated to JavaCC. Try to find its address,
JavaCC FAQ and other useful info at the JavaCC page:
http://www.suntest.com/JavaCC
> By the way, I am looking for information on representing classes in
> symbol tables, records are represented usually as a tuple consisting
> of an enumerated value representing its constructor (e.g. record) the
> numbers of fields and a sequence of pairs comprising representations
> of the field identifiers.
You can still maintain relations with class methods and internal
classes using general parent-children relations. It means in the class
representation provide containers with pointers to the definitions of
the scoped classes and methods. The inner entities can also (and usually
should) keep pointers to their parents. This is simple and efficient
enough to deal with scope, inheritance and any embedding.
So consider such example (in C++):
class MyClassDescription : public ClassDescription
{
// class name
String className;
// parent (scope) of the class
ScopeOwnerDescription* parent;
// pointer to the base class definition
// (or a list in the case of multiple inheritence)
ClassDescription* baseClass;
ConstructorDescription* constructors;
DestructorDescription* destructors;
MethodDescription* methods; // class methods
AttributeDescription* attributes; // class attributes
ClassDescription* innerClasses; // embedded classes
[...] // constructor, destructor and find/get/set
// related methods
};
ClassDescription, AttributeDescription etc. are abstract classes
(interfaces) representing given elements.
I hope it will clear the problem a little... Try also to check compiler
related references published on this newsgroup.
Greetings,
Janusz Szpilewski
Return to the
comp.compilers page.
Search the
comp.compilers archives again.