Directory Compiler/absyn_builder/

Total Files:
Deleted Files:
Lines of Code:


Lines of Code

Compiler/absyn_builder/ Lines of Code


Author Changes Lines of Code Lines per Change
Totals 121 (100.0%) 2906 (100.0%) 24.0
adrpo 57 (47.1%) 1011 (34.8%) 17.7
petar 19 (15.7%) 812 (27.9%) 42.7
dietmarw 7 (5.8%) 511 (17.6%) 73.0
Frenkel TUD 11 (9.1%) 222 (7.6%) 20.1 16 (13.2%) 185 (6.4%) 11.5
kajny 6 (5.0%) 157 (5.4%) 26.1
x05andre 1 (0.8%) 4 (0.1%) 4.0
g-pavgr 1 (0.8%) 2 (0.1%) 2.0
petfr 1 (0.8%) 1 (0.0%) 1.0 2 (1.7%) 1 (0.0%) 0.5

Most Recent Commits 2010-09-21 12:34 Rev.: 6159

- Fix svn-eol-style on Makefiles

1 lines of code changed in 1 file:

  • Compiler/absyn_builder: (+1 -1) 2010-09-01 11:24 Rev.: 5991

- Update handling of Absyn.IFEXP in the old parser and Static (we now have support for else-if branches in elabExp)

1 lines of code changed in 1 file:

  • Compiler/absyn_builder: walker.g (+1 -6) 2010-07-10 18:21 Rev.: 5842

- Propagate Absyn.Info from every equation and algorithm up to the DAE AST
- One exception: The parser segfauls on Absyn.Algorithm in mosfiles, so dummyInfo is provided for most algorithm sections.

27 lines of code changed in 1 file:

  • Compiler/absyn_builder: walker.g (+27 -91) 2010-07-07 11:54 Rev.: 5821

- Added Absyn.Info field to Absyn.{Equation,Algorithm}Item
- Renamed SCode.Algorithm to SCode.AlgorithmSection since that is what it is
- Added new datatype SCode.Statement, which is what an AlgorithmSection contains lists of
- All statements have comment and info fields preserved so they can be used by Inst/Error

6 lines of code changed in 1 file:

  • Compiler/absyn_builder: walker.g (+6 -6)
petfr 2010-06-21 21:47 Rev.: 5704

- fix the compilation of absyn_builder lib

1 lines of code changed in 1 file:

  • Compiler/absyn_builder: Makefile.omdev.mingw (+1 -1) 2010-06-11 16:52 Rev.: 5648

- ANTLR parsers updated

15 lines of code changed in 2 files:

  • Compiler/absyn_builder: (+8 -6), Makefile.omdev.mingw (+7 -5) 2010-06-11 16:20 Rev.: 5647

- Fix bug in absyn_builder make target

7 lines of code changed in 2 files:

  • Compiler/absyn_builder: (+5 -6), Makefile.omdev.mingw (+2 -3) 2010-06-11 09:12 Rev.: 5639

- Fix for Makefile ANTLR dependencies with parallel makefiles
- Now says "Nothing to be done for `all'." instead of running ANTLR regardless

49 lines of code changed in 2 files:

  • Compiler/absyn_builder: (+26 -6), Makefile.omdev.mingw (+23 -5) 2010-06-01 13:39 Rev.: 5620

Added /LTCG switch to the makefiles for visual studio.

1 lines of code changed in 2 files:

  • Compiler/absyn_builder: (new) 2010-04-22 06:52 Rev.: 5349

- Adding OMC_API-HowTo to install target.
- Updating java_interface makefiles (better clean-up and works without setting JAVA_HOME).
- Removing temporary antlr grammar files when configure script fails.
- Fixed doc install path for UNIX systems.
- Remove generated code when doing make clean in Compiler/runtime, Compiler/absyn_builder.
- Remove generated makefile in c_runtime/sendData.

1 lines of code changed in 1 file:

  • Compiler/absyn_builder: (+1 -1)
adrpo 2010-04-13 06:23 Rev.: 5299

- added operator record to the grammar / walker / (from Modelica 3.2).

6 lines of code changed in 1 file:

  • Compiler/absyn_builder: walker.g (+6 -1)
Frenkel TUD 2010-04-08 16:18 Rev.: 5278

- CMakeFiles now work on win32 and linux to generate omc executable.
- Linux define RLMHOME, point to your rml install path
- win: define OMDEV environment variable, point to your OMDev installation
- Attention: because function rml_user_gc is defined at rml.lib you can
- at force flag to TARGET_LINK_LIBRARIES(omc rml) (for win32 -> TARGET_LINK_LIBRARIES(omc -FORCE:MULTIPLE rml))
or - rebuild rml lib without function rml_user_gc

23 lines of code changed in 1 file:

  • Compiler/absyn_builder: CMakeLists.txt (+23 -17)
Frenkel TUD 2010-03-31 17:25 Rev.: 5247

- update CMakeFiles for linux

23 lines of code changed in 1 file:

  • Compiler/absyn_builder: CMakeLists.txt (+23 -11)
Frenkel TUD 2010-03-30 17:02 Rev.: 5237

- update CMakeFiles, start with testsuite

1 lines of code changed in 1 file:

  • Compiler/absyn_builder: CMakeLists.txt (+1 -1)
Frenkel TUD 2010-03-29 11:59 Rev.: 5232

- CMakeFiles: install omc, libs, docs, testmodels, includes

0 lines of code changed in 1 file:

  • Compiler/absyn_builder: CMakeLists.txt (-6)
Frenkel TUD 2010-03-29 10:43 Rev.: 5231

- CMakeFiles work with VisualStudio but generated omc.exe wound work because of qt problems

