Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
167 commits
Select commit Hold shift + click to select a range
4922c42
Initial storage classes, no tests
warburec Jan 10, 2025
4008b8e
String storage method and general file operations
warburec Jan 11, 2025
a500d26
Diagram for storage proposal
warburec Jan 13, 2025
7919910
Beginning of small storage architecture rework
warburec Jan 13, 2025
7c81bd9
Basic storageValues
warburec Jan 14, 2025
92e2a4b
StorageValueAdapter rework and relocation
warburec Jan 14, 2025
099b259
Storage proposed representation/file storage architecture edit
warburec Jan 14, 2025
3f96f14
Storage architecture rework to add FileWriters
warburec Jan 18, 2025
0f57567
FileWriter and basic string file writer
warburec Jan 18, 2025
6037eee
File editor interface alterations and abstract class
warburec Jan 18, 2025
1a8e33a
Storage methods converted to Value formatters
warburec Jan 22, 2025
ec2638e
StringFileEditor reading contents
warburec Jan 24, 2025
19ad36c
ValueToStringFormatter
warburec Jan 24, 2025
4b8672b
Formatter exceptions and start of ValueToStringFormatter
warburec Jan 30, 2025
74df7bf
Fixed interface usage in storage diagram
warburec Mar 22, 2025
153ea79
Small clarity refactor in build.gradle
warburec Mar 22, 2025
fcd291b
StorageValue .equals and tests
warburec Mar 30, 2025
fc40140
ValueToStringFormatter beginning
warburec Mar 30, 2025
aa4aa44
Folder renaming for consistency
warburec Mar 31, 2025
0fce941
ValueToStringFormatter parsing for MapStorageValue
warburec Apr 3, 2025
a221ef1
ValueToStringFormatter parsing for MapStorageValue
warburec Apr 3, 2025
46b2634
Merge branch 'Parse-Tree-Storage' of https://github.com/warburec/GenC…
warburec Apr 5, 2025
3f48e7c
Merge branch 'main' into Component-Storage
warburec Apr 5, 2025
05171cc
Merge branch 'main' into Component-Storage
warburec May 5, 2025
1becee7
ValueToStringFormatter rework
warburec May 18, 2025
de84f61
Minor non functionality edits
warburec May 18, 2025
e54039c
Formatting tests for ValueToStringFormatter
warburec May 18, 2025
6418e21
Storage builder dynamic value handling
warburec Nov 25, 2025
032792a
Storage test class
warburec Nov 28, 2025
c9d6dbf
Made file read/writers use Path for filepaths
warburec Nov 28, 2025
4776e8b
Storage setting path tests
warburec Nov 29, 2025
4d1d97e
Updated file editor components to throw IOExceptions
warburec Nov 30, 2025
04728e5
Store fix
warburec Nov 30, 2025
c888886
Rename TypeToken to TypeReference for clarity
warburec Dec 12, 2025
66af626
Correct casting when loading from storage
warburec Dec 17, 2025
f578879
Load empty file
warburec Dec 18, 2025
cf636bc
Rework FileEditor components to use Streams
warburec Jan 27, 2026
d1242f5
Load from targetPath
warburec Jan 27, 2026
2d6bea3
ConvertAndStore to OutputStream
warburec Jan 30, 2026
ccced17
ConvertAndLoadInto with addition of TestLoadable
warburec Jan 30, 2026
0bb6f3d
convertThenFormatAndLoadInto
warburec Feb 3, 2026
ecd9a69
storeToStream
warburec Feb 3, 2026
d5cb5ba
storeStorable
warburec Feb 3, 2026
cbfd181
storeStorableAtFilepath
warburec Feb 3, 2026
cd06a8e
storeStorageValue
warburec Feb 3, 2026
7501350
LoadInto
warburec Feb 3, 2026
15ffe59
StoreInteger
warburec Feb 27, 2026
b2fd60d
LoadInteger
warburec Feb 27, 2026
cae7a3a
LoadEmptyInteger
warburec Feb 27, 2026
c41552b
convertAndStoreInteger
warburec Feb 27, 2026
369543d
convertAndLoadIntegerInto
warburec Feb 27, 2026
010ac3e
convertThenFormatAndLoadIntegerInto
warburec Feb 27, 2026
f856f7f
storeIntegerToStream
warburec Feb 27, 2026
d57571d
loadIntegerFromInputStream
warburec Feb 27, 2026
9ce9f34
storeStorableOfInteger
warburec Feb 27, 2026
2c03271
storeStorableOfIntegerAtFilepath
warburec Feb 27, 2026
d7de255
storeStorageValueOfInteger
warburec Feb 27, 2026
32dbe4d
LoadIntegerInto
warburec Feb 27, 2026
1446785
loadIntegerFromTargetPath
warburec Feb 27, 2026
5b3798d
Converted StreamEditor to Interface
warburec Mar 4, 2026
e51c899
Handling of mismatched formatter and streamWriter
warburec Mar 7, 2026
1455514
Handling storage component failures on store
warburec Mar 9, 2026
8044b49
Handling storage component failures on load
warburec Mar 11, 2026
ca2b95a
Handling storage component failures on convertAndStore
warburec Mar 12, 2026
faf393b
Handling storage component failures on convertAndLoadInto
warburec Mar 13, 2026
f7edb85
Handling storage component failures on convertThenFormatAndLoadInto
warburec Mar 15, 2026
892189b
Handling storage component failures on storeToStream
warburec Mar 15, 2026
2cf9198
Handling storage component failures on loadFromInputStream
warburec Mar 15, 2026
07e750d
Handling storage component failures on storeStorable
warburec Mar 15, 2026
e6273e2
Handling storage component failures on storeStorableAtFilepath
warburec Mar 15, 2026
cc49094
Handling storage component failures on storeStorageValue
warburec Mar 15, 2026
468db8d
Handling storage component failures on loadInto
warburec Mar 15, 2026
f2eca3f
Handling storage component failures on loadFromTargetPath
warburec Mar 15, 2026
2491ce0
Handling storage component failures on loadWithType
warburec Mar 15, 2026
ed70a9f
Start of Storage documentation
warburec Mar 18, 2026
a28bb5e
Configuration methods documentation
warburec Mar 18, 2026
4c8ccd1
Stream storage documentation
warburec Mar 19, 2026
3760127
File storage documentation
warburec Mar 19, 2026
1f87c65
Relocation of TypeReference to helper_objects
warburec Mar 24, 2026
c400014
Broken changes: Compiler interface and builder changes
warburec May 13, 2026
b9e6d66
Compiler Storage design
warburec May 16, 2026
2cf8970
ListStorageValue
warburec May 16, 2026
2219306
Small ValueToStringFormatter rearrange
warburec May 16, 2026
322714f
Small cleanup, TODO and diagram change
warburec May 16, 2026
1ae45d6
Custom storage redesign
warburec May 17, 2026
b05f632
An assortment of unfinished experimentations
warburec Jun 5, 2026
1080450
Adding list parsing and formatting tests for ValueToStringFormatter
warburec Jun 10, 2026
80e34ed
Parse tests for lists within ValueToStringFormatter
warburec Jun 11, 2026
60eccbd
Format tests for ValueToStringFormatter
warburec Jun 11, 2026
62b93aa
Passing list parsing and formatting ValueToStringformatter tests
warburec Jun 12, 2026
6a854d5
ValueToStringFormatter more complex parse and format including tests
warburec Jun 14, 2026
e7cfd6d
Storing and loading of custom components
warburec Jun 17, 2026
f92e2b5
Gradle version update
warburec Jun 28, 2026
2b9d5a2
Dynamic and reflective class loading
warburec Jul 5, 2026
d87e1e7
File rearrange and test file creation
warburec Jul 7, 2026
a28d2b3
Start ReflectiveClassConstructorTests
warburec Jul 11, 2026
b14cb5a
Dynamic construction tests one parameter without error cases
warburec Jul 13, 2026
1a38b3d
Incorrect type arngument
warburec Jul 14, 2026
fcfd156
Incorrect parameter types
warburec Jul 14, 2026
d90b979
No parameters non-existent class given
warburec Jul 15, 2026
c8129ba
One Parameter non-existent class given
warburec Jul 15, 2026
c5c2100
Many parameters and up and down cast attempts
warburec Jul 17, 2026
1cd92ad
ReflectiveClassConstructor exception cleanup and documentation
warburec Jul 19, 2026
64add62
LoaderTests Standard usage
warburec Jul 19, 2026
02f87a7
LoaderTests basic and missing required constructor
warburec Jul 19, 2026
c634188
Loader and LoaderTest cleanup
warburec Jul 19, 2026
594ce33
Better IncorrectlyFormedLoader constructor privatisation
warburec Jul 24, 2026
144ad16
Initial loadableBy tests
warburec Jul 24, 2026
7ae2864
LoadableBy tests for classes with additional interfaces
warburec Jul 26, 2026
7a83abd
LoadableBy getTargetLoader rework
warburec Jul 26, 2026
87974ab
Generic Loader tests
warburec Jul 26, 2026
9b4c7fe
Unfinished StorableCustomCompilerFactory changes
warburec Aug 1, 2026
4c59af0
Start of StorableCustomCompilerFactoryTests
warburec Aug 7, 2026
861e247
Produce components with and without using existing class names
warburec Aug 11, 2026
9e981c7
LoadableBy usage for CustomLexicalAnalyser reflective loading
warburec Aug 11, 2026
e0b74f7
ReflectivelyLoadable
warburec Aug 21, 2026
c708fb3
Update FactoryRepository and tests
warburec Aug 21, 2026
c33ca5b
CustomLexicalAnalyser test aids
warburec Aug 21, 2026
bc751d3
Removal of CustomX components
warburec Aug 21, 2026
a1646c3
ReflectivelyLoadable LexicalAnalyser test
warburec Aug 21, 2026
553a817
StorableCompilerBuilder imports fix
warburec Aug 21, 2026
89010c9
Constructable components
warburec Aug 24, 2026
e5b2f6b
Documentation improvement for StorableCustomCompilerFactory
warburec Aug 25, 2026
f4e7abc
Incorrect format no map storage value
warburec Aug 25, 2026
a08c533
Missing key
warburec Aug 25, 2026
514f91a
Multiple missing keys
warburec Aug 25, 2026
3f30dfd
Empty input map
warburec Aug 25, 2026
f498669
Exception documentation and StorableCustomCompilerFactory class docum…
warburec Aug 25, 2026
8f90518
Produce Non Existent Component Class
warburec Aug 28, 2026
99cdc7f
Produce Non Component Class and exception documentation
warburec Aug 28, 2026
ab49217
Produce with component missing correct constructor
warburec Aug 30, 2026
8040f96
Produce using incorrect Format with non list component description
warburec Aug 30, 2026
b9dbac2
Including cause within exceptions
warburec Sep 1, 2026
6362581
Null handling in Storage
warburec Sep 2, 2026
65ab22e
StorableCustomCompilerFactoryTests import cleanup
warburec Sep 2, 2026
9db33d7
CompilerStorage methods
warburec Sep 3, 2026
90fd759
UseTestFile annotation and extension moved to specialised files
warburec Sep 5, 2026
39e2890
More LoadableTest... Components
warburec Sep 6, 2026
b2af90a
.equals() for CustomCompiler and StorableCustomCompiler
warburec Sep 6, 2026
2ea54dd
CompilerStorage additional storage methods and LoadableBy comment update
warburec Sep 6, 2026
6f73618
Introduction of NonStorableComponentException
warburec Sep 7, 2026
792c6d6
Small unused import cleanup
warburec Sep 7, 2026
da7dc23
Made test compiler components storable
warburec Sep 7, 2026
fdc5fdd
NullStorageValue handling
warburec Sep 8, 2026
8c2a1d6
.equals, NullStorageValue, folder shift and minor value edits for tes…
warburec Sep 8, 2026
e2fec8b
StorableCustomCompilerFactory exception arrow removal and ComponentIn…
warburec Sep 8, 2026
bf33cde
CompilerStorageTests start
warburec Sep 8, 2026
863386b
CompilerStorageTests passing
warburec Sep 10, 2026
37e2398
CompilerStorageTests cleanup
warburec Sep 10, 2026
700789d
Make CompilerBuilderTests use assertDoesNotThrow
warburec Sep 13, 2026
89e8b72
First StorableCustomCompilerBuilderTests
warburec Sep 13, 2026
868baf4
Non storable components for StorableCustomCompilerBuilderTests
warburec Sep 17, 2026
860f296
Removal of unused FactoryRepository and test file
warburec Sep 17, 2026
80d1450
CompilerBuilderTemplate documentation update
warburec Sep 20, 2026
bfcf4b4
Documentation additions
warburec Sep 20, 2026
dc4bad1
More documentation tweaks
warburec Sep 20, 2026
fc8954e
Storable documentation
warburec Sep 20, 2026
14bda14
Deletion of unused StorableAndLoadable interface
warburec Sep 21, 2026
eac3066
More documentation cleanups
warburec Sep 21, 2026
784d725
Removal of compiler specific language within Storage
warburec Sep 21, 2026
8ef8f66
Diagram update
warburec Sep 25, 2026
3304f64
More diagram updates
warburec Sep 26, 2026
32b7abb
Diagram colour fix
warburec Sep 27, 2026
fe7ade2
Import fixes
warburec Sep 27, 2026
79e4dd0
Rename component_construction "storage" to "storable"
warburec Sep 27, 2026
7f26a83
Merge branch 'main' into Compiler-Interface-Rework
warburec Sep 27, 2026
9fcd1ef
Merge branch 'main' into Compiler-Interface-Rework
warburec Sep 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
.gradle

