About 'NOTES' in ASCEND

The parser will now parse a NOTES block as well as in-lined NOTES. As a matter of fact, the parser would probably parse FORTRAN now since it is very lenient. For the in-lined NOTES, I accept any "doubly-quoted" string after an `fname'. I am currently dropping the NOTE on the floor. Ideally, we should only accept an inline NOTE when we are creating a new thing, like in an IS_A statement or a labeled relation. That means either adding the optional_note to fname and whining at the user when he/she uses the in-lined notes incorrectly, or coming up with a fvarnotelist and fnamenote that accepts fnames and optional_notes in a list or a stand-alone form.

For the block NOTES statement, the symtax is

NOTES ( SYMBOL_TOK ( fvarlist BRACEDTEXT_TOK )+ )+ END NOTES ';'

Here I am using () as part of the meta-language to describe the syntax to you, they are not part of the formal grammer. An example is

NOTES 'text' a,b,c { Here is some text } d { Here is more text } 'html' SELF { <bold>html sucks</bold> } END NOTES;

Note that the only punctuation is the `,' between the members of the fvarlist and the closing `;'. Right now, the term `SELF' would be eaten in the fvarlist production. I'm not sure if this is what we should do (which requires having the notes processing do something special when it sees SELF in the fvarlist), or if we should create a SELF_TOK token. The latter is certainly easier to implement from the parser's perspective, which is why I did it that way.

The block NOTES statement doesn't do anything with its stuff either, the symbols and {bracedText} get dropped on the floor and I destroy the fvarlist, but that all that happens.

The `notes_body' and `noteslist' productions return `notes_ptr', which right now is a `void*' until we can decide what type of data structure we want to handle NOTES.

As an amusing side note, the parser will currently eat the following:

NOTES 'fun' name "put some text here" {put more text here} END NOTES;

Like I said, this is so the parser will eat them; it's not being real smart about what it does with them.

For debugging the NOTES stuff, set the DEBUG_NOTES macro to the following:

define DEBUG_NOTES(s) FPRINTF(stderr,"****DISCARDED NOTES:\n%s****\n",(s))

To completely ignore the NOTES, set DEBUG_NOTES to the following:

define DEBUG_NOTES(s) 0

Note that if you do the latter, you'll get `statement with no effect' warnings from gcc -Wall.

-- Mark Thomas Thursday, 13 March 1997


Generated on Thu Jul 17 04:00:54 2008 for libascend by  doxygen 1.5.1