MCPcopy Create free account
hub / github.com/dynjs/dynjs / Token

Class Token

src/main/java/org/dynjs/parser/js/Token.java:3–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1package org.dynjs.parser.js;
2
3public class Token implements Position {
4
5 private TokenType type;
6 private String text;
7 private String fileName;
8 private int lineNumber;
9 private int columnNumber;
10 private boolean escapedString;
11 private boolean escapedOctalString;
12 private boolean continuedLine;
13
14 public Token(TokenType type, String text, String fileName, int lineNumber, int columnNumber) {
15 this.type = type;
16 this.text = text;
17 this.fileName = fileName;
18 this.lineNumber = lineNumber;
19 this.columnNumber = columnNumber;
20 }
21
22 public void setEscapedString(boolean escapedString) {
23 this.escapedString = escapedString;
24 }
25
26 public boolean isEscapedString() {
27 return this.escapedString;
28 }
29
30 public void setEscapedOctalString(boolean escapedOctalString) {
31 this.escapedOctalString = escapedOctalString;
32 }
33
34 public boolean isEscapedOctalString() {
35 return this.escapedOctalString;
36 }
37
38 public void setContinuedLine(boolean continuedLine) {
39 this.continuedLine = continuedLine;
40 }
41
42 public boolean isContinuedLine() {
43 return this.continuedLine;
44 }
45
46 public TokenType getType() {
47 return this.type;
48 }
49
50 public String getText() {
51 if ( this.type.isUnprintable() ) {
52 return this.type.getDescription();
53 }
54 return this.text;
55 }
56
57 public boolean isSkippable() {
58 return this.type.isSkippable();
59 }
60

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected