Considering the following code about the wrong octal number:
```
class Digit {
int n = 079;
}
```
When compiling it, the javac would output:
```
Digit.java:2: error: integer number too large
int n = 079;
^
1 error
```
Because the lexer(JavaTokenizer) incorrectly reads `079` as a token.
So the parser(JavacParser) would throw the NumberFormatException when using the method Convert#string2int.
It is an issue of the lexer but it is caught by the parser, which is not our expectation.
Considering the following code about the wrong binary, hexadecimal and floating point numbers:
```
class Digit {
double a = 9.f2;
int n = 0b123;
int n = 0x12r3;
}
```
The compiler would output:
```
Digit.java:2: error: ';' expected
double a = 9.f2;
^
Digit.java:3: error: ';' expected
int n = 0b123;
^
Digit.java:4: error: ';' expected
int n = 0x12r3;
^
Digit.java:4: error: <identifier> expected
int n = 0x12r3;
^
4 errors
```
The output of the wrong octal numbers should be similar to them, which is like the following output:
```
Digit.java:2: error: ';' expected
int n = 079;
^
1 error
```
```
class Digit {
int n = 079;
}
```
When compiling it, the javac would output:
```
Digit.java:2: error: integer number too large
int n = 079;
^
1 error
```
Because the lexer(JavaTokenizer) incorrectly reads `079` as a token.
So the parser(JavacParser) would throw the NumberFormatException when using the method Convert#string2int.
It is an issue of the lexer but it is caught by the parser, which is not our expectation.
Considering the following code about the wrong binary, hexadecimal and floating point numbers:
```
class Digit {
double a = 9.f2;
int n = 0b123;
int n = 0x12r3;
}
```
The compiler would output:
```
Digit.java:2: error: ';' expected
double a = 9.f2;
^
Digit.java:3: error: ';' expected
int n = 0b123;
^
Digit.java:4: error: ';' expected
int n = 0x12r3;
^
Digit.java:4: error: <identifier> expected
int n = 0x12r3;
^
4 errors
```
The output of the wrong octal numbers should be similar to them, which is like the following output:
```
Digit.java:2: error: ';' expected
int n = 079;
^
1 error
```