Commit Graph

17 Commits (master)

Author SHA1 Message Date
Lukas Werling cd2b8370da Fix warnings in DirectExec crashing (#1990) 2018-02-04 12:33:58 +01:00
Tushar Maheshwari 3a4f49ad90 Revisit #includes
Consolidate the include statements scattered across the code in accordance
with the comment in C4Include.h. The advantages are listed in the same
comment.
Furthermore, it follows llvm-include-order which is the logical
extrapolation of the project's style guideline wherever possible
(C4Include.h being the most-frequent exception).
2017-05-15 13:24:59 +02:00
Nicolas Hake 30c5bb5f8d Aul: Allow the user to selectively enable/disable warnings
This commit introduces a new Aul directive "#warning", which can be used
to enable or disable warnings for a particular piece of code.

"#warning enable" enables all warnings.
"#warning disable" disables all warnings.
"#warning enable empty_parameter_in_call" selectively enables one
specific warning while not affecting any other.

All warnings that used to be controlled by Developer.ExtraWarnings
remain disabled by default.
2017-02-13 15:07:50 +01:00
Sven Eberhardt ebda8193ef Replace NULL by nullptr in C++ sources
We don't support pre-C++0x any more, so nullptr should be fine everywhere (except in the plain C source files)
2016-11-02 19:58:02 -04:00
Nicolas Hake e2fd7095c1 Merge branch 'ast'
# Conflicts:
#	src/C4Include.h
#	src/script/C4AulCompiler.cpp
#	src/script/C4AulParse.cpp
#	src/script/C4AulParse.h
#	src/script/C4ScriptHost.cpp
#	src/script/C4ScriptHost.h
#	tests/CMakeLists.txt
2016-10-20 17:33:02 +02:00
Nicolas Hake 266feeda4d Aul: Add AST generation tests
Just making sure the parser creates the AST the way we expect before we
hand off the code to the codegen.
2016-10-20 17:20:55 +02:00
Nicolas Hake 021a6e89f5 Implement direct execution of whole function definitions
This implements the changes made in c6e4bfd on the AST-based parser.
2016-10-19 14:20:47 +02:00
Sven Eberhardt a7aa89f168 Merge branch 'master' into qteditor
Conflicts:
	planet/Objects.ocd/Structures.ocd/StoneDoor.ocd/SpinWheel.ocd/Script.c
	src/platform/C4WindowSDL.cpp
	src/script/C4AulParse.cpp
	src/script/C4Effect.cpp
2016-06-20 22:27:03 -04:00
Nicolas Hake 092a23c2f7 Aul: Parse scripts into an AST, then generate bytecode from that
This commit contains a fairly substantial rewrite of the C4Script code
generator. Instead of generating bytecode while parsing the script,
we're now parsing the script into a syntax tree, and have any further
processing happen on that instead of the raw source.

At this time, the code generator emits the same bytecode as the old
parser; there are several optimization opportunities that arise from the
new possibility to emit code out of order from its specification by the
author.

Compared to the old compiler, this one is still rather deficient when
dealing with incorrect code; it's also not emitting several warnings
that used to be diagnosed.
2016-05-12 19:43:48 +02:00
Nicolas Hake 7a135a060f C4AulParse: Take GetTokenName out of public interface 2016-05-09 12:21:33 +02:00
Nicolas Hake 0a3b31e735 C4AulParse::AddVarAccess: Move to C4AulCompiler 2016-05-09 12:21:33 +02:00
Nicolas Hake 792e12adad C4AulCompiler: Split into separate file 2016-05-09 12:21:33 +02:00
Nicolas Hake c8d71d47c0 C4CodeGen: Rename to C4AulCompiler
I need to split up C4CodeGen into smaller parts, and having the bit that
actually generates the bytecode named C4CodeGenCodeGen would be silly.
2016-05-09 12:21:33 +02:00
Günther Brammer b8f2d0ca87 Script: Repeat the parser error message when executing a broken function 2016-05-01 00:28:37 +02:00
Günther Brammer 4092911349 Move code generation into its own class 2016-04-28 03:25:47 +02:00
Günther Brammer b00b8554ab Merge branch script 2016-04-28 03:25:44 +02:00
Nicolas Hake cfdb1142b8 Move C4AulParse declaration into separate header 2016-04-24 14:01:23 +02:00