1changes31(3) ANTLR3C changes31(3)
2
3
4
6 changes31 - .TH "changes31" 3 "Wed Oct 13 2010" "Version 3.1.2"
7 "ANTLR3C"
8
10 changes31 - The following changes have taken place from 3.0 to 3.1.
11
12 Some of them may require minor changes to your grammar files or the
13 programs that invoke your grammar. Please take the time to read through
14 this list as it may save you time later.
15
17 In previous releases the return value from both the generated
18 constructors and built in constructor functions would return a value of
19 -1 or -2 if a problem occurred. However, the only problem that can
20 really occur is lack of memory, hence to avoid the remote change that
21 some memory allocation scheme would return an address of -1 for a
22 pointer, the return address is now NULL if there was no memory
23 available. The old macros for this mechanism have been removed which
24 will force you to read this information. You now need only check the
25 return address for NULL, or you could not bother doing that and join
26 with 95% of the world's C code.
27
29 The 3.1 runtime now supports tree rewrites from tree parsers. See the
30 main ANTLR documentation for more details. This beta version contains
31 Known Issues regarding the release of mmeory allocated to tree nodes
32 when they are rewritten in some combinations of re-writing tree
33 parsers. These issues will be corrected before release.
34
36 The ANTLRWorks debugger is now fully supported by this version of the
37 runtime. It supports remote debugging only (you cannot generate C,
38 compile and debug it from the ANTLRWorks IDE.) However both parser and
39 tree parser debugging is supported providing you are using a version of
40 ANTLRWorks that supports tree parser debugging. Generate the C code
41 with the -debug option of the ANTLR tool, as per any other target.
42
43 Note that when you invoke your debugging version of the parser, it will
44 appear to hang but is in fact waiting on a local TCP socket connection
45 from the ANTLRWorks debugger. As the target environment is unknown, it
46 is not prudent to generate notification status messages using something
47 like printf, as the target environment may not have a console or
48 implement printf.
49
51 Prior to the 3.1 release, accessing the token source of a lexer
52 required knowledge of where the token source pointer was located wihtin
53 the lexer. In 3.1, the token source was burried further in the innards
54 of the C runtime and such knowledge is considerd irreleavant and
55 confusing. Hence, when creating a token stream from a token source, it
56 is now mandatory to use the new C macro TOKENSOURCE(lxr), which will
57 expand to point at the token source interface. This MACRO will be
58 maintained across future versions. You can see how to use it in the
59 downloadable examples, avaiable from the downloads page of the ANTLR
60 web site. Here is the relevant code for creating a token stream,
61 extracted from those examples:
62
63 tstream = antlr3CommonTokenStreamSourceNew(ANTLR3_SIZE_HINT, TOKENSOURCE(lxr));
64
65Version 3.1.2 Wed Oct 13 2010 changes31(3)