27 March 2000 Release 2.22 Notes for New Users of PCCTS Version 1.33MR22
5
#186. Use
ANTLR
s or
ANTLR
f in line-oriented languages to control the prefetching of characters and tokens
43
#187. Saving and restoring parser state in order to parse other objects (input files)
43
(C Mode) Attributes
#188. Use symbolic tags (rather than numbers) to refer to attributes and ASTs in rules
44
#189. Rules no longer have attributes:
rule : r1:rule1 <<...$r1...;>>
won't work
44
#190. Attributes are built automatically only for terminals
44
#191. How to access the text or token part of an attribute
44
#192. The $0 and $$ constructs are no longer supported - use inheritance instead (Item #113)
­
#193. If you use attributes then define a zzd_attr() to release resources (memory) when an attribute is destroyed
­
#194. Don't pass automatically constructed attributes to an outer rule or sibling rule - they'll be out of scope
44
#195. A charptr.c attribute must be copied before being passed to a calling rule
44
#196. Attributes created in a rule should be assumed
not
valid on entry to a fail action
45
#197. Use a fail action to destroy temporary attributes when a rule fails
45
#198. When you need more information for a token than just token type, text, and line number
45
#199. About the pipeline between
DLG
and
ANTLR
(C mode)
45
(C Mode) ASTs
#200. Define a zzd_ast() to recover resources when an AST is deleted
­
#201. How to place prototypes for routines using ASTs in the #header
46
#202. To free an AST tree use zzfree_ast() to recursively descend the AST tree and free all sub-trees
46
#203. Use #define zzAST_DOUBLE to add support for doubly linked ASTs
46
Extended Examples and Short Descriptions of Distributed Source Code
#1.
DLG
definitions for C and C++ comments, character literals, and string literals
46
#2.
A simple floating point calculator implemented using
PCCTS
attributes and inheritance
46
#3.
A simple floating point calculator implemented using
PCCTS
ASTs and C++ virtual functions
46
#4.
An
ANTLR
Token class for variable length strings allocated from the heap
46
#5.
How to extend
PCCTS
C++ classes using the example of adding column information
46
#6.
Use of parser exception handling in C and C++ programs
46
#7.
How to pass whitespace through
DLG
for pretty-printers
47
#8.
How to prepend a newline to the
DLG
InputStream via derivation from
DLG
Lexer
47
#9.
How to maintain a stack of #lexclass modes
47
#10. When you want to change the token type just before passing the token to the parser
47
#11. Rewriting a grammar to remove left recursion and perform left factoring
47
#12. Processing counted strings in
DLG
48
#13. How to convert a failed validation predicate into a signal for treatment by parser exception handling
49
#14. How to use Vern Paxson's flex with
PCCTS
in C++ mode by inheritance from
ANTLR
TokenStream
49
#15. Using the GNU gperf (generate perfect hashing function) with
PCCTS
49
#16. Multiple files managed as a single token stream
49