build
bin
bin
35 changes: 24 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,21 @@ sourceSets {
srcDirs = ['src/test/java']
}
}
playground {
java {
srcDirs = ['src/playground/java']
}
}
}

dependencies {
implementation platform('org.junit:junit-bom:5.10.3')
implementation 'org.junit.jupiter:junit-jupiter'

testImplementation platform('org.junit:junit-bom:5.10.3')
testImplementation 'org.junit.jupiter:junit-jupiter'

testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

playgroundImplementation sourceSets.main.output
// playgroundImplementation configurations.implementation
// playgroundRuntimeOnly configurations.runtimeClasspath
}

import org.gradle.api.tasks.testing.logging.TestExceptionFormat
Expand All @@ -49,17 +54,25 @@ tasks.named('test') {
events = [TestLogEvent.STARTED, TestLogEvent.FAILED, TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.STANDARD_ERROR, TestLogEvent.STANDARD_OUT]
exceptionFormat = TestExceptionFormat.FULL
}

info.events = debug.events
info.exceptionFormat = debug.exceptionFormat

afterSuite { desc, result ->
if (!desc.parent) {
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} passed, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped)"
def startItem = '| ', endItem = ' |'
def repeatLength = startItem.length() + output.length() + endItem.length()
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength))
}
if (desc.parent) return

