MCPcopy
hub / github.com/Col-E/Recaf / CommentAST

Class CommentAST

src/main/java/me/coley/recaf/parse/bytecode/ast/CommentAST.java:11–44  ·  view source on GitHub ↗

Comment AST. @author Matt

Source from the content-addressed store, hash-verified

9 * @author Matt
10 */
11public class CommentAST extends AST implements Compilable {
12 private final String comment;
13
14 /**
15 * @param line
16 * Line number this node is written on.
17 * @param start
18 * Offset from line start this node starts at.
19 * @param comment
20 * Content of comment.
21 */
22 public CommentAST(int line, int start, String comment) {
23 super(line, start);
24 this.comment = comment;
25 }
26
27 /**
28 * @return Content of comment.
29 */
30 public String getComment() {
31 return comment;
32 }
33
34
35 @Override
36 public String print() {
37 return "//" + comment;
38 }
39
40 @Override
41 public void compile(MethodCompilation compilation) throws AssemblerException {
42 compilation.addComment(comment.trim());
43 }
44}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected