Skip to content

Commit

Permalink
+ Optimica:
Browse files Browse the repository at this point in the history
 + handle Optimica vars with opt. instants in class attributes. e.g. x(finalTime) + 1, where x is a variable.
 + Added a new flag for Optimica. 
 + Added new class attribute objectiveIntgrand.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@13902 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
mahge committed Nov 15, 2012
1 parent adaad1d commit 821b974
Show file tree
Hide file tree
Showing 15 changed files with 121 additions and 54 deletions.
42 changes: 27 additions & 15 deletions Compiler/FrontEnd/Builtin.mo
Expand Up @@ -270,21 +270,28 @@ protected constant DAE.Var timeVar = DAE.TYPES_VAR("time",
DAE.ATTR(SCode.POTENTIAL(),SCode.NON_PARALLEL(),SCode.VAR(),Absyn.INPUT(),Absyn.NOT_INNER_OUTER(), SCode.PUBLIC()),
DAE.T_REAL_DEFAULT,DAE.UNBOUND(),NONE()) "- The `time\' variable" ;

/* Optimica Extensions. Theses variables are considered builtin for Optimica: startTime, finalTime and objective */
/* Optimica Extensions. Theses variables are considered builtin for Optimica: startTime, finalTime, objectiveIntegrand and objective */

/* Optimica Extensions. The builtin variable startTime. */
protected constant DAE.Var startTimeVar = DAE.TYPES_VAR("startTime",
DAE.ATTR(SCode.POTENTIAL(),SCode.NON_PARALLEL(),SCode.VAR(),Absyn.INPUT(),Absyn.NOT_INNER_OUTER(), SCode.PUBLIC()),
DAE.T_REAL_DEFAULT,DAE.UNBOUND(),NONE()) "- The `finalTime\' variable" ;
DAE.T_REAL_DEFAULT,DAE.UNBOUND(),NONE()) "- The `startTime\' variable" ;

/* The builtin variable time. See also variableIsBuiltin */
/* Optimica Extensions. The builtin variable finalTime. */
protected constant DAE.Var finalTimeVar = DAE.TYPES_VAR("finalTime",
DAE.ATTR(SCode.POTENTIAL(),SCode.NON_PARALLEL(),SCode.VAR(),Absyn.INPUT(),Absyn.NOT_INNER_OUTER(), SCode.PUBLIC()),
DAE.T_REAL_DEFAULT,DAE.UNBOUND(),NONE()) "- The `finalTime\' variable" ;