def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} passed, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped)"
def startItem = '| ', endItem = ' |'
def repeatLength = startItem.length() + output.length() + endItem.length()

println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength))
}
}
}

tasks.register('playground', JavaExec) {
group = 'application'
description = 'Runs the playground main method'
classpath = sourceSets.playground.runtimeClasspath
mainClass = 'Test'
}
1,283 changes: 1,283 additions & 0 deletions docs/diagrams/CustomCompilers.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
728 changes: 728 additions & 0 deletions docs/diagrams/Storage.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
15 changes: 7 additions & 8 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 13 additions & 12 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 9 additions & 25 deletions src/main/java/component_construction/Compiler.java
Original file line number Diff line number Diff line change
@@ -1,30 +1,14 @@
package component_construction;

import code_generation.CodeGenerator;
import grammar_objects.Token;
import lexical_analysis.LexicalAnalyser;
import syntax_analysis.SyntaxAnalyser;
import syntax_analysis.parsing.ParseFailedException;
import syntax_analysis.parsing.ParseState;

public class Compiler {
protected LexicalAnalyser lexicalAnalyser;
protected SyntaxAnalyser syntaxAnalyser;
protected CodeGenerator codeGenerator;

public Compiler(
LexicalAnalyser lexicalAnalyser,
SyntaxAnalyser syntaxAnalyser,
CodeGenerator codeGenerator
) {
this.lexicalAnalyser = lexicalAnalyser;
this.syntaxAnalyser = syntaxAnalyser;
this.codeGenerator = codeGenerator;
}
public interface Compiler {

/**
* Compiles an input sentence
* @param input The sentence to be compiled
* @return The output of compilation
* @throws ParseFailedException An error occurred when parsing the sentence
*/
public String compile(String input) throws ParseFailedException;

public String compile(String input) throws ParseFailedException {
Token[] tokens = lexicalAnalyser.analyse(input);
ParseState parseRoot = syntaxAnalyser.analyse(tokens);
return codeGenerator.generate(parseRoot);
}
}
Loading
Loading