meta data for this page
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
code_injection_in_javacc_21 [2020/04/25 18:15] – external edit 127.0.0.1 | code_injection_in_javacc_21 [2020/09/29 10:24] (current) – [1. An INJECT block that specifies the class name] revusky | ||
---|---|---|---|
Line 10: | Line 10: | ||
This form a class (or interface) name and looks something like this: | This form a class (or interface) name and looks something like this: | ||
- | | + | |
- | | + | import foo.bar.IFoobar; |
- | import foo.bar.Foobar; | + | |
implements IFoobar; | implements IFoobar; | ||
- | | ||
| | ||
| | ||
Line 23: | Line 21: | ||
The above snippet should be self-explanatory. The INJECT statement specifies the class in which to inject the code. In this example, it is '' | The above snippet should be self-explanatory. The INJECT statement specifies the class in which to inject the code. In this example, it is '' | ||
- | Since an INJECT block can be placed anywhere in your grammar file where you could put a production, you would naturally tend to place the above snippet next to the relevant BNF production, which would, of course, be the '' | + | Since an INJECT block can be placed anywhere in your grammar file where you could put a production, you would naturally tend to place the above snippet next to the relevant BNF production, which would, of course, be the '' |
===== 2. The INJECT block with no type specified ===== | ===== 2. The INJECT block with no type specified ===== |