Path: news.daimi.aau.dk!not-for-mail From: Jorg Schneider Newsgroups: comp.lang.beta Subject: Parsing Beta Programs Date: Mon, 17 Feb 1997 12:09:05 +0100 Organization: DAIMI, Computer Science Dept. at Aarhus University Lines: 36 Message-ID: <33083C51.4DF0@daimi.aau.dk> NNTP-Posting-Host: humulus.daimi.aau.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.0 (X11; I; SunOS 5.5.1 sun4u) CC: daimi.beta Xref: news.daimi.aau.dk comp.lang.beta:10967 How do I parse (extended) beta programs in text format? The problem is that the the fragment language(?) is part of the beta source file, defining origin and includes and other properties. The parser, generated by the mps, is not able to parse these properties. How do I get the source code parsed anyway? The property information is needed, but also available in the parsed ast. Another problem I had, was to establish links between namedecl-nodes and nameappl-nodes with the 'addusage' method, which results in a runtime error, with the message, that some reference is NONE. However, none of the references I provided was NONE. What goes wrong? Since the documentation of the mps not goes very much into details, I would appreciate a confirmation of my idea of how to use the attributes in the attribute-part of a grammar specification. The way I see it, this part allows to provide ast-nodes with additional attributes, that otherwise would need to be edited manually in the patterns of the cfl of the language (and lost at the next recompilation). However, these attributes do not have names, but are accessed by an index with one of the following methods in the ast interface: putAttribute, getAttribute putNodeAttribute, getNodeAttribute putSlotAttribute, getSlotAttribute putSlotNodeAttribute, getSlotNodeAttribute Hoping you can help me -- Jorg ------------------------------------------------------------------- / Jorg Schneider, Computer Science Department, Aarhus University / / Ny Munkegade 116, Bld. 540, DK-8000 Aarhus C, DENMARK / / Email: josch@daimi.aau.dk / / WWW: http://www.daimi.aau.dk/~josch / -------------------------------------------------------------------