[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CENTAUR
=> Is it a way to access to the "comment" parts of an abstract syntax tree? they
=> appear as {^comment_s[comment ... , comment ... , ...]} using the default
=> prettyprinter.
Comments are implemented as annotations, whose value class is {tree}, and name
is either prefix or postfix (this is decided by the tree builder, depending on
whether the comment is before or after the commented expression in the parsed
program).
To access a comment, you should call the {tree}:down function on the parent
tree, with a move parameter equal to either 'prefix or 'postfix.
Annotations are documented in the core/ Vtp manual.
=> I would like to implement message system using the comments
=> allowed in my formalism...
=>
You can do that (this has the advantage of letting an annotated program be
parsed with a standard parser, and displayed with the standard pretty
printer). You may also find useful to create other kinds of annotations to
carry specific information.
Vincent Prunet