All notable changes to the Compiler will be documented in this file. Note that these changes in this file are specifically for the Compiler. The full summary will be in the CHANGELOG.md file the main folder
The format is based on Keep a Changelog , and this project adheres to Semantic Versioning.
Note that Documentation changes should not appear here!
- Behaviour of
DIST_COMPILED_VERSION, which will try to detect the compiled binary state usingsys.argvand the call identifier. - Installation behaviour of
para-build.py, which will from now use/scripts/scripts.specto configure and build using pyinstaller. For each script in/scripts/an executable will be also generated to allow for extensions likeparaprojto be used in the console.
- Unneeded
bin-config.jsonandBIN_CONFIG_PATHconstant variable inconst.py. - Unneeded
C_COM_EXISTENCE_OVERWRITE, which is useless with the new configuration style. - Unneeded
MODULE_VERSIONconstant variable inconst.py.
v0.1.dev7 - 2022-01-27
LinkerandLinkerMetaDataclasses for the linking step and dependency analysis that is between the logical analysis and code generation/optimisation.- CLI for
parac-build.pyto simplify the building process by allowing for more configuration. This also includes web-download and automatic global installation. requirementsfolder with requirements for each use-case likedev,prodorcommon(base requirements for bothdevandprod).- New function
ProgramCompilationContext.parse_all_files(), which will parse all files. - Parameter
project_rootforBasicProcess,ProgramCompilationContextandProgramCompilationContext, which defines the root of the project structure. This will also be used for relative naming and paths! - New Wrapper class
ParacProjectConfigfor handling json-config files. This is still in work and not going to be properly finished until the compiler core has been done. - Ability to use
loggingwithout having to stick to CLI formatted logging.
- Renamed
build.pytoparac-build.pyto not interfere with thebuildmodule. - Removed the
optimisermodule and replaced it withoptimiser.py. - Renamed class
ParacParseStreamto ParacQualifiedParseStream. - Renamed function
CompileProcess._compile()toci_compile. - Renamed function
CompileProcess._gen_preprocessor_temp_files()togen_preprocessor_temp_files(). - Renamed function
CompileProcess._run_preprocessor()topreprocess_files(). - Renamed parameter
log_errors_and_warningstoprefer_logging. - Updated handling of
ParacCompiler.validate_syntax()to be an entry-point function, which will take as arguments the wanted file path and encoding. This means no longer aBasicProcessorCompileProcessis needed! - Handling of files to use an overall files list defined in
parac-config.json, instead of dynamically fetching using entry files. This means it will be similar to GCC compiler using a pre-defined list of files, and then link all of them together in the end making them ready for execution. - Renamed
Para-CtoParato suit better to its intended feature-set. - Renamed
parac-build.pytopara-build.py. - Renamed all Python classes prefixes
ParactoPara. - Moved
logging.pyCLI functions topara_ext_cli. - Made
ParaCompiler.validate_syntax()an instance method instead of class . method as it needs theParaCompilerruntime propertylogger. - Renamed the class
process.FinishedProcesstoprocess.CompileResult. - Renamed the class
process.ProgramCompilationProcesstoprocess.CompileProcess. - Renamed all items named
LogicTokenandLogicStreamtoParseTokenandParseStream. - Restructured listeners, context classes and parse stream functions to have a more straightforward module structure, while generating a parse stream.
- Property
modeinbin-config.json. - Deprecated
SEPARATORandWINfrom const.py. - Constant Compiler instance
RUNTIME_COMPILER. - Functions related to
c-init, as the C Compiler configuration will from now on be done usingpara-config.json. dist_pathandbuild_pathfolders, as the code-file generation is now handled usingprocess.CompileResultandCompileResult.write_results().- Unneeded
paralang_base.loggingmodule, which has now been completely replaced by the defaultlogginghandling, andparalang_base_cli.logging.
v0.1.dev6 - 2021-11-10
- Updated build-system and added
build.py, which allows proper building with the PBL dummy-entry.py
- Changed behaviour to detect binary mode, by providing the new
file
bin-config.json - Replaced based on the recent implementation changed,
compiler-config.jsonwithbin-config.json, which specifically is configured for the Para-C Compiler, and the OS it was built on.
- Removed unneeded constants:
INVALID_WIN_FILE_NAME_CHARS,INVALID_UNIX_FILE_NAME_CHARSandDEFAULT_CONFIG
v0.1.dev5 - 2021-11-09
initialise_default_pathsinparac.constto initialise the set the const variables DEFAULT_LOG_PATH, DEFAULT_BUILD_PATH and DEFAULT_DIST_PATH. This allows for more customisation for the defaults paths in Para-C and avoids the default paths being wrong after changing the working directory while running.- Property
errorsinBaseErrorListenerfor storing received errors during the parsing process (Both for the Pre-Processor and Compiler). - New Exception
ParaCSyntaxErrorwith proper implementation of error logs. - New Exception
ParaCSyntaxErrorCollectionfor storing multiple SyntaxErrors and report them at once when initialised. - New Util functions:
get_input_stream_from_ctx,get_original_textandget_original_text_from_token. - Implemented SyntaxError handling using the Antlr4 Error Handler - New Error Strategy is to collect all syntax errors and then at the end collect all warnings and errors and display them.
- Support for Whitespaces in the Antlr4 Grammar file to allow for better error messages and separation.
- Function in
util/pathtools.pyensure_pathlib_path, which will convert the passed value to a pathlib.Path, if it's not already one. It will also resolve all sys-links. - Property
parse_streamtoListenerand updated methods to allow for proper future implementation of the logic stream. - New method
append_antlr_ctxto the ABC ClassParseStreamand its implementation. - Addition of
program_ctxto allFileRunContextimplementation classes.
- Style of the init banner in the CLI and added docs link.
- Merged dynamic lists and arrays into the standard iterable type associated
with
type identifier[], which can utilise list functionality, but also practically stay normal arrays at the same time if not resized. For more info see the lang document. - Fixed workdir issue in pytest causing usage outside
./src/pytestto raise errors. - Fixed work-directory issue in
build-exe.pyand rewrote structure to allow runtime in the root directory. - The modules will now commonly use
pathlib.Pathand convert to it if is a different type (str, bytes). - Renamed
validate_file_endingtohas_valid_file_endingand fixed a minor bug replacing theallcall (all file endings must be true) toany, meaning now only one needs to be true, which is the correct and intended way of handling this. - Renamed
compiler-versiontag inparac-config.jsontoparac-version - Renamed the following keywords in ParaC.g4:
_Alignastoalignas_Alignoftoalignof_Atomictoatomic_Booltobool_Complextocomplex_Imaginarytoimaginary_Noreturntonoreturn_Static_asserttostatic_assert__Thread_localtothread_local
- Deprecated
const.SEPARATORand updatedget_relative_file_nameto properly apply to the change - Updated Error message of
RuntimeError(Mismatching file_names) inget_relative_file_name - Changed behaviour of
ParacCompiler.validate_syntax()and removed the additional usage of a listener to walk through the files, even though a simple parse was enough for validating the syntax. - Updated logging messages and added more of them, where they are needed.
- Renamed
parac_clitoparac_ext_cliand published it to pypi - Moved Para-C Base Library data to new repo here
- Deleted the file
entry_cli.pyhere, and moved the function toparac-ext-clihere. This function can now be called usingcli_run(); This means that the main repo and module can only be run as module, and the CLI is a fully separate entity.
list<t>type from the Grammar file.WORK_DIRinparac.constand implemented dynamic fetching to allow for workdir changes while running.- Full Support for extensionTaskLambda (deprecated).
- Deprecated
cleanup_path_str()andcheck_valid_path_name()fromutil/pathtools.py. - Independent rule
entryPointSpecifierin ParaC.g4 - Unsupported C keywords and statements from the grammar file (ParaC.g4):
__extension____builtin_va_arg__builtin_offsetof_Generic(Might be added later again with new syntax)__inline____stdcall__declspec__attribute____asm
- Removed
__typeof__version oftypeoffrom the grammar file (ParaC.g4) - Removed
gotoas it is not supported in the Para-C logic (ParaC.g4) - Return-value
boolfromParacCompiler.validate_syntax()as it is unnecessary with the raised exception when encountering a SyntaxError
v0.1.dev4 - 2021-07-23
- Installation section in the README.md
.parahand.phas valid file extensions
- Wrong license classifier in setup.py
v0.1.dev3 - 2021-07-23
- Tags in setup.py, since commas were missing causing faulty identifiers
- Banner in README.md to avoid the image processing issue on pypi.org
v0.1.dev2 - 2021-07-23
- Pure syntax check command (
parac syntax-check, For info see #9 and #10) - Added const file
const.pyfor containing constant values that are used throughout the module - pypi Module Structure with new parent
parac. Releases from now on will be uploaded to pypi.org as module - Distinction between distribution and module version and const Values
(
const.py)DIST_COMPILED_VERSIONandMODULE_VERSIONfor separating Distribution and Module/Source-Code Version. - Pre-Processor module, including its own grammar and handling for files
- Integration of the compiled Antlr4 lexer and parser in both Pre-Processor and Compiler
- ABC Base Class Files (in module
parac/abc/) for both Pre-Processor and Para-Compiler - New Exception Classes (With appropriate Update
of
class ErrorCodes(IntEnum)):InternalErrorFailedToProcessErrorUserInputErrorFileAccessErrorInvalidArgumentsErrorConfigNotFoundErrorCCompilerNotFoundErrorLexerErrorParserErrorLogicalErrorLinkerErrorUnassociatedErrorUnknownError
- Temp file handling for creating new temporary files after the Pre-Processor finished its processing run. This means the Compiler will receive the modified files and raise errors on the modified ones and not the original ones.
- Process Classes that manage an entire Run of the Compiler:
BasicProcess,FinishedProcessandProgramCompilationProcess - Context Classes that manage the context for a specific file or program (both
Pre-Processor and Compiler):
FileCompilationContext,ProgramCompilationContext,FilePreProcessorContext,ProgramPreProcessorContextwith respective parent ABC classes:FileRunContextandProgramCompilationContext - Implementation of Base ABC Class
ParseStream(inheritslistas parent) remove_comments_from_strinParacCompilerwith support for all line endings- In
abortabledecorator (utils.py);- New argument
preserve_exception: If set toTruepreserves original exception and not raise a new one from it - New argument
abort_on_internal_errors: If set toTrueInternal Errors are treated likeInterruptErrorsand will abort the compilation
- New argument
- Class
InternalErrorInfofor saving information about an exception causing anInternalError - Property
origin_exctoInterrruptErrorfor saving the original exception instance that was raised. - New module
parac_clifor implementing theparacmodule
- Module Structure and added new parent module
paracfor both compiler and preprocessor. - Token Classes and refined items
- In
build-exe.py; Implementedpathlib.Pathusage and proper handling changed based on the new structure - Antlr4 Grammar file to include Pre-Processor statements and the basic entry-file specification syntax
- Updated runtime and added
asyncioimplementation support for running processes async and concurrent as optimisation. - Error codes and exceptions (as stated in the language
document
doc/ParaC-Luna-Klatzer.docx) - Usage of
antlr4.InputStream(string stream) instead ofantlr4.FileStream - Updated tests appropriately to the changes
- Renamed
AbortErrortoInterruptError - Renamed
EntryFilePermissionErrortoFilePermissionError - Renamed
EntryFileAccessErrortoFileAccessError - Renamed
EntryFileNotFoundErrortoFileNotFoundError ParacErrorListenerand let it inherit base ABC classBaseErrorListenerREADME.mdand added appropriate documentation on antlr4, cli and changes- Renamed cli command
inittoc-init - Renamed
parac-base-librarytoliband moved it tosrc/lib - Moved
loggingto base folderparac - Moved
utils.pyand split items into multiple files inparac/util - Renamed
para_exceptions.pytoexceptions.pyand moved it to base folderparac
- pytest option
--github=<true/false>(Became unnecessary and deprecated) - Comment Parsing Support. Comments are now handled over the function
parac.compiler.core.compiler.ParacCompiler.remove_comments_from_str
v0.1.dev1 - 2021-07-04
- Added structure for the core compiler and pre-processor
- Added syntax to the grammar files for the core language and preprocessor directives
- Added basic CLI Interface for interacting with the compiler
- Added compiler structure and place-holder functions for later implementation
- Added examples for implementation and user-code
- Set up a testing structure for the compiler using
pytest - Created testing files for the parser and lexer