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