Commit graph

133 commits

Author SHA1 Message Date
Léonard Gérard c96d05b1eb updated todo and refactoring. 2011-03-21 17:40:59 +01:00
Cédric Pasteur 35775c4131 C backend ported to recent API changes in Obc 2011-03-09 09:46:00 +01:00
Léonard Gérard cab8bb706e backport from async. 2011-03-09 00:06:36 +01:00
Léonard Gérard 159bab2a55 async constants. 2011-03-08 13:41:28 +01:00
Léonard Gérard 9631d9b311 Typing bug fix. 2011-02-14 16:28:50 +01:00
Léonard Gérard 86f743318b Fixes and basic Java main. 2011-02-14 15:21:57 +01:00
Léonard Gérard 8f4411e145 Recursives Qualnames.
In order to have a correct handling of inner classes in Java, and to prepare for modules inside modules.
2011-02-07 14:24:17 +01:00
Léonard Gérard 09419a77a5 again 2011-01-24 16:09:28 +01:00
Léonard Gérard df469db394 New Java backend closing 2011-01-24 16:09:28 +01:00
Léonard Gérard 315527231c Async in Heptagon Minils Obc. 2011-01-24 16:09:27 +01:00
Léonard Gérard d265d7a89b Minimize created exps with invalid_type. 2011-01-12 13:39:21 +01:00
Léonard Gérard e174151d37 Unclutter ident printing. 2010-12-15 11:27:19 +01:00
Léonard Gérard 2ae809c971 Fresh vars, and ident refactoring.
Idents.enter_node should be called when entering a node, it is done automagically by the mapfold unless you call directly Hept_mapfold.node_dec.
2010-12-15 11:26:29 +01:00
Léonard Gérard 9998d7ea39 Added a unit type. Tunit. 2010-12-10 00:39:25 +01:00
Adrien Guatto c7b83b7381 Fixed comparison functions which were blatantly wrong.
Previous versions weren't antisymmetric.
2010-11-10 15:45:41 +01:00
Léonard Gérard 26b30b9bac Small code comments. 2010-11-04 18:07:17 +01:00
Léonard Gérard a22f7216f2 Added when and merge to heptagon. Need tests !
Clocking is still done in minils since it is way simpler.
2010-11-01 01:05:37 +01:00
Léonard Gérard ea4ef2583b Fix print location.
It was not respecting boxes by using a \n instead of a @\n.
2010-10-08 14:34:31 +02:00
Adrien Guatto 6bdca86253 Comparison functions for types, clocks and minils expressions. 2010-09-30 21:39:53 +02:00
Adrien Guatto 3d860c3624 Idents: rename compare to ident_compare 2010-09-30 19:13:43 +02:00
Cédric Pasteur df12e081ae Refactored Misc
Created two new files: 
 - utilities/global/compiler_options.ml: contains
 the options that can be set using the cli
 - utilities/global/errors.ml: contains global
 errors definition

