-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b607141
commit fdc6a9c
Showing
15 changed files
with
150 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package eotree.data | ||
|
||
import java.util.* | ||
|
||
/** | ||
* EBNF representation: | ||
* ` | ||
* TRUE | FALSE | ||
` * | ||
*/ | ||
class EOBoolData(var b: Boolean) : EOData() { | ||
override fun generateEO(indent: Int): String { | ||
return indent(indent) + b.toString().uppercase(Locale.getDefault()) | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...ions/sec_15_8_primary_expressions/sec_15_8_1_lexical_literals/ComplexLexicalLiterals.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
public class SimpleLexicalLiterals { | ||
|
||
public static void main(String[] args) { | ||
int v1 = 5; | ||
long v2 = 5L; | ||
long v3 = 5l; | ||
float v4 = 5.0f; | ||
float v5 = 5.0F; | ||
double v6 = 5.0; | ||
boolean v7 = v1 == v2; | ||
char v8 = '5'; | ||
String v9 = "5"; | ||
Object v10 = null; | ||
System.out.println("passed"); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...est/resources/test_candidates/ch_8_classes/sec_8_2_class_members/ComplexClassMembers.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
public class SimpleClassMembers { | ||
public static void main(String[] args) { | ||
ColoredPoint c = new ColoredPoint(0, 0); | ||
c.reset(); | ||
System.out.println("passed"); | ||
} | ||
} | ||
|
||
class Point { | ||
int x, y; | ||
private Point() { reset(); } | ||
Point(int x, int y) { this.x = x; this.y = y; } | ||
void reset() { this.x = 0; this.y = 0; } | ||
} | ||
|
||
class ColoredPoint extends Point { | ||
int color; | ||
ColoredPoint(int x, int y) { super(x, y); color = 0; } | ||
} | ||
|
10 changes: 10 additions & 0 deletions
10
...tes/ch_8_classes/sec_8_4_method_declarations/sec_8_4_1_formal_parametes/StaticMethod.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
public class SimpleMethod { | ||
|
||
static void method () {} | ||
|
||
public static void main(String[] args) { | ||
method(); | ||
System.out.println("passed"); | ||
} | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
...classes/sec_8_4_method_declarations/sec_8_4_1_formal_parametes/StaticParameterMethod.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
public class SimpleParameterMethod { | ||
|
||
static void method (String param) {} | ||
|
||
public static void main(String[] args) { | ||
method("param 1"); | ||
System.out.println("passed"); | ||
} | ||
|
||
} |
7 changes: 7 additions & 0 deletions
7
...15_expressions/sec_15_8_primary_expressions/sec_15_8_1_lexical_literals/FloatLiteral.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
public class FloatLiteral { | ||
|
||
public static void main(String[] args) { | ||
float a = 1f; | ||
System.out.println("passed"); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
..._expressions/sec_15_8_primary_expressions/sec_15_8_1_lexical_literals/IntegerLiteral.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
public class IntegerLiteral { | ||
|
||
public static void main(String[] args) { | ||
int a = 1; | ||
System.out.println("passed"); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/test/resources/test_ready/ch_8_classes/sec_8_2_class_members/MethodClassMember.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
public class MethodClassMember { | ||
|
||
int func() { return 0; } | ||
|
||
public static void main(String[] args) { | ||
System.out.println("passed"); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/test/resources/test_ready/ch_8_classes/sec_8_2_class_members/PrimitiveClassMember.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
public class PrimitiveClassMember { | ||
|
||
int a; | ||
|
||
public static void main(String[] args) { | ||
System.out.println("passed"); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
..._8_classes/sec_8_3_field_declarations/sec_8_3_2_field_initialization/SimpleFieldInit.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
public class SimpleFieldInit { | ||
|
||
int a = 2 + 2 * (2 - (2 - 2)); | ||
|
||
public static void main(String[] args) { | ||
System.out.println("passed"); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...ady/ch_8_classes/sec_8_4_method_declarations/sec_8_4_1_formal_parametes/SimpleMethod.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
public class SimpleMethod{ | ||
|
||
int method() { return -1; } | ||
|
||
public static void main(String[] args) { | ||
System.out.println("passed"); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...sses/sec_8_4_method_declarations/sec_8_4_1_formal_parametes/SimpleParametrizedMethod.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
public class SimpleParametrizedMethod { | ||
|
||
void method(int a, int b) {} | ||
|
||
public static void main(String[] args) { | ||
System.out.println("passed"); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...ch_8_classes/sec_8_4_method_declarations/sec_8_4_1_formal_parametes/SimpleVoidMethod.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
public class SimpleVoidMethod{ | ||
|
||
void method() {} | ||
|
||
public static void main(String[] args) { | ||
System.out.println("passed"); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
..._ready/ch_8_classes/sec_8_5_member_class_and_interface_declarations/SimpleInnerClass.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
public class SimpleInnerClass { | ||
|
||
public static void main(String[] args) { | ||
System.out.println("passed"); | ||
} | ||
|
||
class InnerClass {} | ||
} |
8 changes: 8 additions & 0 deletions
8
...dy/ch_8_classes/sec_8_5_member_class_and_interface_declarations/SimpleInnerInterface.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
public class SimpleInnerInterface { | ||
|
||
public static void main(String[] args) { | ||
System.out.println("passed"); | ||
} | ||
|
||
interface InnerInterface {} | ||
} |