2 lines of code changed in 1 file:

  • Compiler/absyn_builder: CMakeLists.txt (+2 -2)
Frenkel TUD 2010-03-27 20:52 Rev.: 5227

- continue with CMakeFiles

3 lines of code changed in 1 file:

  • Compiler/absyn_builder: CMakeLists.txt (+3 -1)
Frenkel TUD 2010-03-26 17:05 Rev.: 5224

- update CMake Files, now only the linker fails because of
runtime.lib(systemimpl.obj) : error LNK2005: _rml_user_gc ist bereits in librml.lib(p-usergc.obj) definiert.
>msvcprt.lib, MSVCRT.lib, error LNK2005: __errno ist bereits in LIBCMT.lib(dosmap.obj) definiert. ...

2 lines of code changed in 1 file:

  • Compiler/absyn_builder: CMakeLists.txt (+2 -1)
Frenkel TUD 2010-03-26 13:06 Rev.: 5217

- update CMake Files, now only the linker fails

20 lines of code changed in 1 file:

  • Compiler/absyn_builder: CMakeLists.txt (+20 -29)
Frenkel TUD 2010-03-26 00:01 Rev.: 5212

- continue with CMakeFiles

19 lines of code changed in 1 file:

  • Compiler/absyn_builder: CMakeLists.txt (+19 -6)
Frenkel TUD 2010-03-25 16:51 Rev.: 5209

- update CMake Files

30 lines of code changed in 1 file:

  • Compiler/absyn_builder: CMakeLists.txt (+30 -9)
Frenkel TUD 2010-03-25 01:06 Rev.: 5200

- add CMakeFiles to build omc with CMake (not yet finished)

99 lines of code changed in 1 file:

  • Compiler/absyn_builder: CMakeLists.txt (new 99)
adrpo 2010-03-17 14:43 Rev.: 5158

- Updated parser/lexer to support 'operator' and 'operator function'.
The keyword 'operator' can also be used as an identifier in several
places so we can parse the OpenModelica compiler sources. We can
change the sources and replace 'operator' with 'op' or something
similar later.
- RollingWheelSetPulling.mos now flattens without error.

68 lines of code changed in 1 file:

  • Compiler/absyn_builder: walker.g (+68 -24)
adrpo 2010-01-22 01:44 Rev.: 4848

- updated Copyright (c) text to 2010
- replaced some of the leftover BSD licenses.

4 lines of code changed in 6 files:

  • Compiler/absyn_builder: expression_parser.g (+1 -1), walker.g (+1 -1), yacclib.c.txt (new), yacclib.h.txt (new)
adrpo 2010-01-22 00:45 Rev.: 4847

- updated Copyright (c) text to 2010

1 lines of code changed in 1 file:

  • Compiler/absyn_builder: parse.cpp (+1 -1)
petar 2009-11-25 14:42 Rev.: 4576

-Reset the modelicafilename string when failing to parse

1 lines of code changed in 1 file:

  • Compiler/absyn_builder: parse.cpp (+1)
adrpo 2009-11-20 09:45 Rev.: 4545

- fixes for some of the OMDev makefiles (Makefile.omdev.mingw)

2 lines of code changed in 1 file:

  • Compiler/absyn_builder: Makefile.omdev.mingw (+2 -2) 2009-11-19 12:03 Rev.: 4542

- Don't recompile the walker unless something changed.

6 lines of code changed in 2 files:

  • Compiler/absyn_builder: (+3 -3), Makefile.omdev.mingw (+3 -3) 2009-11-19 11:10 Rev.: 4541

