Stefano Sanfilippo
79c4303219
Using PointerSet for modules in monicelli::Program.
2015-03-08 21:37:46 +01:00
Stefano Sanfilippo
19a0c656f2
Refactoring == and hash() operators for nodes that need them.
2015-03-08 21:01:27 +01:00
Stefano Sanfilippo
f933cc3163
Extracting a FunctionPrototype node.
...
This will allow more flexibility in defining externed functions.
2015-03-08 11:25:41 +01:00
Stefano Sanfilippo
e476446e75
Minor refactorings to Nodes.hpp
...
1. Convenience ctor for Id
2. Clean spaces and redudant things.
2015-03-07 14:06:16 +01:00
Stefano Sanfilippo
0f5c138948
Renaming Module::Type to Module::ModuleType for clarity.
...
A monicelli::Type enum is already defined.
2015-03-07 14:05:03 +01:00
Stefano Sanfilippo
bb675a09d7
Adding Type::UNKNOWN
2015-03-07 14:03:07 +01:00
Stefano Sanfilippo
b7be4dc37f
Implementing error handling in emitters.
...
As a result, Emitter iface changes by providing a bool retval.
False means failure and should be managed as such.
2015-03-06 14:29:52 +01:00
Stefano Sanfilippo
5d043566dc
Turn main into an ordinary function.
2015-03-06 13:40:40 +01:00
Stefano Sanfilippo
248afa02c8
Further simplification of the AST hieararchy and Emitter iface.
2015-03-05 22:28:45 +01:00
Stefano Sanfilippo
d7494702af
Simplify the Expression hierarchy by moving the operator on the binary father.
...
As a consequence, the Emitter interface is greatly simplified.
2015-03-05 17:25:02 +01:00
Stefano Sanfilippo
b0a01d2fb7
Decouple AST nodes from representation.
...
1. adding getters to all node properties.
2. extracting an Emitter interface.
3. moving all C++ codegen features to a CppEmitter.
All list template specializations typedefs have been removed for
increased readability.
A dependency on Boost is introduced for boost::optional,
which is required in the AST getters API.
2015-03-05 01:16:40 +01:00
Stefano Sanfilippo
0fb3ea5dd6
Moving pointer stuff to separater header.
2015-03-05 01:09:04 +01:00
Stefano Sanfilippo
9c0a2573c3
Adding simple module dependency analysis.
...
Addresses #14
2014-12-10 20:38:32 +01:00
Stefano Sanfilippo
f148814087
g++ 4.6.x compatibility
2014-12-02 17:28:42 +01:00
Stefano Sanfilippo
2f66c31729
Getting rid of explicit stacks with more left-recursive rules.
...
As a result, the grammar should be more readable.
2014-12-02 16:22:03 +01:00
Stefano Sanfilippo
0a49ccfeca
Emitting prototypes for all declared functions.
2014-11-30 13:05:59 +01:00
Stefano Sanfilippo
76a4e3d7f2
Adding support for functions.
2014-11-30 13:03:45 +01:00
Stefano Sanfilippo
335802c667
Fix license header.
2014-11-29 21:38:52 +01:00
Stefano Sanfilippo
971079b89d
Adding GPLv3 license.
2014-11-29 00:47:50 +01:00
Stefano Sanfilippo
b31feeb4ea
Adding operator << for Type enum.
2014-11-28 20:18:50 +01:00
Stefano Sanfilippo
262508fafd
Using Pointer type instead of std::unique_ptr
...
For now, it's just an alias.
2014-11-28 19:40:47 +01:00
Stefano Sanfilippo
015f8ae6d1
Renaming List to more meaningful PointerList.
2014-11-28 19:37:14 +01:00
Stefano Sanfilippo
7050c5586e
Introducing auto-free List<T> in Node.hpp
2014-11-28 19:32:35 +01:00
Stefano Sanfilippo
e93fef76f1
Freeing Function objects before destroying program.
2014-11-28 19:15:36 +01:00
Stefano Sanfilippo
3facc1c9d4
Getting rid of last C leftovers.
2014-11-28 00:01:24 +01:00
Stefano Sanfilippo
84199887a7
Close all memory leaks.
2014-11-27 23:52:21 +01:00
Stefano Sanfilippo
ce513643da
Strongly typed enum for type tokens.
2014-11-27 21:53:25 +01:00
Stefano Sanfilippo
76ee587672
Use std::unique_ptr whenever possible.
2014-11-27 21:51:20 +01:00
Stefano Sanfilippo
37141d1e7a
Implementing AST nodes.
2014-11-27 20:01:06 +01:00