Misc now only contains helper functions that have 
nothing to do with the ast or the compiler.
2010-09-15 09:38:52 +02:00
Léonard Gérard 02db2ad6b4 Changed compile flags, and cleaned a bit.
Warn as error for partial match.
Warn for unused variables : added some TODO to check.
PS : I'll deal with callgraph which is doing things that Modules does.
2010-09-14 09:39:02 +02:00
Cédric Pasteur d8dffe15d8 Fixed remainings non exhaustive patterns
Now the only shown warnings are the X type that 
we don't care about
2010-09-13 16:02:33 +02:00
Cédric Pasteur 1857cb7c47 Identifiers only need to be unique inside a node 2010-09-13 15:20:09 +02:00
Léonard Gérard 412425301a Added Sfield to differentiate from Sconstructor. 2010-09-13 12:05:10 +02:00
Léonard Gérard e0e7bba733 Removed wrong sanity check in modules. 2010-09-13 11:06:42 +02:00
Cédric Pasteur a3e1d8a5f9 Make sure that idents have unique names
Make sure that Idents.name returns two different 
strings for two different idents. This fixes a 
problem with variables in two automaton states 
with the same name (as shown by test/good/name_clash.ept).
2010-09-13 10:18:52 +02:00
Léonard Gérard b5f6593e18 Useful debug printing function. 2010-09-13 01:17:31 +02:00
Léonard Gérard d20a77e181 Removed one nasty bug in modules.ml 2010-09-13 01:14:03 +02:00
Léonard Gérard 937d1f580b Add Warning when encountering not typed expression when cloking. 2010-09-12 23:58:21 +02:00
Léonard Gérard a72ab6fa08 Removed debug g_env printing. 2010-09-12 23:55:54 +02:00
Léonard Gérard 9cc3176771 Modules fixed... Pay $$$ attention to partial application and mutable fields. 2010-09-10 17:11:34 +02:00
Léonard Gérard 1e5697b29a Removed Interface since it's job is now done during the scoping.
Moved printing stuff to Global_printer.
2010-09-10 14:06:33 +02:00
Cédric Pasteur f6fb5861ce Make Typing compile 2010-09-10 13:59:38 +02:00
Cédric Pasteur 1d1f398e8a First try at updating Typing 2010-09-10 13:42:45 +02:00
Léonard Gérard a54e570d0f Hept Scoping should be ok and documented,
Hept Parsing too,
all the reset to review carefully,
Typing to cut from all the scoping.
2010-09-09 19:48:20 +02:00
Léonard Gérard 5c09abeb18 Revet last commit a5f89876c2 and gives the right fix.
Plus remove all the forbidden '\n', replaced with '@.' or '@\n' depending on context.
2010-09-01 14:40:31 +02:00
Léonard Gérard aef39b8036 Callgraph_mapfold polished. 2010-08-24 17:30:19 +02:00
Léonard Gérard 9df4f625a2 Fixed location to use formatter instead of out_channel. 2010-08-24 17:29:00 +02:00
Adrien Guatto 288b0049e4 Improved Obc pretty-printer, still far from perfect. 2010-08-19 12:38:22 +02:00
Léonard Gérard 8bda39eae9 Correct error message with assert false for int_of_static_exp. And some indentation. 2010-08-19 11:28:47 +02:00
Léonard Gérard a3ac71174c Static exp instantiation fix. 2010-08-17 23:30:26 +02:00
Léonard Gérard 4b3c3ba8b5 Revert "Fixed problem in clocking" e3676d1e3c
Fixing the actual bug :
* static_exp should not be created without type
after or during the typing pass.
2010-08-03 22:38:42 +02:00
Léonard Gérard 418b961293 Small fixes to the compilation processes.
*Locations should be pretty damn good now.
*Mlsc is up to date, still need a scoping pass (to be posted soon)
2010-08-02 16:31:57 +02:00
Cédric Pasteur 02dd7fa124 Added alias for types (aka typedef)
For instance:
type metres = int
type metres = MyLib.longueur
type matrice = metres^10^100

Code generation in C (with typedef) included. The 
code uses the aliases for traceability.
2010-07-27 09:23:16 +02:00
Cédric Pasteur e3676d1e3c Fixed problem in clocking
Tuple of consts should have one clock var per 
element. Added a new function const_skeleton to
create this kind of clock.
2010-07-26 15:34:46 +02:00
Léonard Gérard dc9bec28bf Clock refactoring. 2010-07-23 22:13:03 +02:00
Léonard Gérard f124bb4fd7 Refactoring Ident -> Idents ( uniform with Names etc ) 2010-07-23 19:45:19 +02:00
Cédric Pasteur 493f49fe04 Added iterator fusion
For now it only deals with maps but it can be
easily extended. See test/good/itfusion.ept for 
examples of sequences that can be optimised.
2010-07-21 17:19:51 +02:00
Léonard Gérard 5e737d0094 location change. Heptc works with menhir. 2010-07-21 15:15:57 +02:00
Adrien Guatto 2a72628f20 Stricter mk_longname. 2010-07-19 12:02:29 +02:00
Cédric Pasteur ac4e46eff9 Remove debug info 2010-07-16 14:16:31 +02:00
Cédric Pasteur 9f7c4da446 Added missing operator 2010-07-16 14:15:26 +02:00
Cédric Pasteur 778dfdb3f9 Do not loop forever during code generation
- Detect when the computation of the static exp
using simplif failed and abort.
- Added a better way to compute operators in
Static
2010-07-16 12:04:51 +02:00
Léonard Gérard ce4f1916da interface_format_version bump ! 10.... 2010-07-14 02:37:02 +02:00
Léonard Gérard 1c2929078d Small tweaks on the hept_mapfold and comments. 2010-07-14 02:37:02 +02:00
Cédric Pasteur 0d9a35a8b6 Fixed Callgraph_mapfold 2010-07-13 15:37:29 +02:00
Cédric Pasteur ee767064b1 Instantiation of parametrized nodes (v2)
- Many changes to make Hept2mls, mls2obc, etc
compile with the api changes
- Added Callgraph_mapfold: starting from a main
program, generates the list of instances of each
node necessary and creates them.
- Mls2seq deals with giving to the code generators
the correct source (mls or obc, wit or without
static parameters)

It is now possible to use parametrized nodes that 
are defined in other files. For that to work, the 
first file has to be compiled to an object file:
	heptc -c mylib.ept