- Removed the need to set CLASSPATH when building under Linux.
- Updated configure script to not check for CLASSPATH (it only checks that Java exists and can load the provided antlr).
- Updated the lexer/parser makefiles to run with parallel jobs.
- Warning: Due to RML creating and using .srz-files from all imported packages, parallel execution of make may in some rare cases fail. Running make again will work because the other process will have cached the srz-files.
It is possible to generate all srz-files in advance at the cost of efficiency (you may not do this is parallel, and it's not necessary if the number of jobs=1).
- Warning: RML drains a lot of RAM. Running "make -j" launches an unlimited number of jobs. This will eat about 20GB of RAM and possibly crash the system, so don't do this. Max 1 job per GB of RAM is recommended.

38 lines of code changed in 2 files:

  • Compiler/absyn_builder: (+18 -12), Makefile.omdev.mingw (+20 -10)
adrpo 2009-11-18 12:44 Rev.: 4536

- added operator (function)? to lexer/parser/walker but is commented out.
we will uncomment it when is needed.
- added operator (function)? to Absyn and SCode (not used as it doesn't come from the

- split into and
- remember comments from enumerations, derived, etc from Absyn into SCode

- unified Ceval.cevalCallFunction to handle all types of possible
function evaluation: via Cevalfunc, via dll generation, etc.
- enabled Cevalfunc by default in Ceval.cevalCallFunction
- added test for matrix row indexing

- all tests go but meta/* which displays
correct values but in a different way, which I think
is due to evaluation via Cevalfunc. I disabled it for

6 lines of code changed in 1 file:

  • Compiler/absyn_builder: walker.g (+6 -2)
petar 2009-11-17 15:40 Rev.: 4533

-Finally (puhh) fixed bug with forgetting to reset modelicafilename when parse error occurs.

6 lines of code changed in 1 file:

  • Compiler/absyn_builder: parse.cpp (+6)
adrpo 2009-11-12 19:22 Rev.: 4503

Merged revision 4500

Revision: 4500
Author: petar
Date: 14:44:04, den 12 november 2009
-Fixed bug with not resetting global file name when parser error.
Modified : /branches/MathCoreOSMC/Compiler/absyn_builder/parse.cpp

1 lines of code changed in 1 file:

  • Compiler/absyn_builder: parse.cpp (+1)
adrpo 2009-11-09 06:31 Rev.: 4470

- correctly build the expandable connector restriction
- moved expandable to class restriction rule

2 lines of code changed in 1 file:

  • Compiler/absyn_builder: walker.g (+2 -3)
adrpo 2009-10-27 10:08 Rev.: 4402

- made parser/walker/ to handle failure and equality in the algorithm section
- do not dive into DERIVED classes when querying internal classes in;
is not correct to dive into derived classes and if we do then we run into stack overflow;
Example: lookup of Env.Env in Env.Env.

22 lines of code changed in 1 file:

  • Compiler/absyn_builder: walker.g (+22 -14) 2009-10-19 14:01 Rev.: 4370

- Merged revisions 3852-4247 of the Bootstrapping branch
- Support for external Java functions
- Typed Java interface to OpenModelica functions using CORBA
- Improved MetaModelica list,tuple,option,uniontype implementations
- MetaModelica matchcontinue expressions
- MetaModelica function references
- Partially evaluated functions
- Improved Record handling
- Improved handling of NORETCALL functions (mainly used in MetaModelica)
- Note that the MetaModelica, Java and Records testcases are not fully working after the merge

Revision: 4347
Author: stebr461
- Another fix

Revision: 4346
Author: stebr461
- Fixed the windows makefile

Revision: 4340
Author: stebr461
- small fix to previous commit

Revision: 4339
Author: stebr461
- Partially evaluated functions now a separate module

Revision: 4325
- Fixed meta testsuite when using 64-bit Linux

Revision: 4324
- Changed the matchType subsystem. It now passes a function pointer to either matchTypeRegular or matchTypePolymorphic.
- The polymorphic functions that work now are any input, and list,tuple,option,TypeA output.
- Implemented the Builtin list functions using polymorphic types rather than special cases during elaboration.

Revision: 4320
- Added initial support for polymorphic functions. This version doesn't check if the polymorphic type gets bound to another type, or if complex types use polymorphic types within themselves and so on. Further support should be added in Types.matchTypePolymorphic.
- elabCallArgs, etc was extended to pass around PolymorphicBindings; a list of all types that have been bound by the polymorphic function.
- Fixed builtin function clock() (was previosuly only mmc_clock()).
- read_write.c has support added for INT,REAL,etc as input when we expect MMC type.
- The walker was changed to parse replaceable Type_a subtypeof Any to type Type_a = polymorphic<Any> (this fits better internally)

Revision: 4306
- Fixed equation-patterns that look like exp = {true,false}. cref = {true,false} still works as expected.
- Fixed some problems when type aliasing for example type B = list<A>; (07_pam will test this when the complete file is working).

Revision: 4302
- Added the AssignTwoType MetaModelica example. No major issues here, only outdated code (int_real instead of intReal and so on).

Revision: 4299
- Changed simulation_result implementation to use C fprintf instead of C++ iostream. The new implementation is roughly 5 times faster using GCC.

Revision: 4298
- Fixes a bug when pattern matching equations that aren't tuples

Revision: 4297
- Changed unused VALUEBLOCKEQUATIONS to VALUEBLOCKMATCHCASE (contains both algs and equations)
- Moved Patternm.fromEquationsToAlgorithms to Static. They are now translated when the VALUEBLOCK is elaborated since we then have access to the correct environment.

Revision: 4295
- Added support for equation patterns like 2 = 1+1; or 2 = listGet({2},1);
- This uses Static.elabExp within matchcontinue cases. But the local declarations have not been added to the environment. Thus, if you use local variables (very common), the translation from equations to algorithms needs to be performed before we can try to elaborate. I will try to create a new VALUEBLOCK type for matchcontinue cases.

Revision: 4290
- Added support for generating errors and error messages when local variable declarations shadow input/result of a matchcontinue expression

Revision: 4288
Removed ALG_EQUALITY from the walker

Revision: 4284
- Changed the parser to not accept equality(...) for algorithms. It doesn't work in RML, is deprecated, and == already works.
- Changed the parser to accept equality(lhs, rhs) and equality(lhs = rhs) instead of any arbitrary equation
- The walker will translate equality(...) to Absyn.CALL("equality",{lhs,rhs})
- ALG_EQUALITY and EQ_EQUALITY have been removed

Revision: 4281
- Added testcase for the added support of failure(...)
- Fixed issues with builtin list functions not converting arrays like {1} directly

Revision: 4279
- Commented out ALG_FAILURE in walker.g

Revision: 4273
- Added a printAny function in the C runtime for debugging (create an external C function that takes any boxed datatype and apply printAny on it).
- Added the first 3 assignments from the MetaModelica Dev course, as working testcases (01_experiment is disabled by default because looking up constants in packages is very slow right now). They each have their own directory because they supply their own lexers and parsers. They also provide some basic instructions on how to follow the course themselves (make changes to code, type make and see what happens).
- Added ceval for builtin MetaModelica type conversions (intReal, etc).
- Added code in Patternm to convert EQ_FAILURE to algorithmic code; removed unused Absyn.ALG_FAILURE.
- Updated code for THROW/TRY/CATCH structures in Algorithm/etc.
- Renamed builtin realInteger to realInt (as in RML and the specification).

Revision: 4263
- Added cases for NORETCALL and UNIONTYPE when conveting between DAE.DAE and Exp.DAE

Revision: 4252
- Bugfix for SCode.componentNamesFromElts (when the list contains more than elements; fixes bug in Inst.extractConstantPlusDeps)
- Support for generating the proper list type from a Values.LIST
- Moved the typeConvert (Types.Type to Absyn.TypeSpec) to MetaUtil
- Support for pattern matching of union types and records existing in another package than the one the matchcontinue expression is in
- Static.valueExp: Added cases for METARECORD and LIST
- Types.T_UNIONTYPE now contains a list<Absyn.Path> instead of String
- Types.T_METARECORD now contains no String or Absyn.Path. This is saved in SOME(Absyn.Path) instead

Revision: 4248
Author: stebr461
- Partially evaluated functions now work with recursive functions.

Revision: 4226
- Fix list constructor to calculate the resulting type better: myTup := (1.0,3.5); {myTup,(1.0,3.5)} {META_TUPLE,TUPLE} -> list<META_TUPLE>
- Some fixes for constants that are using MetaModelica types (ceval->value->exp)
- Started on some builtin array functions

Revision: 4224
- Fixes compilation error when allocating boolean and string arrays

Revision: 4218
- Fix for generating recursive functions (both Modelica and MetaModelica)

Revision: 4217
- Better support for calling NORETCALL functions from Interactive
- Added builtin boolean functions
- Added builtin print,if_exp,tick and clock
- Removed listCar (use listGet instead; it's listed as an actual MetaModelica builtin...)
- Renamed listCdr to listRest, intended to be a builtin list operator
- Added builtin functions for listEmpty and optionNone (renamed; were used for pattern matching but may as well be builtin functions...)

Revision: 4212
- Added MetaModelica builtin Integer operations

Revision: 4211
- Added MetaModelica Builtin Real Operations

Revision: 4210
- Added the MetaModelica builtin String and String Character Conversion operations

Revision: 4209
- Added pattern matching of reals
- Added a few MetaModelica builtin String functions

Revision: 4208
- Type conversion boxes Int,Real,Bool,String when needed (for example when doing listMember(list<Integer>,Integer))
- Added (polymorphic) builtin list functions: listAppend, listReverse, listLength, listMember, listGet, listNth, listDelete. The builtin handler calculates the correct result type.

Revision: 4206
- Added failing testcase MatchCase10

Revision: 4205
- Pattern matching of calls that use mixed positional and named args
- Unboxing of reals

Revision: 4202
- Fixes problems with the SOME(tuple) and tuple::rest constructors

Revision: 4201
- Added support for uniontype calls in matchcontinue pattern matching

Revision: 4199
Author: stebr461
-Partially evaluated functions now works properly

Revision: 4197
- Added support for pattern matching records (not uniontypes) in matchcontinue expressions
- Added support for case-local variable declarations in matchcontinue expressions

Revision: 4196
- Fixed compilation error in last commit

Revision: 4195
Added better support for NORETCALL functions
Added better type checking for unboxing of boxed datatypes (for example: listCar of list<Integer> using the new builtin handler returns T_BOXED(T_INTEGER), which can be typecast to a regular integer)
Added (better) support for pattern matching of tuple, list and option
- Added equality operator for boxed datatypes
- listCar/listCdr now check for listEmpty before doing the operation
- Added MetaModelica builtin print
- Added mmc_unbox builtin call
- Algorithm.NORETCALL instead contains an Exp.CALL. This allows it to contain builtin calls

Revision: 4193
Author: adrpo
- fixed parsing of lists such as: 1::2::3::x.

Revision: 4185
Absyn.ALG_MATCHCASES, Exp.MATCHCASES, Algorithm.MATCHCASES: New expression type that Absyn.MATCHEXP is translated into., Generates code for the new MATCHCASES datatype. It's designed to use a for-try-switch design of matchcontinue. The C code is a lot simpler than the one used before (state machine with goto and a boolean array to try and track patterns that have already been performed).
CevalScript.cevalInteractiveFunctions: Added setLinker, setLinkerFlags. API calls that allow you to change compiler to g++ (useful when compiling matchcontinue expressions since it uses try/catch). Added String/List equality operators Added List equality operators
Util.listlistTranspose: "{{1,2,3}{4,5,6}} => {{1,4},{2,5},{3,6}}"
c_runtime/meta_modelica.{c,h}: Added mmc_boxes_equal. Used to compared boxed datatypes (always returns true for now...)

Revision: 4183
- Added expected results for PartialFn{5,6}.mos

Revision: 4176
Author: stebr461
-First batch of changes for partially evaulated functions
-Main functionality is in SCode.elaborate, which calls a whole barrage of functions in
-elabPartEvalFunction and a case for it added to
-Various utility functions added to other modules

Revision: 4173
Added some complicated types/type constructors in testsuite/meta/ComplicatedInteractive.{mo,mos}
{ClassInf,Static}.mo: Added META_RECORD. Rather than having a specialized function in MetaUtil, the regular OpenModelica functions are used to create a METARECORDCALL.
Exp.getFunctionCalls: Added META_TUPLE, META_OPTION to the list of expressions to searchMetaUtil.typeMatching: Changed to return a type instead of a boolean. The function will return the supertype of all other list arguments (before this list(NONE,SOME(1)) resulted in list<NOTYPE> instead of list<Integer>). Changed some of the matchType-related functions to properly subtype/convert options/lists.

Revision: 4172
runtime/systemimpl.c: Updated to use Values.META_TUPLE
testsuite/java: Updated for the partially working MetaModelica list/tuple Fixed failtrace
Codegen.generateExpression: META_TUPLE code now generates tuples instead of lists.
Codegen.generateRWType: Generates TYPE_DESC_MMC for LIST and META_TUPLE
Ceval.ceval: Exp.{TUPLE/META_TUPLE} -> Values.META_TUPLE
Interactive.evaluateAlgStmt: Added the possibility to assign results of type T_TUPLE to a variable
MetaUtil.fixMetaTuple: Helper to fix the type when Ceval returns Values.META_TUPLE and you thought the CREF pointed to a Types.T_TUPLE
MetaUtil.mmc_mk_box: New function that creates the correct mmc_mk_box(<n>, ...) or mmc_mk_box<n>(...) depending on the value of <n> Check type of a Types.Properties using the existing functions instead of PROP(ty, _) = ... This allows us to check for tuples as well.
Types.unparseType, Types.printTypeStr, Types.getAllExpsTt: Added META_TUPLE analogous to TUPLE
Types.typeConvert: T_TUPLE->T_METATUPLE Added listThreadMap32 (3 lists to 2 lists)

Revision: 4161
- Added support to type convert matrices/arrays to lists. This works
for the array constructor as expected, but also allows you to use variables
that are arrays and get them automatically converted to lists (not desired, but
they use identical Exp.Exp and cannot be differentiated).

Revision: 4160
- systemimpl.c: Fixed list copying by doing it in reverse order (and updating
java_interface.c to do the same).
- Added a (very) simple type conversion from ARRAY to LIST. It has
only been tested for one-dimensional arrays so far.
- Added ceval for the LIST type.
- It is now possible to call (simple) functions that expect list input using
the Interactive module.

Revision: 4132
Revision: 4132
- Changed Java org.modelica to org.openmodelica

Revision: 4107
- Absyn.ALG_WHEN_A: Changed the name of the field "whenStmt" to "boolExpr"
since it better reflects the function.

Revision: 4106
- Added Exp.TUPLE to ceval (if MetaModelica grammar is activated)

Revision: 4105
- Setting eclipse project default to ISO-8859-1 encoding because the UTF-8
default changes special characters to multi-byte format. This changes .mo files
even if you don't modify the header.

Revision: 4104
- Absyn.ALG_WHILE: Changed the name of the field "whileStmt" to "boolExpr"
since it better reflects its function.

Revision: 4103
* Added testcase/meta/OptionInteractive.mos: Functions with Option type
in/output are now working, as well as any expression returning an Option type
in the Interactive interface.
* Compiler/runtime/systemimpl.c: Values__OPTION to type_desc conversion
* c_runtime/modelica.h: Replaced modelica_uniontype with metamodelica_type
* c_runtime/read_write.h: Replaced {read,write}_modelica_{uniontype,mmc} with
* Types.typeConvert: Added placeholder and debug message for T_ARRAY->T_LIST
* Compiler.expTypeStr: Changed from void* and modelica_uniontype to metamodelica_type
* Inst.getUsertypeDimensions: Changed from "option" to "Option"
* Added cases for T_METAOPTION/Exp.META_OPTION
- Types.unparseType
- Types.getAllExpsTt
- Ceval.ceval
- Exp.printExp2Str

Revision: 4102
- Normalized the copyright notice to ISO-8859-10

Revision: 4096
Author: stebr461
- Added functionality for Absyn.Exp.PARTEVALFUNCTION to the Dump module

Revision: 4095
Author: stebr461
- Tweaked the grammar rules a bit
- Added new data structure to Exp.Exp for partially evaluated functions
- Added functionality for this data structure to many functions in Exp

Revision: 4094
- Fix testcase/meta/Uniontype13.mos (Uniontype in Record). Broke after merge with Mathcore

Revision: 4092
- Codegen.generateExpression: Using "mmc_mk_none()"/"mmc_mk_some(x)" when
generating C code instead of "mmc_mk_nil()" and "x".
- Exp.typeof: Added cases for OPTION/TUPLE, and fixed the cases for LIST/CONS.
Previously, the type of a LIST(ty=INT) was INT instead of T_LIST(INT)...

Revision: 4088
Author: stebr461
- added more tests

Revision: 4087
Author: stebr461
- Added grammar rules for partially evaluated functions
- Added a new record to Absyn.Exp for partially evaluated functions
- Added cases to Absyn.traverseExp, Absyn.getCrefFromExp and Absyn.findIteratorinExp for the new record
- Added test cases for functions whose arguments have default values, and partially evaluated functions as arguments
- Fixed a typographic error in that prevented compilation

Revision: 4077
- Added annotation(JavaMapping="simple") to external Java
functions. This handles only int,double,bool,String and max 1 output value.

Revision: 4076
- Fix Java testsuite makefile for OMDev

Revision: 4075
Message: can now translate all .mo-files in Compiler to
a single JAR file.
- {Inst,DAELow,Mod}.mo: Fixed syntax errors
- Removed and the list of generic types in
functions/records. These now look up all variables and add all generic types
to a string instead (used by the templates directly).
- Interactive.getDefinitions: Correct behaviour when trying to filter out
functions (and speeds up the generation in general).

Revision: 4074
- DFA/ Uses list<tuple<type_a,type_b>> instead of
- Interactive.getDefinitions: Don't add const components to the returned tree.
Also uses the Print buffer to speed up a bit.
- ModelicaString: Uses StringBuffer instead of concatenating 80kB strings byte
by byte.

Revision: 4073
- Updated the Java testsuites for OMDev

Revision: 4072
- Fixed the output to the expected
"(type XYZ list<ABC>)" - it was "(type XYZ list)".
- Fixed new Class[] to new java.lang.Class[] (in case a package
contains a record named Class; like does)

Revision: 4070
- Compiler/ Fixed syntax in some unused functions ( is parsed in
the Java testsuite)
- Added the sources and test suite for modelica_java.jar
* make test (in c_runtime/java_interface) runs a jUnit testsuite
* make jar (n c_runtime/java_interface) creates the jar-file (it is not run
by running make in the source root)

Revision: 4068
- Interactive.getDefinitions: Changed the syntax slightly to be more
consistent (LISP-style trees all the way; this made the parser a bit simpler).

Revision: 4067
- Cleaned up in external Java (no more getJavaMethod calls). This makes it
easier to spot which line failed in the C file.
- Fixed bugs when structs/string pointers are not initialized by GCC
- Added support for multiple output uniontype variables

Revision: 4066
- Updated the ext Java dummy test for Win32 and fixed a bug in the jni_md include

Revision: 4065
- Added a dummy test for Java external. This tests the datatypes we currently
can't use OMC (list,option,tuple).

Revision: 4064
- Changed the NONE() representation to use ctor=1 (so it doesn't share it
with the empty list). Only Boolean values seem impossible to distinguish
- java_interface.c:
* Added jobject_to_mmc so any object can be turned into a list, tuple,
record och option.
* Added ctor_index value to the Java ModelicaRecord.
OMCModelicaRecord (which OMC creates) has index -1 for regular records
and >=0 for uniontypes. -2 (default for ModelicaRecord) means a warning
is printed when the record is returned as a uniontype (because type checking
can't be done). The automatically generated interface override get_ctor_index,
so any records created with known "good" records won't generate warnings.
- Uses MetaUtil.createMetaClassesInProgram to create the
meta classes instead of parsing this in Java code.

Revision: 4062
Author: stebr461
- Builtin functions can now be passed as arguments in function calls
- Added test case for passing record constructors as function arguments

Revision: 4061
- Added NewJavaMMC to java_interface.[ch]. It currently only handles
uniontype, integer, real and string.
- Added a field with the record name (rather than path) to the
record_description datatype.
- Added support external Java functions with uniontype arguments (but not
result types yet).
- Added a dummy interface IModelicaRecord which tags ModelicaRecord and is
used as the input type of external Java functions taking uniontypes (because
uniontypes are interfaces, they cannot inherit from ModelicaRecord).

Revision: 4060
Added code for TYPE_DESC_RECORD inside another TYPE_DESC_RECORD. Also added
record-in-record support for external Java functions.
- In read/write_modelica_record, pass the fields of the inner
records rather than the full struct as a single argument.
- read_write.c: In order for read/write_modelica_record to work when calling
the function recursively, the functions were split in 2 (one helper function
each). The first function starts the varargs and passes a pointer to it
in each subsequent call.

Revision: 4059
- read_write.[ch]: Added (and tested) the MetaModelica types in regular
- Codegen.generateType: Added case for uniontype
- Inst.daeDeclareComplexVarType: Added case for uniontype (and a warning
message if it fails - finding out this was the function that failed was
really hard because the compiler will then just output an empty DAE).

Revision: 4058
- read_write.[ch]: Changed from passing strings for record and field names
to using the record_description struct.
- Disabled cevalFunction (its record constructor doesn't work with
all types, and turning it on means you don't see error messages from the
compiled version)
- Generate code that uses record_description instead of field names
from read/write_modelica_record
- Inst.instClass: ty = MetaUtil.createUnionType(c,SOME(ty)); instead of
keeping this in Inst.instElement (other parts of the code also needs to
check for uniontypes...).
- Inst.instElement: Removed the special case for uniontype components.
The general case works fine with the changes to instClass and daeDeclare.
- MetaUtil.createUnionType: Takes a class and a type. If the class has
R_UNIONTYPE restruction, create the correct type, else use the given type.

Revision: 4057
Fixes uniontype constructors in packages, called from a different scope.
- Static.elabCallArgs: Uniontype constructors now send the correct environment
to MetaUtil.createFunctionArgsList (instead of the environment of the call).
- MetaUtil.listToBoxes: Because the name is a String, we need to convert
all dots (.) to underscores (_). The problem is Exp.COMPLEX uses strings
for the name, and not Paths.

Revision: 4056
- Added code in MetaUtil to translate the whole Absyn.Program to use
uniontypes instead of just the classes in the global scope.
- SCode.elaborate: Now 2 functions. The first one translates the uniontypes
in Absyn. This should possibly be done by Parser.parse instead, since
then this function won't have to be run over and over.

Revision: 4055
Message: Added a warning message when encountering a uniontype in a package Changed the elabCall RECORD constructor case to also handle
METARECORD. This should ensure that the METARECORD always gets the correct

Revision: 4053
- Bugfix of previous commit (it would try to generate the same
record definition twice in some test cases)

Revision: 4052
It's now possible to create uniontypes and call functions with uniontype
input from Interactive sessions.
- meta_modelica.[ch]: Added struct record_description, containing path
and field names. It will be passed in every record box instead of using
several slots in a box to pass the data field names.
- Added a field for record index in RECORD. This is needed
for uniontypes.
- Added global record_descriptions for each referenced
- Constant evaluation of METARECORDCALL
- Exp.getFunctionCalls: Added METARECORDCALL to the cases, and added
an input option to find all METARECORDCALLs instead of CALLs.

Revision: 4050
Author: stebr461
-Added a testcase for passing external functions as arguments

Revision: 4049
Author: stebr461
- fixed a little bug

Revision: 4048
Author: stebr461
- Proper testcase for passing builtin functions as arguments
- Fixed a small syntax error

Revision: 4046
- Fixed RECORD constructor no longer returning ClassInf.UNKNOWN("") instead
of ClassInf.RECORD(name)
- Added a case for METARECORDCALL when generating the function dependencies

Revision: 4045
Author: stebr461
-Compiling calls to functions with no output now works properly
-Functions with no output can now be used as arguments in function calls

Revision: 4043
- Adds the possibility to return METARECORDS to the interactive shell.
- Exp.METARECORDCALL: Added list<String> fieldNames so we can pass the fields
when creating the boxed data. This does cost some extra memory, but it means
we can return the value to the Interactive module. It should also be helpful
when debugging datastructures.
- MetaUtil.listToBoxes: Now takes a list<String> fieldNames when creating
the boxed datatype.
- Static.elabCallArgs: Now adds the field names to a METARECORDCALL.
- Added the OPTION type.
- c_runtime/meta_modelica.[ch]: Added mmc_mk_box(<size>,<ctor>,...) (varargs).
- c_runtime/read_write.[ch], Compiler/runtime/systemimpl.c: Added
TYPE_DESC_MMC which contains the MetaModelica-style data, and the ability
to parse it.

Revision: 4040
Author: stebr461
- Fixed testcases a bit
- Added error handling for empty function call in equations
- Added code generation functionality for empty function calls in algorithms

Revision: 4039
Author: stebr461
Partial function test cases added/fixed/modified

Revision: 4038
- MetaUtil.listToBoxes: Changed the input to Exp.Type instead of Exp.Exp.
The reason is simple: an Exp.COMPLEX contains list<(String,Exp.Type)> and
we want to be able to box recursive data including records using the same
- MetaUtil.createConstantCExp2: Added cases for Exp.STRING and Exp.COMPLEX

Revision: 4036
- Exp.typeOf: Added METARECORDCALL. This makes it possible to create a
UT using syntax like re := REC1(REC1(REC2(1.5)));

Revision: 4035
- Added a case for UT arguments in UT constructor
- Added testcases for recursive uniontypes. Note that a constructor like
REC1(REC1(REC2(1))) still doesn't work.

Revision: 4034
- Changed createConstantCExp to handle more than <type>
constants (like Integer i; i=1; REC1(i) instead of REC(1))
- Fixed code that changed the scope when looking up a metarecord
- Added a testcase using variables as arguments to a metarecord call.

Revision: 4033
Author: stebr461
- Modified a partial function test case and added a new one that tests built in functions and functions with no output
- Added the following functions to Exp:
getFunctionReferenceList - takes a list of expressions and returns the ones that are Exp.CREF with the type T_FUNCTION_REFERENCE
isFunctionReference - checks if an Exp.Type is a function reference
getFunctionRefs - takes an Exp and returns all the function reference Exp.CREFs it finds in the Exp and its subexpressions
- Added the following functions to SimCodegen:
getReferencedFunctions - creates a list of Absyn.Paths from function references using the new functionality in Exp
getCrefFromExp - extracts an Absyn.CREF from an expression
- Modified SimCodegen.getCalledFunctionsInFunction to handle references as well

Revision: 4030
- testcase/meta/Uniontype[1-3].mos now all work properly
- Added read/write_modelica_uniontype (aliased to modelica_complex)
- Added a case for T_UNIONTYPE in getAllExpsTt
- Added the copyright header to java_interface.[ch]

Revision: 4029
- Disabled optimization that interferes with MetaModelica
- Added UNIONTYPE cases
- Added UNIONTYPE cases; moved the UT case in instElement higher
so it's run before the more general case
- mk_box is now called mmc_mk_box
- meta_modelica.[ch]: More functions from yacclib.[ch] present
- testsuite/meta/Uniontype1.mos now works.

Revision: 4026
- Fixed the java testsuite Makefile in Linux

Revision: 4025
- Fixed C/Java runtime for external Java in Windows.
- Dynamic loading of the JVM from registry or environment variables work.
- The Java Runtime DefinitionsCreator was updated to escape backslashes in windows pathnames

Revision: 4024
Author: krsta
Some minor changes (from public to protected on some functions).

Revision: 4023
Author: krsta
Checked in merged code from Simon Bj?rkl?n's Union types implementation.

Revision: 4020
- buildRecordConstructorClass now adds ALG_ASSIGN statements
to the constructor so it's not a random piece of data.
- Removed warning from print statement (causes testsuite to fail)
- elabCall has a case which fixes problems when looking up
record constructors in packages.
- testsuite/records added. The tests do work fine with one exception.
Record-in-Record can't be returned to the interactive module and exists
as a failing test.
- changes to cevalCallFunction were not commited because commenting
out the record constructor and Cevalfunc cases change the result of several
other test cases. This is also why these test cases were not added to the
default testsuite.

Revision: 4019
- Added /usr/lib/jvm/default-java as a path to try if JAVA_HOME does not exist

Revision: 4017
Author: stebr461
- Fixed generation of function names in Codegen.generateRhsCref

Revision: 4016
- Updated Java tests

Revision: 4015
- Interpreted record constructors only used for implicit record
constructors (not function calls returning records)
-, Codegen.generateFunctions now returns
record definitions already created (so they won't be duplicated in
- T_RECORD wasn't used anymore so it was commented out and
references updated to use COMPLEX.
- Updated references from Exp.T_RECORD to COMPLEX.
Codegen.generateFunctions,etc handles Record-in-Record inside
compiled functions (but not when returning values to Interactive,etc).
-,,, Updated comments

Revision: 4012
- Added a mostly working implementation of external Java.
- Dynamically loads the JVM. Only jni headers are needed to compile the
modified C runtime.
- modelica_java.jar contains the Java runtime, which depends on antlr-3.1.3.jar.
- In order to run the java testsuite, you need to set JAVA_HOME to a working
java installation.
- There is some code for loading the JVM in visual studio, but it has not
been tested.
- The testsuite has been tested using OpenJDK and GCJ
- It could be possible to use the included antlr jar-file instead of forcing
the user to keep antlr/stringtemplate in his CLASSPATH

Revision: 4005
Author: stebr461
- added a case for T_FUNCTION_REFERENCE in Codegen.generateRhsCref

Revision: 4004
(rev3875 in the TemplateCodegen branch used the following bugfix; originally merged from MathCore)
- got rid of $$$ in the generated code (

Revision: 4003
Author: stebr461
- added modelica_fnptr to the c_runtime
- added support for function pointers in type descriptor
- added read and write functions for function pointers

Revision: 4000
- Added code for handling (partial) function arguments from Absyn to
Codegen. The c_runtime has not been modified and because simulations/etc
have some bugs in this branch, the code could not be fully tested or
compiled (although parts have been).

Revision: 3999
Author: krsta
Union Types test cases

Revision: 3992
- Added optmanager.o to Makefile.common (someone updated the omdev version but forgot about poor Linux users)

Revision: 3991
- Linux fix (extern C shadows C++ includes; ato[if] resides in stdlib.h)

Revision: 3990
Author: krsta
- Some updates.

Revision: 3989
- Testing write permission

Revision: 3961
Author: krsta
- Merged code from Simon Bj?rkl?n's branch. This is a code backup, not yet compilable code.

34 lines of code changed in 1 file:

  • Compiler/absyn_builder: walker.g (+34 -17)
adrpo 2008-12-01 04:52 Rev.: 3754

- added better annotation handling:
+ annotationVersion flag to the compiler:
* omc +annotationVersion=1.x|2.x|3.x
+ setAnnotationVersion/getAnnotationVersion API
+ see,, rtopts.c
+ more implementation is needed for Modelica 3.0 annotations.

- more command line help for omc.

- better component names in SCode data structures
and changes to all needed files due to them

- better support for model extends X end X;:
+ handling of Absyn.CLASS_EXTENDS and SCode.CLASS_EXTENDS
+ changes in the walker.g to populate Absyn.CLASS with
the class name for the model extends case (before was empty)
+ further support is needed for model extends X case in

- small beautification in parsers

16 lines of code changed in 1 file:

  • Compiler/absyn_builder: walker.g (+16 -7)
adrpo 2008-11-26 07:15 Rev.: 3748


- stream connector support is not ready yet, still left to do generation of equations.

- added "stream" to:
+ the lexer and parser
+ the Absyn component attributes
+ the SCode component attributes
+ the Types attributes
- changed XMLDump to also dump the stream attribute of a variable

- changed DAE.VAR components to more meaningful names and used them also in Exp.VAR components
- add dummy variable as: der($dummy) = 0; instead der($dummy) = sin(time*6628.318530717);
the dummy derivative is now added ONLY if there are no other states!

- removed double new lines in the generated code from:
- beautifying the generated code

- added tests for setting/reading "stream" attribute
- val(variable, integer) now returns a Real value as it should!
- made testsuite simulation rtest scripts more sensitive
to combined string and numbers differences
- now the records returned by interactive functions and
the simulation result are named! changed the testsuite
to agree with the changes.

- pushed the fixes for not needing ./ in the path by Robert [Robert.Wotzlaw \at], thanks!

- fixed a bug when sample(0, Ts) will not generate any event at T=0
Thanks to Beat Arnet [beat.arnet \ at] for reporting it!

9 lines of code changed in 1 file:

  • Compiler/absyn_builder: walker.g (+9 -2)
dietmarw 2008-11-02 18:35 Rev.: 3732

Formal clean up of all code files:

* applied svn:eol-style native to all files except Compiler/*.mo --> LF
* unified the eol-style of ALL files (this was necessary in order to set the svn properties
* unification was done by a script which also removed all trailing whitespaces (except for all files in testsuite as white spaces are necessary to successful compare the results, could be improved maybe)
* make clean all test --> success on Ubuntu Linux 8.10, proably a good idea to run it for the other platforms as well.
* FYI: script to remove trailing white spaces:

511 lines of code changed in 7 files:

  • Compiler/absyn_builder: (+4 -4), Makefile.omdev.mingw (+7 -6), expression_parser.g (+29 -29), parse.cpp (+137 -137), walker.g (+290 -290), yacclib.c (+22 -22), yacclib.h (+22 -22)
adrpo 2008-09-14 10:55 Rev.: 3637

A NEW OMDev: []
or a new MMC/RML Compiler: [do an svn update]

- Fixes for the memory leak
+ got rid of yacclib.c|h as this functionality is now present directly in mmc/rml
+ got rid of yacclib.h include in files:
TaskGraphExt.cpp, TaskGraphExt_stub.cpp, corbaimpl.cpp, daeext.cpp,
errorext.cpp, printimpl.c, ptolemyio.cpp, rtopts.c, settingsimpl.c,

- Changes to Visual Source projects to deal with fixes for the memory leak
+ pushed the new changes into rmlRuntime project
+ removed yacclib.c|h from the projects
+ small changes to the debug configuration of projects

- Changed the default tolerance from 1e-10 to 1e-6 in and commands.xml

3 lines of code changed in 3 files:

  • Compiler/absyn_builder: (+1 -1), Makefile.omdev.mingw (+1 -1), walker.g (+1 -2)
adrpo 2008-05-15 08:24 Rev.: 3547

The compiler should report more errors when running in the command line:
- report parsing errors when parsing .mos files!

98 lines of code changed in 1 file:

  • Compiler/absyn_builder: parse.cpp (+98 -22)

(40 more)

Generated by StatSVN 0.7.0