| 1 |
---input--- |
| 2 |
String source = """ |
| 3 |
public class Quine { |
| 4 |
public static void main(String[] args) { |
| 5 |
String textBlockQuotes = new String(new char[]{'"', '"', '"'}); |
| 6 |
char newLine = 10; |
| 7 |
String teststringinside = "hello my name is...\n\r"; |
| 8 |
String source = %s; |
| 9 |
System.out.println(source.formatted(textBlockQuotes + newLine + source + textBlockQuotes)); |
| 10 |
} |
| 11 |
} |
| 12 |
"""; |
| 13 |
|
| 14 |
|
| 15 |
---tokens--- |
| 16 |
'\t ' Text.Whitespace |
| 17 |
'String' Name |
| 18 |
' ' Text.Whitespace |
| 19 |
'source' Name |
| 20 |
' ' Text.Whitespace |
| 21 |
'=' Operator |
| 22 |
' ' Text.Whitespace |
| 23 |
'"""\n' Literal.String |
| 24 |
|
| 25 |
"public class Quine {\n\tpublic static void main(String[] args) {\n\t\tString textBlockQuotes = new String(new char[]{'" Literal.String |
| 26 |
'"' Literal.String |
| 27 |
"', '" Literal.String |
| 28 |
'"' Literal.String |
| 29 |
"', '" Literal.String |
| 30 |
'"' Literal.String |
| 31 |
"'});\n\t\tchar newLine = 10;\n\t\tString teststringinside = " Literal.String |
| 32 |
'"' Literal.String |
| 33 |
'hello my name is...' Literal.String |
| 34 |
'\\' Literal.String |
| 35 |
'n' Literal.String |
| 36 |
'\\' Literal.String |
| 37 |
'r' Literal.String |
| 38 |
'"' Literal.String |
| 39 |
';\n\t\tString source = %s;\n\t\tSystem.out.println(source.formatted(textBlockQuotes + newLine + source + textBlockQuotes));\n\t}\n}\n' Literal.String |
| 40 |
|
| 41 |
'"""' Literal.String |
| 42 |
';' Punctuation |
| 43 |
'\n' Text.Whitespace |
| 44 |
|
| 45 |
' ' Text.Whitespace |
| 46 |
'\n' Text.Whitespace |