which creates a mylib.epo file. Compiling the main
file will then generate all the instances of 
parametrized nodes from the lib (only the called 
nodes will be compiled, but all the nodes in the 
main file are compiled).
2010-07-13 14:03:39 +02:00
Cédric Pasteur b8f69492b9 Add mapfold for other types in Signature 2010-07-13 13:55:29 +02:00
Cédric Pasteur 9e7c013fe2 Completion_mapfold
- Added it_gather combinator to create simply
a version of an iterating function using a gather
to combine accumulator values

Completion_mapfold and every_mapfold seems to work
2010-07-09 13:27:06 +02:00
Cédric Pasteur e7bd251b35 Added Global_mapfold and Mls_mapfold
- Global_mapfold is used to iterate over types
defined in Types or Signature (the iterators 
from Types were moved here)
- Mls_mapfold to iterate over Minils AST (we
do not iterate over clocks yet: is it useful ?)
2010-07-09 11:33:17 +02:00
Léonard Gérard 000dc91d69 Heptagon and Types mapfold. 2010-07-08 17:41:00 +02:00
Cédric Pasteur b0a5a7f13e Heptcheck compiles !! 2010-07-08 15:25:26 +02:00
Cédric Pasteur 68ecd0e781 Added consts in the signature of a module 2010-07-08 15:23:13 +02:00
Léonard Gérard 5baa30f7c1 Last refactor ? and hept_mapred shows in ! 2010-07-08 15:22:26 +02:00
Cédric Pasteur 0e224bf368 Port Static to recent api changes 2010-07-08 15:21:30 +02:00
Cédric Pasteur 3690585710 Added static records in static_exp 2010-07-08 15:20:55 +02:00
Cédric Pasteur 662e81d810 Add location and type to static exps 2010-07-08 15:20:25 +02:00
Cédric Pasteur 24cea56666 Add support for any type of constants 2010-07-08 15:18:08 +02:00
Léonard Gérard 5cc57cd3b0 Static_exps should be in types. field name of ops is a param. 2010-07-08 15:17:08 +02:00
Cédric Pasteur 769cb1d881 Updated ast for Static
- Static are used for consts in Heptagon and Minils.
For now, node static parameters remain int only
(ie they are type parameters). Do we need more ?
- Also updated Parsetree AST to the recent changes
in API
2010-07-08 15:16:27 +02:00
Léonard Gérard 3cc1652425 Minils and signature tweaked further. 2010-07-08 15:12:02 +02:00
Léonard Gérard 50bd90183d Good static Constructors names. 2010-07-08 15:10:59 +02:00
Léonard Gérard d58e83a985 Proposition 1. 2010-07-08 15:04:57 +02:00
Léonard Gérard 65c12884bd SConst -> Sconst 2010-07-06 11:12:14 +02:00
Adrien Guatto 5a6a3c74ac Fixed refactoring errors. 2010-07-02 15:38:11 +02:00
Léonard Gérard 0ae39e8698 Good static Constructors names.
Conflicts:

	compiler/global/static.ml
	compiler/heptagon/analysis/typing.ml
	compiler/heptagon/heptagon.ml
	compiler/heptagon/parsing/scoping.ml
	compiler/minils/mls_utils.ml
2010-07-01 20:00:46 +02:00
Cédric Pasteur b4419a6760 Better deal with memory less nodes
There are now 3 kinds of nodes: Eprim : primitive 
nodes, Enode: nodes with memory, Efun: nodes 
without memory.

Typing now sets correct eq_statefull and b_statefull
for equations and blocks. Resets are only added 
when a node with memory is called.

The calling convention is the generated code needs
to be modified so that we can remove the context 
for nodes without memory.
2010-06-30 13:37:54 +02:00
Adrien Guatto f35bf95458 Indentation fixes! 2010-06-29 11:18:50 +02:00
Léonard Gérard 0f2d046d59 Gros blop pour que Mlsc compile.
-* Séparation du fichier minils avec création de mls_utils
-* Lexer et Parser qui fonctionnent (pas complets encore)
-* Use of menhir with --explain pour debug du parser
-* Quelques refactoring (ident/name...)
2010-06-28 18:06:39 +02:00
Adrien Guatto b4ddefa65c Tabs, trailing ws and long lines shall receive no mercy! 2010-06-26 17:17:28 +02:00
Léonard Gérard 9fff8e4ad8 Refactoring and organisation.
Separate parser, lexer and printer of hpetagon (Hetp_*) from the minils ones (Mls_*)
ident_of_var -> ident_of_name
get_current_location -> current_loc
2010-06-24 03:30:14 +02:00
Léonard Gérard 60a3ad15f8 move to subfolder compiler. 2010-06-21 11:58:57 +02:00