@@ -322,8 +322,6 @@ public final class ${ctx.lib_name.camel} {
322
322
323
323
/**
324
324
* Convert a C Langkit exception to the LangkitException class.
325
-
326
- * @param
327
325
*/
328
326
private static LangkitException wrapException(
329
327
final LangkitExceptionNative exc
@@ -369,7 +367,7 @@ public final class ${ctx.lib_name.camel} {
369
367
// ==========
370
368
371
369
/**
372
- * Interface to visit the AST .
370
+ * Interface to visit the parse tree .
373
371
*/
374
372
public static interface BasicVisitor<T > {
375
373
T visit(${ root_node_type} node);
@@ -381,7 +379,7 @@ public final class ${ctx.lib_name.camel} {
381
379
}
382
380
383
381
/**
384
- * Interface to visit the AST with a parameter.
382
+ * Interface to visit the parse tree with a parameter.
385
383
*/
386
384
public static interface ParamVisitor<T , P > {
387
385
T visit(${ root_node_type} node, P param);
@@ -807,7 +805,7 @@ public final class ${ctx.lib_name.camel} {
807
805
% endfor
808
806
;
809
807
810
- // ----- Class attributes
808
+ // ----- Class attributes -----
811
809
812
810
/** Singleton that represents the none expcetion kind. */
813
811
public static final ExceptionKind NONE =
@@ -1820,7 +1818,7 @@ public final class ${ctx.lib_name.camel} {
1820
1818
1821
1819
// ----- Class attributes -----
1822
1820
1823
- /** Singleton that represents the none diagnositc . */
1821
+ /** Singleton that represents the none diagnostic . */
1824
1822
public static final Diagnostic NONE = new Diagnostic(
1825
1823
SourceLocationRange.NONE,
1826
1824
Text.NONE
@@ -1873,8 +1871,8 @@ public final class ${ctx.lib_name.camel} {
1873
1871
/**
1874
1872
* Wrap a pointer to a native diagnostic.
1875
1873
*
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 .
1878
1876
*/
1879
1877
static Diagnostic wrap(
1880
1878
final Pointer pointer
@@ -1886,7 +1884,7 @@ public final class ${ctx.lib_name.camel} {
1886
1884
* Wrap a diagnostic native value in the Java class.
1887
1885
*
1888
1886
* @param diagnosticNative The diagnostic NI native value.
1889
- * @return The newly wrapped diagnositc .
1887
+ * @return The newly wrapped diagnostic .
1890
1888
*/
1891
1889
static Diagnostic wrap(
1892
1890
final DiagnosticNative diagnosticNative
@@ -2049,7 +2047,7 @@ public final class ${ctx.lib_name.camel} {
2049
2047
2050
2048
}
2051
2049
2052
- ${ c_doc (' langkit.unit_provider_type' )}
2050
+ ${ java_doc (' langkit.unit_provider_type' , 4 )}
2053
2051
public static final class UnitProvider implements AutoCloseable {
2054
2052
2055
2053
// ----- Class attributes -----
@@ -2141,7 +2139,7 @@ public final class ${ctx.lib_name.camel} {
2141
2139
2142
2140
}
2143
2141
2144
- ${ java_doc(' langkit.event_handler_type' )}
2142
+ ${ java_doc(' langkit.event_handler_type' , 4 )}
2145
2143
public static final class EventHandler implements AutoCloseable {
2146
2144
2147
2145
// ----- Class attributes -----
@@ -2687,9 +2685,9 @@ public final class ${ctx.lib_name.camel} {
2687
2685
if(o == this) return true;
2688
2686
if(!(o instanceof Token)) return false;
2689
2687
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;
2693
2691
}
2694
2692
2695
2693
// ----- Inner classes -----
@@ -3071,6 +3069,26 @@ public final class ${ctx.lib_name.camel} {
3071
3069
return this.eventHandler;
3072
3070
}
3073
3071
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
+
3074
3092
// ----- Instance methods -----
3075
3093
3076
3094
/**
@@ -3260,24 +3278,6 @@ public final class ${ctx.lib_name.camel} {
3260
3278
}
3261
3279
% endif
3262
3280
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
-
3281
3281
/** @see java.lang.AutoCloseable#close() */
3282
3282
@Override
3283
3283
public void close() {
@@ -3551,9 +3551,9 @@ public final class ${ctx.lib_name.camel} {
3551
3551
}
3552
3552
3553
3553
/**
3554
- * Get the list of assiated diagnositcs . Those are parsing errors.
3554
+ * Get the list of associated diagnostics . Those are parsing errors.
3555
3555
*
3556
- * @return The diagnositcs of the unit.
3556
+ * @return The diagnostics of the unit.
3557
3557
*/
3558
3558
public List<Diagnostic > getDiagnostics() {
3559
3559
final int diagnosticCount;
@@ -3605,7 +3605,7 @@ public final class ${ctx.lib_name.camel} {
3605
3605
if(this == o) return true;
3606
3606
if(!(o instanceof AnalysisUnit)) return false;
3607
3607
final AnalysisUnit other = (AnalysisUnit) o;
3608
- return other .reference.equals(other.reference);
3608
+ return this .reference.equals(other.reference);
3609
3609
}
3610
3610
3611
3611
}
@@ -4096,28 +4096,28 @@ public final class ${ctx.lib_name.camel} {
4096
4096
// ----- Dumping methods -----
4097
4097
4098
4098
/**
4099
- * Return the AST in a string.
4099
+ * Return the parsing tree in a string.
4100
4100
*
4101
- * @return The string containing the representation of the AST
4101
+ * @return The string containing the representation of the parsing tree
4102
4102
* from the node.
4103
4103
*/
4104
4104
@CompilerDirectives.TruffleBoundary
4105
- public String dumpAST () {
4105
+ public String dumpTree () {
4106
4106
final StringBuilder builder = new StringBuilder();
4107
- this.dumpAST (builder);
4107
+ this.dumpTree (builder);
4108
4108
return builder.toString();
4109
4109
}
4110
4110
4111
4111
/**
4112
- * Dump the AST in the given string builder.
4112
+ * Dump the parse tree in the given string builder.
4113
4113
*
4114
- * @param builder The builder to dump the AST in.
4114
+ * @param builder The builder to dump the parse tree in.
4115
4115
*/
4116
4116
@CompilerDirectives.TruffleBoundary
4117
- public void dumpAST (
4117
+ public void dumpTree (
4118
4118
final StringBuilder builder
4119
4119
) {
4120
- this.dumpAST (builder, "");
4120
+ this.dumpTree (builder, "");
4121
4121
}
4122
4122
4123
4123
/**
@@ -4137,17 +4137,18 @@ public final class ${ctx.lib_name.camel} {
4137
4137
builder.append(indent)
4138
4138
.append(name)
4139
4139
.append(":\n");
4140
- value.dumpAST (builder, indent + " ");
4140
+ value.dumpTree (builder, indent + " ");
4141
4141
}
4142
4142
4143
4143
/**
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.
4145
4146
*
4146
- * @param builder The builder to dump the AST in.
4147
+ * @param builder The builder to dump the tree in.
4147
4148
* @param indent The starting indent level.
4148
4149
*/
4149
4150
@CompilerDirectives.TruffleBoundary
4150
- protected void dumpAST (
4151
+ protected void dumpTree (
4151
4152
final StringBuilder builder,
4152
4153
String indent
4153
4154
) {
@@ -4271,7 +4272,7 @@ public final class ${ctx.lib_name.camel} {
4271
4272
4272
4273
}
4273
4274
4274
- // ===== Generated AST node wrapping classes =====
4275
+ // ===== Generated node wrapping classes =====
4275
4276
4276
4277
% for astnode in ctx.astnode_types:
4277
4278
% if astnode != T.root_node:
0 commit comments