/* The builtin variable time. See also variableIsBuiltin */
protected constant DAE.Var objectiveVar = DAE.TYPES_VAR("objective",
/* Optimica Extensions. The builtin variable objectiveIntegrand. */
protected constant DAE.Var objectiveIntegrandVar = DAE.TYPES_VAR("objectiveIntegrand",
DAE.ATTR(SCode.POTENTIAL(),SCode.NON_PARALLEL(),SCode.VAR(),Absyn.INPUT(),Absyn.NOT_INNER_OUTER(), SCode.PUBLIC()),
DAE.T_REAL_DEFAULT,DAE.UNBOUND(),NONE()) "- The `finalTime\' variable" ;

/* Optimica Extensions. The builtin variable objective. */
protected constant DAE.Var objectiveVar = DAE.TYPES_VAR("objective",
DAE.ATTR(SCode.POTENTIAL(),SCode.NON_PARALLEL(),SCode.VAR(),Absyn.INPUT(),Absyn.NOT_INNER_OUTER(), SCode.PUBLIC()),
DAE.T_REAL_DEFAULT,DAE.UNBOUND(),NONE()) "- The `objective\' variable" ;



protected constant DAE.Type stringIntInt2string =
Expand Down Expand Up @@ -483,20 +490,25 @@ algorithm
//If accepting Optimica then these variabels are also builtin
case(DAE.CREF_IDENT(ident="startTime"))
equation
true = Config.acceptMetaModelicaGrammar();
true = Config.acceptOptimicaGrammar();
then true;

case(DAE.CREF_IDENT(ident="finalTime"))
equation
true = Config.acceptMetaModelicaGrammar();
true = Config.acceptOptimicaGrammar();
then true;

case(DAE.CREF_IDENT(ident="objective"))
equation
true = Config.acceptMetaModelicaGrammar();
true = Config.acceptOptimicaGrammar();
then true;

case(DAE.CREF_IDENT(ident="objectiveIntegrand"))
equation
true = Config.acceptOptimicaGrammar();
then true;

else false;
else false;
end match;
end variableIsBuiltin;

Expand Down Expand Up @@ -604,10 +616,11 @@ algorithm
env = Env.extendFrameC(env, uncertaintyType);
env = Env.extendFrameV(env, timeVar, NONE(), Env.VAR_UNTYPED(), {}) "see also variableIsBuiltin";

//If Optimica add the startTime,finalTime and objective "builtin" variables.
env = Util.if_(Config.acceptMetaModelicaGrammar(), Env.extendFrameV(env, objectiveVar, NONE(), Env.VAR_UNTYPED(), {}), env);
env = Util.if_(Config.acceptMetaModelicaGrammar(), Env.extendFrameV(env, startTimeVar, NONE(), Env.VAR_UNTYPED(), {}), env);
env = Util.if_(Config.acceptMetaModelicaGrammar(), Env.extendFrameV(env, finalTimeVar, NONE(), Env.VAR_UNTYPED(), {}), env);
//If Optimica add the startTime,finalTime,objectiveIntegrand and objective "builtin" variables.
env = Util.if_(Config.acceptOptimicaGrammar(), Env.extendFrameV(env, objectiveVar, NONE(), Env.VAR_UNTYPED(), {}), env);
env = Util.if_(Config.acceptOptimicaGrammar(), Env.extendFrameV(env, objectiveIntegrandVar, NONE(), Env.VAR_UNTYPED(), {}), env);
env = Util.if_(Config.acceptOptimicaGrammar(), Env.extendFrameV(env, startTimeVar, NONE(), Env.VAR_UNTYPED(), {}), env);
env = Util.if_(Config.acceptOptimicaGrammar(), Env.extendFrameV(env, finalTimeVar, NONE(), Env.VAR_UNTYPED(), {}), env);

env = Env.extendFrameT(env, "cardinality", anyNonExpandableConnector2int);
env = Env.extendFrameT(env, "cardinality", anyExpandableConnector2int);
Expand Down Expand Up @@ -694,8 +707,7 @@ algorithm
then initialProgram;
case ()
equation
true = intEq(Flags.getConfigEnum(Flags.GRAMMAR), Flags.MODELICA);

true = intEq(Flags.getConfigEnum(Flags.GRAMMAR), Flags.MODELICA) or intEq(Flags.getConfigEnum(Flags.GRAMMAR), Flags.OPTIMICA);
fileModelica = Settings.getInstallationDirectoryPath() +& "/lib/omc/ModelicaBuiltin.mo";
initialFunctionStr = System.readFile(fileModelica);
initialProgram = Parser.parsebuiltinstring(initialFunctionStr, fileModelica);
Expand Down
6 changes: 6 additions & 0 deletions Compiler/FrontEnd/DAE.mo
Expand Up @@ -550,6 +550,7 @@ public
uniontype ClassAttributes "currently for Optimica extension: these are the objectives of optimization class"
record OPTIMIZATION_ATTRS
Option<Exp> objetiveE;
Option<Exp> objectiveIntegrandE;
Option<Exp> startTimeE;
Option<Exp> finalTimeE;
end OPTIMIZATION_ATTRS;
Expand Down Expand Up @@ -1631,6 +1632,11 @@ uniontype ComponentRef "- Component references
Type identType "type of the identifier, without considering the subscripts";
list<Subscript> subscriptLst;
end CREF_ITER;

record OPTIMICA_ATTR_INST_CREF "An Optimica component reference with the time instant in it. e.g x2(finalTime)"
ComponentRef componentRef;
String instant;
end OPTIMICA_ATTR_INST_CREF;

record WILD end WILD;

Expand Down
8 changes: 8 additions & 0 deletions Compiler/FrontEnd/Expression.mo
Expand Up @@ -5562,6 +5562,7 @@ algorithm
list<DAE.Subscript> subs,subs_1;
Type_a arg;
Integer ix;
String instant;

case (DAE.CREF_QUAL(ident = name, identType = ty, subscriptLst = subs, componentRef = cr), _, arg)
equation
Expand All @@ -5584,6 +5585,13 @@ algorithm
cr = Util.if_(referenceEq(subs,subs_1),inCref,DAE.CREF_ITER(name, ix, ty, subs_1));
then
(cr, arg);

case (DAE.OPTIMICA_ATTR_INST_CREF(componentRef = cr, instant = instant), _, arg)
equation
(cr_1, arg) = traverseExpCref(cr, rel, arg);
cr = Util.if_(referenceEq(cr,cr_1),inCref,DAE.OPTIMICA_ATTR_INST_CREF(cr_1, instant));
then
(cr, arg);

case (DAE.WILD(), _, arg) then (inCref, arg);

Expand Down
22 changes: 14 additions & 8 deletions Compiler/FrontEnd/Inst.mo
Expand Up @@ -13684,7 +13684,7 @@ algorithm

case (_,_,_,_,_,_)
equation
clsAttrs = DAE.DAE({DAE.CLASS_ATTRIBUTES(DAE.OPTIMIZATION_ATTRS(NONE(),NONE(),NONE()))});
clsAttrs = DAE.DAE({DAE.CLASS_ATTRIBUTES(DAE.OPTIMIZATION_ATTRS(NONE(),NONE(),NONE(),NONE()))});
(cache,env,dae) = instClassAttributes2(inCache,inEnv,inPrefix,inAttrs,inBoolean,inInfo,clsAttrs);
then (cache,env,dae);
case (_,_,_,_,_,_)
Expand Down Expand Up @@ -13752,25 +13752,31 @@ protected function insertClassAttribute
algorithm
outAttrs := match(inAttrs, attrName, inAttrExp)
local
Option<DAE.Exp> objectiveE,startTimeE,finalTimeE;
Option<DAE.Exp> objectiveE,startTimeE,finalTimeE,objectiveIntegrandE;
DAE.DAElist attrs;

case (attrs, "objective", _)
equation
DAE.DAE({DAE.CLASS_ATTRIBUTES(DAE.OPTIMIZATION_ATTRS(_,startTimeE,finalTimeE))}) = attrs;
attrs = DAE.DAE({DAE.CLASS_ATTRIBUTES(DAE.OPTIMIZATION_ATTRS(SOME(inAttrExp),startTimeE,finalTimeE))});
DAE.DAE({DAE.CLASS_ATTRIBUTES(DAE.OPTIMIZATION_ATTRS(_,objectiveIntegrandE,startTimeE,finalTimeE))}) = attrs;
attrs = DAE.DAE({DAE.CLASS_ATTRIBUTES(DAE.OPTIMIZATION_ATTRS(SOME(inAttrExp),objectiveIntegrandE,startTimeE,finalTimeE))});
then attrs;

case (attrs, "objectiveIntegrand", _)
equation
DAE.DAE({DAE.CLASS_ATTRIBUTES(DAE.OPTIMIZATION_ATTRS(objectiveE,_,startTimeE,finalTimeE))}) = attrs;
attrs = DAE.DAE({DAE.CLASS_ATTRIBUTES(DAE.OPTIMIZATION_ATTRS(objectiveE,SOME(inAttrExp),startTimeE,finalTimeE))});
then attrs;

case (attrs, "startTime", _)
equation
DAE.DAE({DAE.CLASS_ATTRIBUTES(DAE.OPTIMIZATION_ATTRS(objectiveE,_,finalTimeE))}) = attrs;
attrs = DAE.DAE({DAE.CLASS_ATTRIBUTES(DAE.OPTIMIZATION_ATTRS(objectiveE,SOME(inAttrExp),finalTimeE))});
DAE.DAE({DAE.CLASS_ATTRIBUTES(DAE.OPTIMIZATION_ATTRS(objectiveE,objectiveIntegrandE,_,finalTimeE))}) = attrs;
attrs = DAE.DAE({DAE.CLASS_ATTRIBUTES(DAE.OPTIMIZATION_ATTRS(objectiveE,objectiveIntegrandE,SOME(inAttrExp),finalTimeE))});
then attrs;

case (attrs, "finalTime", _)
equation
DAE.DAE({DAE.CLASS_ATTRIBUTES(DAE.OPTIMIZATION_ATTRS(objectiveE,startTimeE,_))}) = attrs;
attrs = DAE.DAE({DAE.CLASS_ATTRIBUTES(DAE.OPTIMIZATION_ATTRS(objectiveE,startTimeE,SOME(inAttrExp)))});
DAE.DAE({DAE.CLASS_ATTRIBUTES(DAE.OPTIMIZATION_ATTRS(objectiveE,objectiveIntegrandE,startTimeE,_))}) = attrs;
attrs = DAE.DAE({DAE.CLASS_ATTRIBUTES(DAE.OPTIMIZATION_ATTRS(objectiveE,objectiveIntegrandE,startTimeE,SOME(inAttrExp)))});
then attrs;
case (_,_,_)
equation
Expand Down
18 changes: 17 additions & 1 deletion Compiler/FrontEnd/Static.mo
Expand Up @@ -7051,12 +7051,13 @@ algorithm
SCode.Element cl,scodeClass,recordCl;
Absyn.Path fn,fn_1,fqPath,utPath,fnPrefix,componentType,correctFunctionPath,functionClassPath;
list<Absyn.Exp> args,t4;
Absyn.Exp argexp;
list<Absyn.NamedArg> nargs, translatedNArgs;
Boolean impl;
Option<Interactive.SymbolTable> st;
list<DAE.Type> typelist;
DAE.Dimensions vect_dims;
DAE.Exp call_exp,callExp;
DAE.Exp call_exp,callExp,daeexp;
list<String> t_lst,names;
String fn_str,types_str,scope,pre_str,componentName,fnIdent;
String s,name,argStr,stringifiedInstanceFunctionName,lastId;
Expand All @@ -7071,6 +7072,8 @@ algorithm
list<SCode.Element> comps;
Absyn.InnerOuter innerOuter;
list<Absyn.Path> operNames;
Absyn.ComponentRef cref;
DAE.ComponentRef daecref;

/* Record constructors that might have come from Graphical expressions with unknown array sizes */
/*
Expand Down Expand Up @@ -7304,6 +7307,19 @@ algorithm
Error.addSourceMessage(Error.NO_MATCHING_FUNCTION_FOUND, {fn_str,pre_str,types_str}, info);
then
(cache,NONE());

// In Optimica there is an odd syntax like for eg., x(finalTime) + y(finalTime); where both x and y are normal variables
// not functions. So it is not really a call Exp but the compiler treats it as if it is up until this point.
// This is a kind of trick to handle that.
case (cache,env,fn,{argexp as Absyn.CREF(Absyn.CREF_IDENT(name,_))},_,impl,_,st,pre,_)
equation
true = Config.acceptOptimicaGrammar();
cref = Absyn.pathToCref(fn);
(cache,SOME((daeexp as DAE.CREF(daecref,tp),prop,_))) = elabCref(cache,env, cref, impl,true,pre,info);
daeexp = DAE.CREF(DAE.OPTIMICA_ATTR_INST_CREF(daecref,name), tp);
expProps = SOME((daeexp,prop));
then
(cache,expProps);

case (cache,env,fn,args,nargs,impl,_,st,pre,_)
equation
Expand Down
5 changes: 5 additions & 0 deletions Compiler/Template/SimCodeTV.mo
Expand Up @@ -1123,6 +1123,10 @@ package DAE
Type identType;
list<Subscript> subscriptLst;
end CREF_IDENT;
record OPTIMICA_ATTR_INST_CREF
ComponentRef componentRef;
String instant;
end OPTIMICA_ATTR_INST_CREF;
record WILD end WILD;
end ComponentRef;

Expand Down Expand Up @@ -1619,6 +1623,7 @@ package DAE
uniontype ClassAttributes "currently for Optimica extension: these are the objectives of optimization class"
record OPTIMIZATION_ATTRS
Option<Exp> objetiveE;
Option<Exp> objectiveIntegrandE;
Option<Exp> startTimeE;
Option<Exp> finalTimeE;
end OPTIMIZATION_ATTRS;
Expand Down
14 changes: 11 additions & 3 deletions Compiler/Util/Config.mo
Expand Up @@ -141,28 +141,36 @@ end helpRequest;
public function acceptedGrammar
"returns: the flag number representing the accepted grammer. Instead of using
booleans. This way more extensions can be added easily.
usage: omc [+g=Modelica|MetaModelica|ParModelica] = [1|2|3], default to 'Modelica'."
usage: omc [+g=Modelica|MetaModelica|ParModelica|Optimica], default to 'Modelica'."
output Integer outGrammer;
algorithm
outGrammer := Flags.getConfigEnum(Flags.GRAMMAR);
end acceptedGrammar;

public function acceptMetaModelicaGrammar
"returns: true if MetaModelica grammar is accepted or false otherwise
usage: omc [+g=Modelica|MetaModelica|ParModelica], default to 'Modelica'."
usage: omc [+g=Modelica|MetaModelica|ParModelica|Optimica], default to 'Modelica'."
output Boolean outBoolean;
algorithm
outBoolean := intEq(Flags.getConfigEnum(Flags.GRAMMAR), Flags.METAMODELICA);
end acceptMetaModelicaGrammar;

public function acceptParModelicaGrammar
"returns: true if ParModelica grammar is accepted or false otherwise
usage: omc [+g=Modelica|MetaModelica|ParModelica], default to 'Modelica'."
usage: omc [+g=Modelica|MetaModelica|ParModelica|Optimica], default to 'Modelica'."
output Boolean outBoolean;
algorithm
outBoolean := intEq(Flags.getConfigEnum(Flags.GRAMMAR), Flags.PARMODELICA);
end acceptParModelicaGrammar;

public function acceptOptimicaGrammar
"returns: true if Optimica grammar is accepted or false otherwise
usage: omc [+g=Modelica|MetaModelica|ParModelica|Optimica], default to 'Modelica'."
output Boolean outBoolean;
algorithm
outBoolean := intEq(Flags.getConfigEnum(Flags.GRAMMAR), Flags.OPTIMICA);
end acceptOptimicaGrammar;

public function getAnnotationVersion
"returns what flag was given at start
omc [+annotationVersion=3.x]
Expand Down
3 changes: 2 additions & 1 deletion Compiler/Util/Flags.mo
Expand Up @@ -160,6 +160,7 @@ end ValidOptions;
public constant Integer MODELICA = 1;
public constant Integer METAMODELICA = 2;
public constant Integer PARMODELICA = 3;
public constant Integer OPTIMICA = 4;

// DEBUG FLAGS
public
Expand Down Expand Up @@ -515,7 +516,7 @@ constant ConfigFlag TARGET = CONFIG_FLAG(5, "target", NONE(), EXTERNAL(),
STRING_FLAG("gcc"), SOME(STRING_OPTION({"gcc", "msvc"})),
Util.gettext("Sets the target compiler to use."));
constant ConfigFlag GRAMMAR = CONFIG_FLAG(6, "grammar", SOME("g"), EXTERNAL(),
ENUM_FLAG(MODELICA, {("Modelica", MODELICA), ("MetaModelica", METAMODELICA), ("ParModelica", PARMODELICA)}),
ENUM_FLAG(MODELICA, {("Modelica", MODELICA), ("MetaModelica", METAMODELICA), ("ParModelica", PARMODELICA), ("Optimica", OPTIMICA)}),
SOME(STRING_OPTION({"Modelica", "MetaModelica", "ParModelica"})),
Util.gettext("Sets the grammar and semantics to accept."));
constant ConfigFlag ANNOTATION_VERSION = CONFIG_FLAG(7, "annotationVersion",
Expand Down
9 changes: 7 additions & 2 deletions Parser/BaseModelica_Lexer.g
Expand Up @@ -260,9 +260,14 @@ COLON : ':';
SEMICOLON : ';';
// ---------
// OptiMo
// Optimica
// ---------
// in the file MetaModelica_Lexer.g
OPTIMIZATION : 'optimization';
CONSTRAINT : 'constraint';
//INITIALGUESS : 'initialGuess';
//FREE : 'free';
//FINALTIME : 'finalTime';
/*------------------------------------------------------------------
* LEXER RULES
Expand Down
10 changes: 0 additions & 10 deletions Parser/MetaModelica_Lexer.g
Expand Up @@ -88,16 +88,6 @@ POWER_EW : '.^'; /* Modelica 3.0 */
/* Modelica 3.1 */
STREAM : 'stream'; /* for Modelica 3.1 stream connectors */
// ---------
// OptiMo
// ---------
OPTIMIZATION : 'optimization';
CONSTRAINT : 'constraint';
//INITIALGUESS : 'initialGuess';
//FREE : 'free';
//FINALTIME : 'finalTime';
// ---------
// ParModelica Extensions
Expand Down
2 changes: 1 addition & 1 deletion Parser/Modelica.g
Expand Up @@ -214,7 +214,7 @@ class_specifier2 returns [void* ast, const char *s2] @init {
}
| (lp = LPAR na=named_arguments rp=RPAR) cmt=string_comment c=composition id=END_IDENT
{
modelicaParserAssert(metamodelica_enabled(),"Class attributes are currently allowed only for Optimica. Use +g=MetaModelica.", class_specifier2, $start->line, $start->charPosition+1, $lp->line, $lp->charPosition+2);
modelicaParserAssert(optimica_enabled(),"Class attributes are currently allowed only for Optimica. Use +g=Optimica.", class_specifier2, $start->line, $start->charPosition+1, $lp->line, $lp->charPosition+2);
$ast = Absyn__PARTS(mk_nil(), na, c, mk_some_or_none(cmt));
}
| EQUALS attr=base_prefix path=type_specifier ( cm=class_modification )? cmt=comment
Expand Down
6 changes: 4 additions & 2 deletions Parser/ModelicaParserCommon.h
Expand Up @@ -50,9 +50,11 @@ extern const char *ModelicaParser_encoding;
#define PARSE_META_MODELICA 1<<1
#define PARSE_EXPRESSION 1<<2
#define PARSE_CODE_EXPRESSION 1<<3
#define PARSE_PAR_MODELICA 1<<4
#define PARSE_PARMODELICA 1<<4
#define PARSE_OPTIMICA 1<<5
#define metamodelica_enabled() (ModelicaParser_flags&PARSE_META_MODELICA)
#define parmodelica_enabled() (ModelicaParser_flags&PARSE_PAR_MODELICA)
#define parmodelica_enabled() (ModelicaParser_flags&PARSE_PARMODELICA)
#define optimica_enabled() (ModelicaParser_flags&PARSE_OPTIMICA)
#define code_expressions_enabled() (ModelicaParser_flags&PARSE_CODE_EXPRESSION)
#define flat_modelica_enabled() (ModelicaParser_flags&PARSE_FLAT)

Expand Down
12 changes: 8 additions & 4 deletions Parser/Parser_omc.c
Expand Up @@ -36,7 +36,8 @@ void* ParserExt_parse(const char* filename, int acceptedGrammer, const char* enc
{
int flags = PARSE_MODELICA;
if(acceptedGrammer == 2) flags |= PARSE_META_MODELICA;
else if(acceptedGrammer == 3) flags |= PARSE_PAR_MODELICA;
else if(acceptedGrammer == 3) flags |= PARSE_PARMODELICA;
else if(acceptedGrammer == 4) flags |= PARSE_OPTIMICA;

void *res = parseFile(filename, flags, encoding, runningTestsuite);
if (res == NULL)
Expand All @@ -49,7 +50,8 @@ void* ParserExt_parseexp(const char* filename, int acceptedGrammer, int runningT
{
int flags = PARSE_EXPRESSION;
if(acceptedGrammer == 2) flags |= PARSE_META_MODELICA;
else if(acceptedGrammer == 3) flags |= PARSE_PAR_MODELICA;
else if(acceptedGrammer == 3) flags |= PARSE_PARMODELICA;
else if(acceptedGrammer == 4) flags |= PARSE_OPTIMICA;

void *res = parseFile(filename, flags, "UTF-8", runningTestsuite);
if (res == NULL)
Expand All @@ -61,7 +63,8 @@ void* ParserExt_parsestring(const char* data, const char* filename, int accepted
{
int flags = PARSE_MODELICA;
if(acceptedGrammer == 2) flags |= PARSE_META_MODELICA;
else if(acceptedGrammer == 3) flags |= PARSE_PAR_MODELICA;
else if(acceptedGrammer == 3) flags |= PARSE_PARMODELICA;
else if(acceptedGrammer == 4) flags |= PARSE_OPTIMICA;

void *res = parseString(data, filename, flags, runningTestsuite);
if (res != NULL) {
Expand All @@ -75,7 +78,8 @@ void* ParserExt_parsestringexp(const char* data, const char* filename, int accep
{
int flags = PARSE_EXPRESSION;
if(acceptedGrammer == 2) flags |= PARSE_META_MODELICA;
else if(acceptedGrammer == 3) flags |= PARSE_PAR_MODELICA;
else if(acceptedGrammer == 3) flags |= PARSE_PARMODELICA;
else if(acceptedGrammer == 4) flags |= PARSE_OPTIMICA;

void *res = parseString(data, filename, flags, runningTestsuite);
if (res != NULL) {
Expand Down

0 comments on commit 821b974

Please sign in to comment.