Commit graph

36 commits

Author SHA1 Message Date
Eric Swanson
86c0efbc21
Build AST nodes for module function declarations (#239)
Adds enough to build the AST nodes for the module function declarations in a .em file.

Adds:

- Function: base class for module function declarations and user functions
- FunctionParameterDeclaration: declaration for a function parameter, as well as its default value if any
- FunctionParameterList: just a holder for function parameter declarations
- ModuleFunctionDeclaration: for function declarations in .em files
- FunctionResolver: hooks up function calls to module functions or user functions
- ModuleProcessor: a visitor for processing const declarations and module function declarations (const declarations are yet to come from the main branch)
2020-08-23 15:01:39 -07:00
Eric Swanson
81331b7200
Add FloatValue (#233) 2020-08-19 19:43:08 +02:00
Eric Swanson
f0f4fc6f9f
Improve SourceFileCache::keep_some() (#226)
* Log cache prune time

* pair, nth_element, no shared ptr, no string copy
2020-08-16 22:59:13 -07:00
Eric Swanson
50e42719b8
Add file/SourceFileCache (#222)
* Add file/SourceFileCache

Co-authored-by: Fernando Rozenblit <rozenblit@gmail.com>
2020-08-16 17:22:16 -07:00
Eric Swanson
303665bcd8
Add error listener, and convert lexer symbols to lowercase (#216)
Add file/ConformingCharStream - converts symbols to lowercase to match grammar

Add file/ErrorListener
2020-08-14 03:28:37 -07:00
Eric Swanson
6b3fdcb263
Add CodeGenerator stub (#206)
* Add codegen/CodeGenerator stub

* Destructor is trivial
2020-08-11 09:08:48 +02:00
Eric Swanson
72bd179051
Add analyzer/Disambiguator stub (#205)
The Disambiguator will correct the AST based on context.

At present, it needs to handle ambiguities in the grammar between
case group selectors and named break/continue labels.
2020-08-11 08:21:34 +02:00
Eric Swanson
d184dda473
Add Optimizer stub (#203) 2020-08-10 13:54:59 +02:00
Eric Swanson
eb6594b4c6
Add ast/NodeVisitor, analyzer/SemanticAnalyzer stubs (#201) 2020-08-10 10:37:07 +02:00
Eric Swanson
2e1870028b
Add model/CompilerWorkspace, astbuilder/BuilderWorkspace, astbuilder/CompilerWorkspaceBuilder (#200)
Add astbuilder/BuilderWorkspace:
  - Temporary workspace used while building the AST (which goes in the CompilerWorkspace)

Add astbuilder/CompilerWorkspaceBuilder:
  - Builds a CompilerWorkspace for a script

Add model/CompilerWorkspace:
  - Holds AST
  - Holds some intermediate data used by semantic analyzer, optimizer, code generator
2020-08-10 09:42:37 +02:00
Eric Swanson
cc28f4f4f2
Add compiler/ Profile and Report (#193)
* Add compiler/Profile

* Add compiler/Report

* From CR notes: add newline on caught exception.
Also added comments that messages should have a newline at the end.
2020-08-08 16:31:55 +02:00
Fernando Rozenblit
af19074ed4
Update to cpp14 (#188)
* use c++14 on linux, visual studio still undefined which means highest
available

* removed make_unique.h due to c++14 no more needed

* stumbled across pre c++14 code

* Removed use of boost::make_unique<> (updated to C++14)

Co-authored-by: turleypol <turley@polserver.com>
2020-08-05 20:28:07 +02:00
Eric Swanson
49ec52beae
Add ecompile mode: compare old and new compiler output (#187)
* Add -G / CompareCompilerOutput ecompile mode that runs old and new compiler and compares output.
Add LegacyFunctionOrder because parity needs to know how the old compiler ordered functions.

* Fix class/struct mixup, add to cmake sources
2020-08-05 09:01:07 +02:00
Eric Swanson
6e8c7ad074
Add stub for new compiler, with -g and UseCompiler2020 options to select. (#184) 2020-08-05 07:42:46 +02:00
Eric Swanson
e5e87a91f5 Use Compiler& rather than pointer 2020-08-04 00:23:08 -07:00
Eric Swanson
a0e681c841 - Add Facility::Compiler interface for both original and new compiler to implement.
- Make original compiler implement
- Alter ECompileMain to use this interface
2020-08-03 23:11:03 -07:00
Eric Swanson
2ee50ffa8b Removed "verbose" boolean; check compilercfg.VerbosityLevel > 0 instead. 2020-08-03 04:17:31 -07:00
Eric Swanson
8b98737829 Move Compiler.verbosity_level_ to CompilerConfig.VerbosityLevel 2020-08-03 00:31:27 -07:00
Eric Swanson
a0c6007079 Move compiler to Legacy namespace 2020-07-28 19:08:50 -07:00
turleypol
59c816cab1 added ecompile.cfg and cmdline flag to trigger error when include
directives use the wrong capitalization. The existing warning will now
lead to an error when warnings get treated as errors.
2019-10-07 21:01:26 +02:00
turleypol
4ac7f227c7 ecompile now writes errors and warnings to stderr.
exit code is 1 when any compilation fails.
2019-10-05 13:19:38 +02:00
turleypol
ea0c533364 fixed leak in compiler and xml filemod
ecompile/runecl no longer try to log to pol logs
activated xml unittest
print stderr on testfailure
2018-12-23 13:55:47 +01:00
turleypol
ae11a8ae0a its now possible to define the number of threads to be used in ecompile 2018-07-29 15:51:58 +02:00
turleypol
862ce2ba28 Replaced ecompile openmp implementation with TaskPool
uses now more threads to compile faster
ctrl+c can now be used to abort compilation (like I always expected)
2018-04-29 14:44:50 +02:00
Gabriele Tozzi
25bbcc8f01 Updating copyright message 2018-04-02 20:19:07 +02:00
turleypol
3afc41241b
CMake on windows (#48)
CMake can now also be used for windows
2018-02-24 22:34:55 +01:00
turleypol
dbb25bdb62
Include and buildsystem cleanup (#45)
Include cleanup
Reworked buildsystem (Linux only)
Removed dynamic libs, Linux now again uses static linking (like windows)
2018-01-29 21:55:48 +01:00
turley
65231f9bfd use faster overload for string find with single characters 2016-12-15 13:34:06 +01:00
turley
1da37b2523 Fixed program args parsing of runecl
Reenabled and fixed testmode for pol
2016-12-14 17:05:34 +01:00
turley
189cad3479 Formating everything
Authors are not forced to use the clang-format setting, but should
atleast be inspired by the style.
The only thing which is now not allowed are tabs for ident/alignment!
2016-02-19 19:26:35 +01:00
Gabriele Tozzi
dd9985322d Happy New Year :) 2016-01-20 22:28:41 +01:00
Gabriele Tozzi
917e1ce14b Merge branch 'master' of https://github.com/polserver/polserver
Conflicts:
	.travis.yml
	README.md
	pol-core/clib/xmain.cpp
	pol-core/pol/module/sqlmod.cpp
	pol-core/pol/module/sqlmod.h
2015-12-28 10:33:18 +01:00
Thomas Volkert
0a1748835f Removed obsolete code fragment, some more code cleanup 2015-12-27 20:47:53 +01:00
Gabriele Tozzi
5bf416ca24 Merge branch 'cmake'
Conflicts:
- pol-core/clib/xmain.cpp
- pol-core/ecompile/ecompile.cpp
2015-12-18 23:41:43 +01:00
Gabriele Tozzi
24eee9ecf4 Merge branch 'master' of https://github.com/polserver/polserver into cmake
Conflicts solved, still need to test and review it before merging into master.
2015-11-27 06:26:46 +01:00
Thomas Volkert
f1f9fa10b4 Added ecompile again to the build system 2015-11-14 11:40:47 +01:00