@@ -322,8 +322,6 @@ public final class ${ctx.lib_name.camel} {
322322
323323 /**
324324 * Convert a C Langkit exception to the LangkitException class.
325-
326- * @param
327325 */
328326 private static LangkitException wrapException(
329327 final LangkitExceptionNative exc
@@ -369,7 +367,7 @@ public final class ${ctx.lib_name.camel} {
369367 // ==========
370368
371369 /**
372- * Interface to visit the AST .
370+ * Interface to visit the parse tree .
373371 */
374372 public static interface BasicVisitor<T > {
375373 T visit(${ root_node_type} node);
@@ -381,7 +379,7 @@ public final class ${ctx.lib_name.camel} {
381379 }
382380
383381 /**
384- * Interface to visit the AST with a parameter.
382+ * Interface to visit the parse tree with a parameter.
385383 */
386384 public static interface ParamVisitor<T , P > {
387385 T visit(${ root_node_type} node, P param);
@@ -807,7 +805,7 @@ public final class ${ctx.lib_name.camel} {
807805 % endfor
808806 ;
809807
810- // ----- Class attributes
808+ // ----- Class attributes -----
811809
812810 /** Singleton that represents the none expcetion kind. */
813811 public static final ExceptionKind NONE =
@@ -1820,7 +1818,7 @@ public final class ${ctx.lib_name.camel} {
18201818
18211819 // ----- Class attributes -----
18221820
1823- /** Singleton that represents the none diagnositc . */
1821+ /** Singleton that represents the none diagnostic . */
18241822 public static final Diagnostic NONE = new Diagnostic(
18251823 SourceLocationRange.NONE,
18261824 Text.NONE
@@ -1873,8 +1871,8 @@ public final class ${ctx.lib_name.camel} {
18731871 /**
18741872 * Wrap a pointer to a native diagnostic.
18751873 *
1876- * @param pointer The pointer to the native diagnositc .
1877- * @return The wrapped diagnositc .
1874+ * @param pointer The pointer to the native diagnostic .
1875+ * @return The wrapped diagnostic .
18781876 */
18791877 static Diagnostic wrap(
18801878 final Pointer pointer
@@ -1886,7 +1884,7 @@ public final class ${ctx.lib_name.camel} {
18861884 * Wrap a diagnostic native value in the Java class.
18871885 *
18881886 * @param diagnosticNative The diagnostic NI native value.
1889- * @return The newly wrapped diagnositc .
1887+ * @return The newly wrapped diagnostic .
18901888 */
18911889 static Diagnostic wrap(
18921890 final DiagnosticNative diagnosticNative
@@ -2049,7 +2047,7 @@ public final class ${ctx.lib_name.camel} {
20492047
20502048 }
20512049
2052- ${ c_doc (' langkit.unit_provider_type' )}
2050+ ${ java_doc (' langkit.unit_provider_type' , 4 )}
20532051 public static final class UnitProvider implements AutoCloseable {
20542052
20552053 // ----- Class attributes -----
@@ -2141,7 +2139,7 @@ public final class ${ctx.lib_name.camel} {
21412139
21422140 }
21432141
2144- ${ java_doc(' langkit.event_handler_type' )}
2142+ ${ java_doc(' langkit.event_handler_type' , 4 )}
21452143 public static final class EventHandler implements AutoCloseable {
21462144
21472145 // ----- Class attributes -----
@@ -2687,9 +2685,9 @@ public final class ${ctx.lib_name.camel} {
26872685 if(o == this) return true;
26882686 if(!(o instanceof Token)) return false;
26892687 final Token other = (Token) o;
2690- return other .tokenDataHandler.equals(this .tokenDataHandler) &&
2691- other .tokenIndex == this .tokenIndex &&
2692- other .triviaIndex == this .triviaIndex;
2688+ return this .tokenDataHandler.equals(other .tokenDataHandler) &&
2689+ this .tokenIndex == other .tokenIndex &&
2690+ this .triviaIndex == other .triviaIndex;
26932691 }
26942692
26952693 // ----- Inner classes -----
@@ -3071,6 +3069,26 @@ public final class ${ctx.lib_name.camel} {
30713069 return this.eventHandler;
30723070 }
30733071
3072+ // ----- Class methods -----
3073+
3074+ /**
3075+ * Increase the reference counter of the given context.
3076+ *
3077+ * @param context The context to increase the reference counter of.
3078+ */
3079+ private static void increaseRefCounter(
3080+ final AnalysisContext context
3081+ ) {
3082+ // Increase the context reference counter of the context if not null
3083+ if(!context.reference.isNull()) {
3084+ if(ImageInfo.inImageCode()) {
3085+ NI_LIB.${ nat(" context_incref" )} (context.reference.ni());
3086+ } else {
3087+ JNI_LIB.${ nat(" context_incref" )} (context.reference.jni());
3088+ }
3089+ }
3090+ }
3091+
30743092 // ----- Instance methods -----
30753093
30763094 /**
@@ -3260,24 +3278,6 @@ public final class ${ctx.lib_name.camel} {
32603278 }
32613279 % endif
32623280
3263- /**
3264- * Increase the reference counter of the given context.
3265- *
3266- * @param context The context to increase the reference counter of.
3267- */
3268- private static void increaseRefCounter(
3269- final AnalysisContext context
3270- ) {
3271- // Increase the context reference counter of the context if not null
3272- if(!context.reference.isNull()) {
3273- if(ImageInfo.inImageCode()) {
3274- NI_LIB.${ nat(" context_incref" )} (context.reference.ni());
3275- } else {
3276- JNI_LIB.${ nat(" context_incref" )} (context.reference.jni());
3277- }
3278- }
3279- }
3280-
32813281 /** @see java.lang.AutoCloseable#close() */
32823282 @Override
32833283 public void close() {
@@ -3551,9 +3551,9 @@ public final class ${ctx.lib_name.camel} {
35513551 }
35523552
35533553 /**
3554- * Get the list of assiated diagnositcs . Those are parsing errors.
3554+ * Get the list of associated diagnostics . Those are parsing errors.
35553555 *
3556- * @return The diagnositcs of the unit.
3556+ * @return The diagnostics of the unit.
35573557 */
35583558 public List<Diagnostic > getDiagnostics() {
35593559 final int diagnosticCount;
@@ -3605,7 +3605,7 @@ public final class ${ctx.lib_name.camel} {
36053605 if(this == o) return true;
36063606 if(!(o instanceof AnalysisUnit)) return false;
36073607 final AnalysisUnit other = (AnalysisUnit) o;
3608- return other .reference.equals(other.reference);
3608+ return this .reference.equals(other.reference);
36093609 }
36103610
36113611 }
@@ -4096,28 +4096,28 @@ public final class ${ctx.lib_name.camel} {
40964096 // ----- Dumping methods -----
40974097
40984098 /**
4099- * Return the AST in a string.
4099+ * Return the parsing tree in a string.
41004100 *
4101- * @return The string containing the representation of the AST
4101+ * @return The string containing the representation of the parsing tree
41024102 * from the node.
41034103 */
41044104 @CompilerDirectives.TruffleBoundary
4105- public String dumpAST () {
4105+ public String dumpTree () {
41064106 final StringBuilder builder = new StringBuilder();
4107- this.dumpAST (builder);
4107+ this.dumpTree (builder);
41084108 return builder.toString();
41094109 }
41104110
41114111 /**
4112- * Dump the AST in the given string builder.
4112+ * Dump the parse tree in the given string builder.
41134113 *
4114- * @param builder The builder to dump the AST in.
4114+ * @param builder The builder to dump the parse tree in.
41154115 */
41164116 @CompilerDirectives.TruffleBoundary
4117- public void dumpAST (
4117+ public void dumpTree (
41184118 final StringBuilder builder
41194119 ) {
4120- this.dumpAST (builder, "");
4120+ this.dumpTree (builder, "");
41214121 }
41224122
41234123 /**
@@ -4137,17 +4137,18 @@ public final class ${ctx.lib_name.camel} {
41374137 builder.append(indent)
41384138 .append(name)
41394139 .append(":\n");
4140- value.dumpAST (builder, indent + " ");
4140+ value.dumpTree (builder, indent + " ");
41414141 }
41424142
41434143 /**
4144- * Dump the AST in the given string builder with the indent level.
4144+ * Dump the parse tree in the given string builder with the indent
4145+ * level.
41454146 *
4146- * @param builder The builder to dump the AST in.
4147+ * @param builder The builder to dump the tree in.
41474148 * @param indent The starting indent level.
41484149 */
41494150 @CompilerDirectives.TruffleBoundary
4150- protected void dumpAST (
4151+ protected void dumpTree (
41514152 final StringBuilder builder,
41524153 String indent
41534154 ) {
@@ -4271,7 +4272,7 @@ public final class ${ctx.lib_name.camel} {
42714272
42724273 }
42734274
4274- // ===== Generated AST node wrapping classes =====
4275+ // ===== Generated node wrapping classes =====
42754276
42764277 % for astnode in ctx.astnode_types:
42774278 % if astnode != T.root_node:
0 commit comments