diff --git a/Compiler/FrontEnd/ModelicaBuiltin.mo b/Compiler/FrontEnd/ModelicaBuiltin.mo index 1b93eaeecfe..c53d8428d03 100644 --- a/Compiler/FrontEnd/ModelicaBuiltin.mo +++ b/Compiler/FrontEnd/ModelicaBuiltin.mo @@ -1695,6 +1695,19 @@ function getNthInitialEquation "Returns the Nth Initial Equation section" external "builtin"; end getNthInitialEquation; +function getAnnotationCount "Counts the number of Annotation sections in a class" + input TypeName class_; + output Integer count; +external "builtin"; +end getAnnotationCount; + +function getNthAnnotationString "Returns the Nth Annotation section as string" + input TypeName class_; + input Integer index; + output String result; +external "builtin"; +end getNthAnnotationString; + function iconv "The iconv() function converts one multibyte characters from one character set to another. See man (3) iconv for more information. diff --git a/Compiler/Script/CevalScript.mo b/Compiler/Script/CevalScript.mo index 2812eb7342f..39d1866e039 100644 --- a/Compiler/Script/CevalScript.mo +++ b/Compiler/Script/CevalScript.mo @@ -2017,6 +2017,24 @@ algorithm (cache,Values.STRING(str),st); case (cache,env,"getNthInitialEquation",_,st,msg) then (cache,Values.STRING(""),st); + + case (cache,env,"getAnnotationCount",{Values.CODE(Absyn.C_TYPENAME(path))},(st as Interactive.SYMBOLTABLE(ast = p)),msg) + equation + absynClass = Interactive.getPathedClassInProgram(path, p); + n = getAnnotationCount(absynClass); + then + (cache,Values.INTEGER(n),st); + + case (cache,env,"getAnnotationCount",_,st,msg) then (cache,Values.INTEGER(0),st); + + case (cache,env,"getNthAnnotationString",{Values.CODE(Absyn.C_TYPENAME(path)),Values.INTEGER(n)},(st as Interactive.SYMBOLTABLE(ast = p)),msg) + equation + absynClass = Interactive.getPathedClassInProgram(path, p); + str = getNthAnnotationString(absynClass, n); + then + (cache,Values.STRING(str),st); + + case (cache,env,"getNthAnnotationString",_,st,msg) then (cache,Values.STRING(""),st); /* plotparametric This rule represents the normal case when an array of at least two elements * is given as an argument @@ -4634,4 +4652,414 @@ algorithm end match; end getNthInitialEquationInClass; +protected function getAnnotationCount +"function: getAnnotationCount + Counts the number of Annotation sections in a class." + input Absyn.Class inClass; + output Integer outInteger; +algorithm + outInteger := match (inClass) + local + list parts; + Integer count; + case Absyn.CLASS(body = Absyn.PARTS(classParts = parts)) + equation + count = getAnnotationsInClassParts(parts); + then + count; + // check also the case model extends X end X; + case Absyn.CLASS(body = Absyn.CLASS_EXTENDS(parts = parts)) + equation + count = getAnnotationsInClassParts(parts); + then + count; + case Absyn.CLASS(body = Absyn.DERIVED(typeSpec = _)) then 0; + end match; +end getAnnotationCount; + +protected function getAnnotationsInClassParts +"function: getAnnotationsInClassParts + Helper function to getAnnotationCount" + input list inAbsynClassPartLst; + output Integer outInteger; +algorithm + outInteger := matchcontinue (inAbsynClassPartLst) + local + list els; + list eqs; + list algs; + list xs; + Absyn.ClassPart cp; + Integer c1, c2, res; + case (Absyn.PUBLIC(contents = els) :: xs) + equation + c1 = getAnnotationsInElementItems(els); + c2 = getAnnotationsInClassParts(xs); + then + c1 + c2; + case (Absyn.PROTECTED(contents = els) :: xs) + equation + c1 = getAnnotationsInElementItems(els); + c2 = getAnnotationsInClassParts(xs); + then + c1 + c2; + case (Absyn.CONSTRAINTS(contents = eqs) :: xs) + equation + c1 = getAnnotationsInEquationsItems(eqs); + c2 = getAnnotationsInClassParts(xs); + then + c1 + c2; + case (Absyn.EQUATIONS(contents = eqs) :: xs) + equation + c1 = getAnnotationsInEquationsItems(eqs); + c2 = getAnnotationsInClassParts(xs); + then + c1 + c2; + case (Absyn.INITIALEQUATIONS(contents = eqs) :: xs) + equation + c1 = getAnnotationsInEquationsItems(eqs); + c2 = getAnnotationsInClassParts(xs); + then + c1 + c2; + case (Absyn.ALGORITHMS(contents = algs) :: xs) + equation + c1 = getAnnotationsInAlgorithmsItems(algs); + c2 = getAnnotationsInClassParts(xs); + then + c1 + c2; + case (Absyn.INITIALALGORITHMS(contents = algs) :: xs) + equation + c1 = getAnnotationsInAlgorithmsItems(algs); + c2 = getAnnotationsInClassParts(xs); + then + c1 + c2; + case ((_ :: xs)) + equation + res = getAnnotationsInClassParts(xs); + then + res; + case ({}) then 0; + end matchcontinue; +end getAnnotationsInClassParts; + +protected function getAnnotationsInElementItems +"function: getAnnotationsInElementItems + Helper function to getAnnotationsInClassParts" + input list inAbsynElementItemLst; + output Integer outInteger; +algorithm + outInteger := matchcontinue (inAbsynElementItemLst) + local + list xs; + Integer c1, res; + case (Absyn.ANNOTATIONITEM(annotation_ = Absyn.ANNOTATION(elementArgs = _)) :: xs) + equation + c1 = getAnnotationsInElementItems(xs); + then + c1 + 1; + case ((_ :: xs)) + equation + res = getAnnotationsInElementItems(xs); + then + res; + case ({}) then 0; + end matchcontinue; +end getAnnotationsInElementItems; + +protected function getAnnotationsInEquationsItems +"function: getAnnotationsInElementItems + Helper function to getAnnotationsInClassParts" + input list inAbsynEquationItemLst; + output Integer outInteger; +algorithm + outInteger := matchcontinue (inAbsynEquationItemLst) + local + list xs; + Integer c1, res; + case (Absyn.EQUATIONITEMANN(annotation_ = Absyn.ANNOTATION(elementArgs = _)) :: xs) + equation + c1 = getAnnotationsInEquationsItems(xs); + then + c1 + 1; + case ((_ :: xs)) + equation + res = getAnnotationsInEquationsItems(xs); + then + res; + case ({}) then 0; + end matchcontinue; +end getAnnotationsInEquationsItems; + +protected function getAnnotationsInAlgorithmsItems +"function: getAnnotationsInElementItems + Helper function to getAnnotationsInClassParts" + input list inAbsynAlgorithmItemLst; + output Integer outInteger; +algorithm + outInteger := matchcontinue (inAbsynAlgorithmItemLst) + local + list xs; + Integer c1, res; + case (Absyn.ALGORITHMITEMANN(annotation_ = Absyn.ANNOTATION(elementArgs = _)) :: xs) + equation + c1 = getAnnotationsInAlgorithmsItems(xs); + then + c1 + 1; + case ((_ :: xs)) + equation + res = getAnnotationsInAlgorithmsItems(xs); + then + res; + case ({}) then 0; + end matchcontinue; +end getAnnotationsInAlgorithmsItems; + +protected function getNthAnnotationString +"function: getNthAnnotationString + Returns the Nth Annotation String from a class." + input Absyn.Class inClass; + input Integer inInteger; + output String outString; +algorithm + outString := match (inClass,inInteger) + local + list parts; + String str; + Integer n; + case (Absyn.CLASS(body = Absyn.PARTS(classParts = parts)),n) + equation + str = getNthAnnotationStringInClassParts(parts,n); + then + str; + // check also the case model extends X end X; + case (Absyn.CLASS(body = Absyn.CLASS_EXTENDS(parts = parts)),n) + equation + str = getNthAnnotationStringInClassParts(parts,n); + then + str; + end match; +end getNthAnnotationString; + +protected function getNthAnnotationStringInClassParts +"function: getNthAnnotationStringInClassParts + This function takes a `ClassPart\' list and an int and returns + the nth annotation string." + input list inAbsynClassPartLst; + input Integer inInteger; + output String outString; +algorithm + outString := matchcontinue (inAbsynClassPartLst,inInteger) + local + String str; + list els; + list eqs; + list algs; + list xs; + Integer n,c1,newn; + case ((Absyn.PUBLIC(contents = els) :: xs),n) + equation + str = getNthAnnotationStringInElements(els, n); + then + str; + case ((Absyn.PUBLIC(contents = els) :: xs),n) /* The rule above failed, subtract the number of annotations in the first section and try with the rest of the classparts */ + equation + c1 = getAnnotationsInElementItems(els); + newn = n - c1; + str = getNthAnnotationStringInClassParts(xs, newn); + then + str; + case ((Absyn.PROTECTED(contents = els) :: xs),n) + equation + str = getNthAnnotationStringInElements(els, n); + then + str; + case ((Absyn.PROTECTED(contents = els) :: xs),n) /* The rule above failed, subtract the number of annotations in the first section and try with the rest of the classparts */ + equation + c1 = getAnnotationsInElementItems(els); + newn = n - c1; + str = getNthAnnotationStringInClassParts(xs, newn); + then + str; + case ((Absyn.CONSTRAINTS(contents = eqs) :: xs),n) + equation + str = getNthAnnotationStringInEquations(eqs, n); + then + str; + case ((Absyn.CONSTRAINTS(contents = eqs) :: xs),n) /* The rule above failed, subtract the number of annotations in the first section and try with the rest of the classparts */ + equation + c1 = getAnnotationsInEquationsItems(eqs); + newn = n - c1; + str = getNthAnnotationStringInClassParts(xs, newn); + then + str; + case ((Absyn.EQUATIONS(contents = eqs) :: xs),n) + equation + str = getNthAnnotationStringInEquations(eqs, n); + then + str; + case ((Absyn.EQUATIONS(contents = eqs) :: xs),n) /* The rule above failed, subtract the number of annotations in the first section and try with the rest of the classparts */ + equation + c1 = getAnnotationsInEquationsItems(eqs); + newn = n - c1; + str = getNthAnnotationStringInClassParts(xs, newn); + then + str; + case ((Absyn.INITIALEQUATIONS(contents = eqs) :: xs),n) + equation + str = getNthAnnotationStringInEquations(eqs, n); + then + str; + case ((Absyn.INITIALEQUATIONS(contents = eqs) :: xs),n) /* The rule above failed, subtract the number of annotations in the first section and try with the rest of the classparts */ + equation + c1 = getAnnotationsInEquationsItems(eqs); + newn = n - c1; + str = getNthAnnotationStringInClassParts(xs, newn); + then + str; + case ((Absyn.ALGORITHMS(contents = algs) :: xs),n) + equation + str = getNthAnnotationStringInAlgorithms(algs, n); + then + str; + case ((Absyn.ALGORITHMS(contents = algs) :: xs),n) /* The rule above failed, subtract the number of annotations in the first section and try with the rest of the classparts */ + equation + c1 = getAnnotationsInAlgorithmsItems(algs); + newn = n - c1; + str = getNthAnnotationStringInClassParts(xs, newn); + then + str; + case ((Absyn.INITIALALGORITHMS(contents = algs) :: xs),n) + equation + str = getNthAnnotationStringInAlgorithms(algs, n); + then + str; + case ((Absyn.INITIALALGORITHMS(contents = algs) :: xs),n) /* The rule above failed, subtract the number of annotations in the first section and try with the rest of the classparts */ + equation + c1 = getAnnotationsInAlgorithmsItems(algs); + newn = n - c1; + str = getNthAnnotationStringInClassParts(xs, newn); + then + str; + case ((_ :: xs),n) + equation + str = getNthAnnotationStringInClassParts(xs, n); + then + str; + end matchcontinue; +end getNthAnnotationStringInClassParts; + +protected function getNthAnnotationStringInElements +"function: getNthAnnotationStringInElements + This function takes an Element list and an int + and returns the nth annotation as string. + If the number is larger than the number of annotations + in the list, the function fails." + input list inAbsynElementItemLst; + input Integer inInteger; + output String outString; +algorithm + outString := matchcontinue (inAbsynElementItemLst,inInteger) + local + String str; + Absyn.Annotation ann; + list xs; + Integer newn,n; + case ((Absyn.ANNOTATIONITEM(annotation_ = ann) :: xs), 1) + equation + str = Dump.unparseAnnotationOption(0, SOME(ann)); + str = stringAppend(str, ";"); + str = System.trim(str, " "); + then + str; + case ((Absyn.ANNOTATIONITEM(annotation_ = Absyn.ANNOTATION(elementArgs = _)) :: xs),n) + equation + newn = n - 1; + str = getNthAnnotationStringInElements(xs, newn); + then + str; + case ((_ :: xs),n) + equation + str = getNthAnnotationStringInElements(xs, n); + then + str; + case ({},_) then fail(); + end matchcontinue; +end getNthAnnotationStringInElements; + +protected function getNthAnnotationStringInEquations +"function: getNthConnectionitemInEquations + This function takes an Equation list and an int + and returns the nth connection as an Equation. + If the number is larger than the number of connections + in the list, the function fails." + input list inAbsynEquationItemLst; + input Integer inInteger; + output String outString; +algorithm + outString := matchcontinue (inAbsynEquationItemLst,inInteger) + local + String str; + Absyn.Annotation ann; + list xs; + Integer newn,n; + case ((Absyn.EQUATIONITEMANN(annotation_ = ann) :: xs), 1) + equation + str = Dump.unparseAnnotationOption(0, SOME(ann)); + str = stringAppend(str, ";"); + str = System.trim(str, " "); + then + str; + case ((Absyn.EQUATIONITEMANN(annotation_ = Absyn.ANNOTATION(elementArgs = _)) :: xs),n) + equation + newn = n - 1; + str = getNthAnnotationStringInEquations(xs, newn); + then + str; + case ((_ :: xs),n) + equation + str = getNthAnnotationStringInEquations(xs, n); + then + str; + case ({},_) then fail(); + end matchcontinue; +end getNthAnnotationStringInEquations; + +protected function getNthAnnotationStringInAlgorithms +"function: getNthAnnotationStringInAlgorithms + This function takes an Algorithm list and an int + and returns the nth annotation as String. + If the number is larger than the number of annotations + in the list, the function fails." + input list inAbsynAlgorithmItemLst; + input Integer inInteger; + output String outString; +algorithm + outString := matchcontinue (inAbsynAlgorithmItemLst,inInteger) + local + String str; + Absyn.Annotation ann; + list xs; + Integer newn,n; + case ((Absyn.ALGORITHMITEMANN(annotation_ = ann) :: xs), 1) + equation + str = Dump.unparseAnnotationOption(0, SOME(ann)); + str = stringAppend(str, ";"); + str = System.trim(str, " "); + then + str; + case ((Absyn.ALGORITHMITEMANN(annotation_ = Absyn.ANNOTATION(elementArgs = _)) :: xs),n) + equation + newn = n - 1; + str = getNthAnnotationStringInAlgorithms(xs, newn); + then + str; + case ((_ :: xs),n) + equation + str = getNthAnnotationStringInAlgorithms(xs, n); + then + str; + case ({},_) then fail(); + end matchcontinue; +end getNthAnnotationStringInAlgorithms; + end CevalScript; diff --git a/Compiler/Script/Interactive.mo b/Compiler/Script/Interactive.mo index a1fa59e5c18..53ab7a310c5 100644 --- a/Compiler/Script/Interactive.mo +++ b/Compiler/Script/Interactive.mo @@ -61,11 +61,9 @@ public import Values; protected import Builtin; protected import Ceval; protected import ClassInf; -protected import ClassLoader; protected import ComponentReference; protected import Config; protected import Connect; -protected import ConnectUtil; protected import Constants; protected import DAEUtil; protected import Debug; @@ -1391,6 +1389,7 @@ algorithm list vals; Absyn.Class cls,refactoredClass; list simOptions; + Absyn.ClassDef cdef; case (istmts, st as SYMBOLTABLE(ast = p)) equation @@ -1935,6 +1934,17 @@ algorithm failure(resstr = getClassInformation(cr, p)); then ("error",st); + + case (istmts, st as SYMBOLTABLE(ast = p)) + equation + matchApiFunction(istmts, "getClassComment"); + {Absyn.CREF(componentRef = cr)} = getApiFunctionArgs(istmts); + path = Absyn.crefToPath(cr); + cls = getPathedClassInProgram(path, p); + Absyn.CLASS(_,_,_,_,_,cdef,_) = getPathedClassInProgram(path, p); + resstr = getClassComment(cdef); + then + (resstr,st); case (istmts, st as SYMBOLTABLE(ast = p)) equation @@ -2220,6 +2230,15 @@ algorithm then (resstr,st); + case (istmts, st as SYMBOLTABLE(ast = p)) + equation + matchApiFunction(istmts, "getComponentComment"); + {Absyn.CREF(componentRef = class_),Absyn.CREF(componentRef = cr)} = getApiFunctionArgs(istmts); + resstr = getComponentComment(class_, cr, p); + resstr = stringAppendList({"\"", resstr, "\""}); + then + (resstr,st); + case (istmts, st as SYMBOLTABLE(ast = p)) equation matchApiFunction(istmts, "setComponentComment"); @@ -11052,6 +11071,192 @@ algorithm end matchcontinue; end deleteEquationInEqlist; +protected function getComponentComment +"function: setComponentComment + Get the component commment." + input Absyn.ComponentRef inComponentRef1; + input Absyn.ComponentRef inComponentRef2; + input Absyn.Program inProgram4; + output String outString; +algorithm + (outString) := match (inComponentRef1,inComponentRef2,inProgram4) + local + Absyn.Path p_class; + Absyn.Within within_; + Absyn.Class cdef; + Absyn.Program p; + Absyn.ComponentRef class_,cr1; + String cmt; + Absyn.TimeStamp ts; + + case (class_,cr1,p as Absyn.PROGRAM(globalBuildTimes=ts)) + equation + p_class = Absyn.crefToPath(class_); + within_ = buildWithin(p_class); + cdef = getPathedClassInProgram(p_class, p); + cmt = getComponentCommentInClass(cdef, cr1); + then + cmt; + end match; +end getComponentComment; + +protected function getComponentCommentInClass + input Absyn.Class inClass; + input Absyn.ComponentRef inComponentRef; + output String outString; +algorithm + outString := match (inClass,inComponentRef) + local + list parts; + String cmt; + Absyn.ComponentRef cr1; + /* a class with parts */ + case (Absyn.CLASS(body = Absyn.PARTS(classParts = parts)),cr1) + equation + cmt = getComponentCommentInParts(parts, cr1); + then + cmt; + /* an extended class with parts: model extends M end M; */ + case (Absyn.CLASS(body = Absyn.CLASS_EXTENDS(parts = parts)),cr1) + equation + cmt = getComponentCommentInParts(parts, cr1); + then + cmt; + end match; +end getComponentCommentInClass; + +protected function getComponentCommentInParts + input list inAbsynClassPartLst; + input Absyn.ComponentRef inComponentRef; + output String outString; +algorithm + outString := matchcontinue (inAbsynClassPartLst,inComponentRef) + local + list elts,e; + list xs; + Absyn.ComponentRef cr1; + String cmt; + Absyn.ClassPart p; + case ((Absyn.PUBLIC(contents = elts) :: xs),cr1) + equation + cmt = getComponentCommentInElementitems(elts, cr1); + then + cmt; + case ((Absyn.PUBLIC(contents = e) :: xs),cr1) /* rule above failed */ + equation + cmt = getComponentCommentInParts(xs, cr1); + then + cmt; + case ((Absyn.PROTECTED(contents = elts) :: xs),cr1) + equation + cmt = getComponentCommentInElementitems(elts, cr1); + then + cmt; + case ((Absyn.PROTECTED(contents = e) :: xs),cr1) /* rule above failed */ + equation + cmt = getComponentCommentInParts(xs, cr1); + then + cmt; + case ((p :: xs),cr1) + equation + cmt = getComponentCommentInParts(xs, cr1); + then + cmt; + end matchcontinue; +end getComponentCommentInParts; + +protected function getComponentCommentInElementitems + input list inAbsynElementItemLst; + input Absyn.ComponentRef inComponentRef; + output String outString; +algorithm + outString := matchcontinue (inAbsynElementItemLst,inComponentRef) + local + Absyn.ElementSpec spec_1,spec; + Boolean f; + Option r; + Absyn.InnerOuter inout; + String n,cmt; + Absyn.Info info; + Option constr; + list es,es_1; + Absyn.ComponentRef cr1; + Absyn.ElementItem e; + case ((Absyn.ELEMENTITEM(element = Absyn.ELEMENT(finalPrefix = f,redeclareKeywords = r,innerOuter = inout,name = n,specification = spec,info = info,constrainClass = constr)) :: es),cr1) + equation + cmt = getComponentCommentInElementspec(spec, cr1); + then + cmt; + case ((e :: es),cr1) + equation + cmt = getComponentCommentInElementitems(es, cr1); + then + cmt; + end matchcontinue; +end getComponentCommentInElementitems; + +protected function getComponentCommentInElementspec + input Absyn.ElementSpec inElementSpec; + input Absyn.ComponentRef inComponentRef; + output String outString; +algorithm + outString := match (inElementSpec,inComponentRef) + local + list citems_1,citems; + Absyn.ElementAttributes attr; + Absyn.TypeSpec tp; + Absyn.ComponentRef cr; + String cmt; + case (Absyn.COMPONENTS(attributes = attr,typeSpec=tp,components = citems),cr) + equation + cmt = getComponentCommentInCompitems(citems, cr); + then + cmt; + end match; +end getComponentCommentInElementspec; + +protected function getComponentCommentInCompitems + input list inAbsynComponentItemLst; + input Absyn.ComponentRef inComponentRef; + output String outString; +algorithm + outString := matchcontinue (inAbsynComponentItemLst,inComponentRef) + local + Option compcmt_1,compcmt; + String id,cmt; + list ad; + Option mod; + Option cond; + list cs,cs_1; + Absyn.ComponentRef cr; + Absyn.ComponentItem c; + case ((Absyn.COMPONENTITEM(component = Absyn.COMPONENT(name = id,arrayDim = ad,modification = mod),condition = cond,comment = compcmt) :: cs),cr) + equation + true = Absyn.crefEqual(Absyn.CREF_IDENT(id,ad), cr); + cmt = getClassCommentInCommentOpt(compcmt); + then + cmt; + case ((c :: cs),cr) + equation + cmt = getComponentCommentInCompitems(cs, cr); + then + cmt; + end matchcontinue; +end getComponentCommentInCompitems; + +protected function getClassCommentInCommentOpt + input Option inAbsynCommentOption; + output String outString; +algorithm + outString := match (inAbsynCommentOption) + local + Option ann; + String cmt; + case (SOME(Absyn.COMMENT(_,SOME(cmt)))) then cmt; + case (SOME(Absyn.COMMENT(_,_))) then ""; + end match; +end getClassCommentInCommentOpt; + protected function setComponentComment "function: setComponentComment author :PA @@ -14898,15 +15103,20 @@ algorithm tpname = Absyn.pathLastIdent(p); p_1 = Absyn.joinPaths(envpath, Absyn.IDENT(tpname)); typename = Absyn.pathString(p_1); + typename = stringAppendList({"\"",typename,"\""}); names = getComponentitemsName(lst); dims = getComponentitemsDimension(lst); strLst = prefixTypename(typename, names); finalPrefix = boolString(f); + finalPrefix = stringAppendList({"\"",finalPrefix,"\""}); r_1 = keywordReplaceable(r); repl = boolString(r_1); + repl = stringAppendList({"\"",repl,"\""}); inout_str = innerOuterStr(inout); flowPrefixstr = attrFlowStr(attr); + flowPrefixstr = stringAppendList({"\"",flowPrefixstr,"\""}); streamPrefixstr = attrStreamStr(attr); + streamPrefixstr = stringAppendList({"\"",streamPrefixstr,"\""}); variability_str = attrVariabilityStr(attr); dir_str = attrDirectionStr(attr); typeAdStr = arrayDimensionStr(typeAd); @@ -14921,15 +15131,20 @@ algorithm access,env) equation typename = Absyn.pathString(p); + typename = stringAppendList({"\"",typename,"\""}); names = getComponentitemsName(lst); dims = getComponentitemsDimension(lst); strLst = prefixTypename(typename, names); finalPrefix = boolString(f); + finalPrefix = stringAppendList({"\"",finalPrefix,"\""}); r_1 = keywordReplaceable(r); repl = boolString(r_1); + repl = stringAppendList({"\"",repl,"\""}); inout_str = innerOuterStr(inout); flowPrefixstr = attrFlowStr(attr); + flowPrefixstr = stringAppendList({"\"",flowPrefixstr,"\""}); streamPrefixstr = attrStreamStr(attr); + streamPrefixstr = stringAppendList({"\"",streamPrefixstr,"\""}); variability_str = attrVariabilityStr(attr); dir_str = attrDirectionStr(attr); str = stringDelimitList({access,finalPrefix,flowPrefixstr,streamPrefixstr,repl,variability_str,inout_str,dir_str}, ", "); @@ -15260,7 +15475,7 @@ algorithm equation res = suffixInfos(rest, dims,typeAd,suffix); s1 = Util.stringDelimitListNonEmptyElts({dim,typeAd},","); - str_1 = stringAppendList({str,", ",suffix,",{",s1,"}"}); + str_1 = stringAppendList({str,", ",suffix,",\"{",s1,"}\""}); then (str_1 :: res); end match; @@ -15305,13 +15520,13 @@ algorithm case ((Absyn.COMPONENTITEM(component = Absyn.COMPONENT(name = c1),comment = SOME(Absyn.COMMENT(_,SOME(s2)))) :: (c2 :: rest))) equation lst = getComponentitemsName((c2 :: rest)); - str = stringAppendList({c1, ",", "\"",s2,"\""}); + str = stringAppendList({"\"", c1, "\"", ",", "\"", s2, "\""}); then (str :: lst); case ((Absyn.COMPONENTITEM(component = Absyn.COMPONENT(name = c1),comment = NONE()) :: (c2 :: rest))) equation lst = getComponentitemsName((c2 :: rest)); - str = stringAppendList({c1, ",", "\"\""}); + str = stringAppendList({"\"", c1, "\"", ",", "\"\""}); then (str :: lst); case ((_ :: rest)) @@ -15321,12 +15536,12 @@ algorithm res; case ({Absyn.COMPONENTITEM(component = Absyn.COMPONENT(name = c1),comment = SOME(Absyn.COMMENT(_,SOME(s2))))}) equation - str = stringAppendList({c1,",\"",s2,"\""}); + str = stringAppendList({"\"", c1, "\"", ",\"", s2, "\""}); then {str}; case ({Absyn.COMPONENTITEM(component = Absyn.COMPONENT(name = c1))}) equation - str = stringAppendList({c1,",\"\""}); + str = stringAppendList({"\"", c1, "\"", ",\"\""}); then {str}; case ({_}) then {}; diff --git a/Compiler/runtime/corbaimpl.cpp b/Compiler/runtime/corbaimpl.cpp index f8a539a625a..fb446831339 100644 --- a/Compiler/runtime/corbaimpl.cpp +++ b/Compiler/runtime/corbaimpl.cpp @@ -153,7 +153,7 @@ int CorbaImpl__initialize() (char*)"-IIOPAddr", (char*)"inet:127.0.0.1:0", (char*)"-ORBgiopMaxMsgSize", - (char*)"10485760" /*, "-ORBDebugLevel", "10", "-ORBIIOPBlocking" */ }; + (char*)"2147483647" /*, "-ORBDebugLevel", "10", "-ORBIIOPBlocking" */ }; #else int argc=4; char *dummyArgv[] = @@ -313,7 +313,7 @@ int CorbaImpl__initialize() { #ifndef NOMICO #if defined(USE_OMNIORB) - char *dummyArgv[] = { "omc", "-NoResolve", "-IIOPAddr", "inet:127.0.0.1:0", "-ORBgiopMaxMsgSize", "10485760" /*, "-ORBDebugLevel", "10", "-ORBIIOPBlocking" */ }; + char *dummyArgv[] = { "omc", "-NoResolve", "-IIOPAddr", "inet:127.0.0.1:0", "-ORBgiopMaxMsgSize", "2147483647" /*, "-ORBDebugLevel", "10", "-ORBIIOPBlocking" */ }; int argc=6; #else char *dummyArgv[] = { "omc", "-ORBNoResolve", "-ORBIIOPAddr", "inet:127.0.0.1:0" /*, "-ORBDebugLevel", "10", "-ORBIIOPBlocking" */ };