1 //------------------------------------------------------------------------------ 2 // <auto-generated /> 3 // 4 // This file was automatically generated by SWIG (http://www.swig.org). 5 // Version 4.0.2 6 // 7 // Do not make changes to this file unless you know what you are doing--modify 8 // the SWIG interface file instead. 9 //------------------------------------------------------------------------------ 10 11 namespace libsbml { 12 13 using System; 14 using System.Runtime.InteropServices; 15 16 /** 17 * @sbmlpackage{core} 18 * 19 @htmlinclude pkg-marker-core.html Controls the behavior of the Level 3 formula parser. 20 * 21 * @htmlinclude not-sbml-warning.html 22 * 23 * The function 24 * @sbmlfunction{parseL3FormulaWithSettings, String\, L3ParserSettings}, 25 * along with its variants @sbmlfunction{parseL3Formula, String} and 26 * @sbmlfunction{parseL3FormulaWithModel, String\, Model}, 27 * are the interfaces to a parser for mathematical formulas written as 28 * text strings. The inverse function is @sbmlfunction{formulaToL3String, 29 * ASTNode} and its variants such as 30 * @sbmlfunction{formulaToL3StringWithSettings, ASTNode\, L3ParserSettings}. 31 * The parsers and the formula writers convert between a text-string 32 * representation of mathematical formulas and Abstract Syntax Trees (ASTs), 33 * represented in libSBML using ASTNode objects. 34 * Compared to the parser and writer implemented by the functions 35 * @sbmlfunction{parseFormula, String} and 36 * @sbmlfunction{formulaToString, ASTNode}, 37 * which were designed primarily for converting the mathematical formula 38 * strings in SBML Level 1, the SBML Level 3 or 'L3' variants of 39 * the parser and writer use an extended formula syntax. They also have a 40 * number of configurable behaviors. This class (L3ParserSettings) is an 41 * object used to communicate the configuration settings with callers. 42 * 43 * The following aspects of the parser are configurable using 44 * L3ParserSettings objects. (For the formula writer, only a subset of these 45 * settings is relevant; please see the documentation for 46 * @sbmlfunction{formulaToL3StringWithSettings, ASTNode\, 47 * L3ParserSettings} for more information about which ones). 48 * @li A Model object may optionally be provided to use identifiers (values 49 * of type @c SId) from the model in preference to pre-defined MathML symbols 50 * More precisely, the Model entities whose identifiers will shadow identical 51 * symbols in the mathematical formula are: Species, Compartment, Parameter, 52 * Reaction, and SpeciesReference. For instance, if the parser is given a 53 * Model containing a Species with the identifier 54 * "<code>pi</code>", and the formula to be parsed is 55 * "<code>3*pi</code>", the MathML produced by the parser will 56 * contain the construct <code><ci> pi </ci></code> instead of 57 * the construct <code><pi/></code>. Another example, if the passed-in 58 * Model contains a FunctionDefinition with the identifier 59 * "<code>sin</code>", that function will be used instead of the 60 * predefined MathML function <code><sin/></code>. 61 * @li The function @c log with a single argument 62 * ("<code>log(x)</code>") can be parsed as <code>log10(x)</code>, 63 * <code>ln(x)</code>, or treated as an error, as desired. 64 * @li Unary minus signs can be either collapsed or preserved; that is, the 65 * parser can either (1) remove sequential pairs of unary minuses (e.g., 66 * "<code>- -3</code>") from the input and incorporate single unary 67 * minuses into the number node, or (2) preserve all minuses in the AST node 68 * structure, turning them into ASTNode objects of type 69 * @link libsbml#AST_MINUS AST_MINUS@endlink. 70 * @li The character sequence "<code>number id</code>" can be 71 * interpreted as a numerical value @c number followed by units of measurement 72 * indicated by @c id, or it can be treated as a syntax error. (In 73 * Level 3, MathML <code><cn></code> elements can have an 74 * attribute named @c units placed in the SBML namespace, which can be used 75 * to indicate the units to be associated with the number. The text-string 76 * infix formula parser allows units to be placed after raw numbers; they are 77 * interpreted as unit identifiers for units defined by the SBML 78 * specification or in the containing Model object.) 79 * @li The symbol @c avogadro can be parsed either as a MathML @em csymbol or 80 * as a identifier. More specifically, "<code>avogadro</code>" can 81 * be treated as an ASTNode of type 82 * @link libsbml#AST_NAME_AVOGADRO AST_NAME_AVOGADRO@endlink or of type 83 * @link libsbml#AST_NAME AST_NAME@endlink. 84 * @li Strings that match built-in functions and constants can either be parsed 85 * as a match regardless of capitalization, or may be required to be 86 * all-lower-case to be considered a match. 87 * @li LibSBML plug-ins implementing support for SBML Level 3 packages 88 * may introduce extensions to the syntax understood by the parser. The 89 * precise nature of the extensions will be documented by the individual 90 * package plug-ins. An example of a possible extension is a notation for 91 * vectors and arrays, introduced by the SBML Level 3 @em Arrays 92 * package. 93 * 94 * 95 * 96 * To obtain the default configuration values, callers can use the function 97 * @sbmlfunction{getDefaultL3ParserSettings,}. To change the configuration, 98 * callers can create an L3ParserSettings object, set the desired 99 * characteristics using the methods provided, and pass that object to 100 * @sbmlfunction{parseL3FormulaWithSettings, String formula\, L3ParserSettings settings}. 101 * 102 * @see @sbmlfunction{parseL3Formula, String} 103 * @see @sbmlfunction{parseL3FormulaWithSettings, String\, L3ParserSettings} 104 * @see @sbmlfunction{parseL3FormulaWithModel, String\, Model} 105 * @see @sbmlfunction{parseFormula, String} 106 * @see @sbmlfunction{formulaToL3StringWithSettings, ASTNode\, L3ParserSettings} 107 * @see @sbmlfunction{formulaToL3String, ASTNode} 108 * @see @sbmlfunction{formulaToString, ASTNode} 109 * @see @sbmlfunction{getDefaultL3ParserSettings,} 110 */ 111 112 public class L3ParserSettings : global::System.IDisposable { 113 private HandleRef swigCPtr; 114 protected bool swigCMemOwn; 115 L3ParserSettings(IntPtr cPtr, bool cMemoryOwn)116 internal L3ParserSettings(IntPtr cPtr, bool cMemoryOwn) 117 { 118 swigCMemOwn = cMemoryOwn; 119 swigCPtr = new HandleRef(this, cPtr); 120 } 121 getCPtr(L3ParserSettings obj)122 internal static HandleRef getCPtr(L3ParserSettings obj) 123 { 124 return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; 125 } 126 getCPtrAndDisown(L3ParserSettings obj)127 internal static HandleRef getCPtrAndDisown (L3ParserSettings obj) 128 { 129 HandleRef ptr = new HandleRef(null, IntPtr.Zero); 130 131 if (obj != null) 132 { 133 ptr = obj.swigCPtr; 134 obj.swigCMemOwn = false; 135 } 136 137 return ptr; 138 } 139 ~L3ParserSettings()140 ~L3ParserSettings() { 141 Dispose(false); 142 } 143 Dispose()144 public void Dispose() { 145 Dispose(true); 146 global::System.GC.SuppressFinalize(this); 147 } 148 Dispose(bool disposing)149 protected virtual void Dispose(bool disposing) { 150 lock(this) { 151 if (swigCPtr.Handle != global::System.IntPtr.Zero) { 152 if (swigCMemOwn) { 153 swigCMemOwn = false; 154 libsbmlPINVOKE.delete_L3ParserSettings(swigCPtr); 155 } 156 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); 157 } 158 } 159 } 160 161 162 /** 163 * Creates a new L3ParserSettings object with default values. 164 * 165 * This is the default constructor for the L3ParserSettings object. It 166 * sets the stored Model object to @c null and sets the following 167 * field values in the L3ParserSettings object: 168 * 169 * @li <em>parseunits</em> ('parse units') is set to 170 * @link libsbml#L3P_PARSE_UNITS L3P_PARSE_UNITS@endlink. 171 * 172 * @li <em>collapseminus</em> ('collapse minus') is set to 173 * @link libsbml#L3P_EXPAND_UNARY_MINUS L3P_EXPAND_UNARY_MINUS@endlink. 174 * 175 * @li <em>parselog</em> ('parse log') is set to 176 * @link libsbml#L3P_PARSE_LOG_AS_LOG10 L3P_PARSE_LOG_AS_LOG10@endlink. 177 * 178 * @li <em>avocsymbol</em> ('Avogadro csymbol') is set to 179 * @link libsbml#L3P_AVOGADRO_IS_CSYMBOL L3P_AVOGADRO_IS_CSYMBOL@endlink. 180 * 181 * @li <em>caseSensitive</em> ('case sensitive') is set to 182 * @link libsbml#L3P_COMPARE_BUILTINS_CASE_INSENSITIVE L3P_COMPARE_BUILTINS_CASE_INSENSITIVE@endlink. 183 * 184 * @li <em>moduloL3v2</em> ('modulo l3v2') is set to 185 * @link libsbml#L3P_MODULO_IS_PIECEWISE L3P_MODULO_IS_PIECEWISE@endlink. 186 * 187 * @li <em>sbmlns</em> ('SBML namespaces') is set to @c null (which 188 * indicates that no syntax extensions due to SBML Level 3 packages 189 * will be assumed---the formula parser will only understand the 190 * core syntax described in the documentation for 191 * @sbmlfunction{parseL3Formula, String}). 192 */ public L3ParserSettings()193 L3ParserSettings() : this(libsbmlPINVOKE.new_L3ParserSettings__SWIG_0(), true) { 194 } 195 196 197 /** 198 * Creates a new L3ParserSettings object with specific values for all 199 * possible settings. 200 * 201 * @param model a Model object to be used for disambiguating identifiers 202 * encountered by @sbmlfunction{parseL3FormulaWithSettings, String\, 203 * L3ParserSettings} in mathematical formulas. 204 * 205 * @param parselog ('parse log') a flag that controls how the parser will 206 * handle the symbol @c log in mathematical formulas. The function @c log 207 * with a single argument ("<code>log(x)</code>") can be parsed 208 * as <code>log10(x)</code>, <code>ln(x)</code>, or treated as an error, as 209 * desired, by using the parameter values 210 * @link libsbml#L3P_PARSE_LOG_AS_LOG10 L3P_PARSE_LOG_AS_LOG10@endlink, 211 * @link libsbml#L3P_PARSE_LOG_AS_LN L3P_PARSE_LOG_AS_LN@endlink, or 212 * @link libsbml#L3P_PARSE_LOG_AS_ERROR L3P_PARSE_LOG_AS_ERROR@endlink, respectively. 213 * 214 * @param collapseminus ('collapse minus') a flag that controls how the 215 * parser will handle minus signs in formulas. Unary minus signs can be 216 * collapsed or preserved; that is, sequential pairs of unary minuses 217 * (e.g., "<code>- -3</code>") can be removed from the input 218 * entirely and single unary minuses can be incorporated into the number 219 * node, or all minuses can be preserved in the AST node structure. 220 * The possible values of this field are 221 * @link libsbml#L3P_COLLAPSE_UNARY_MINUS L3P_COLLAPSE_UNARY_MINUS@endlink (to collapse unary minuses) and 222 * @link libsbml#L3P_EXPAND_UNARY_MINUS L3P_EXPAND_UNARY_MINUS@endlink (to expand unary minuses). 223 * 224 * @param parseunits ('parse units') a flag that controls how the parser 225 * will handle apparent references to units of measurement associated with 226 * raw numbers in a formula. If set to the value 227 * @link libsbml#L3P_PARSE_UNITS L3P_PARSE_UNITS@endlink, units are parsed; if set to the value 228 * @link libsbml#L3P_NO_UNITS L3P_NO_UNITS@endlink, units are not parsed. 229 * 230 * @param avocsymbol ('Avogadro csymbol') a flag that controls how the 231 * parser will handle the appearance of the symbol @c avogadro in a 232 * formula. If set to the value @link libsbml#L3P_AVOGADRO_IS_CSYMBOL L3P_AVOGADRO_IS_CSYMBOL@endlink, 233 * the symbol is interpreted as the SBML/MathML @em csymbol @c avogadro; if 234 * set to the value @link libsbml#L3P_AVOGADRO_IS_NAME L3P_AVOGADRO_IS_NAME@endlink, the symbol is 235 * interpreted as a plain symbol name. 236 * 237 * @param caseSensitive ('case sensitive') a flag that controls how the 238 * cases of alphabetical characters are treated when symbols are compared. 239 * If the flag is set to the value 240 * @link libsbml#L3P_COMPARE_BUILTINS_CASE_INSENSITIVE L3P_COMPARE_BUILTINS_CASE_INSENSITIVE@endlink, symbols are 241 * compared in a case-insensitive manner, which means that mathematical 242 * functions such as @c 'sin' will be matched no matter what their case is: 243 * @c 'Sin', @c 'SIN', etc. If the flag is set to the value 244 * @link libsbml#L3P_COMPARE_BUILTINS_CASE_SENSITIVE L3P_COMPARE_BUILTINS_CASE_SENSITIVE@endlink, symbols are 245 * interpreted in a case-sensitive manner. 246 * 247 * @param sbmlns ('SBML namespaces') an SBML namespaces object. The 248 * namespaces identify the SBML Level 3 packages that can extend the 249 * syntax understood by the formula parser. When non-@c null, the parser 250 * will interpret additional syntax defined by the packages; for example, 251 * it may understand vector/array extensions introduced by the SBML 252 * Level 3 @em Arrays package. 253 * 254 * @param moduloL3v2 ('modulo L3v2') a flag that controls how the 255 * parser will handle the @% ('modulo') symbol in formulas. By default, 256 * the parser will convert 'a % b' to a piecewise function that properly 257 * calculates the remainder of a with respect to be, but the parser can 258 * also be set to produce the MathML @c rem function, should the target 259 * of the produced ASTNode be an SBML Level 3 Version 2 260 * document, where the @c rem function is legal. 261 * The possible values of this field are 262 * @link libsbml#L3P_MODULO_IS_PIECEWISE L3P_MODULO_IS_PIECEWISE@endlink (to parse @% as a piecewise function) and 263 * @link libsbml#L3P_MODULO_IS_REM L3P_MODULO_IS_REM@endlink (to parse @% as @c rem). 264 * 265 * @param l3v2functions ('parse L3v2 functions directly') is a Boolean flag 266 * that controls how to translate certain mathematical functions added in SBML 267 * Level 3 Version 2 Core. The parser can either turn them into 268 * specific AST node types, or turn them all into 269 * @link libsbml#AST_FUNCTION AST_FUNCTION@endlink with the name set to the 270 * function name in question. 271 * 272 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 273 * 274 * @see getModel() 275 * @see setModel(@if java Model@endif) 276 * @see unsetModel() 277 * @see getParseLog() 278 * @see setParseLog(@if java int@endif) 279 * @see getParseUnits() 280 * @see setParseUnits(@if java boolean@endif) 281 * @see getParseCollapseMinus() 282 * @see setParseCollapseMinus(@if java boolean@endif) 283 * @see getParseAvogadroCsymbol() 284 * @see setParseAvogadroCsymbol(@if java boolean@endif) 285 * @see getParseModuloL3v2() 286 * @see setParseModuloL3v2(@if java boolean@endif) 287 * @see getParseL3v2Functions() 288 * @see setParseL3v2Functions(@if java boolean@endif) 289 */ public L3ParserSettings(Model model, int parselog, bool collapseminus, bool parseunits, bool avocsymbol, bool caseSensitive, SBMLNamespaces sbmlns, bool moduloL3v2, bool l3v2functions)290 L3ParserSettings(Model model, int parselog, bool collapseminus, bool parseunits, bool avocsymbol, bool caseSensitive, SBMLNamespaces sbmlns, bool moduloL3v2, bool l3v2functions) : this(libsbmlPINVOKE.new_L3ParserSettings__SWIG_1(Model.getCPtr(model), parselog, collapseminus, parseunits, avocsymbol, caseSensitive, SBMLNamespaces.getCPtr(sbmlns), moduloL3v2, l3v2functions), true) { 291 } 292 293 294 /** 295 * Creates a new L3ParserSettings object with specific values for all 296 * possible settings. 297 * 298 * @param model a Model object to be used for disambiguating identifiers 299 * encountered by @sbmlfunction{parseL3FormulaWithSettings, String\, 300 * L3ParserSettings} in mathematical formulas. 301 * 302 * @param parselog ('parse log') a flag that controls how the parser will 303 * handle the symbol @c log in mathematical formulas. The function @c log 304 * with a single argument ("<code>log(x)</code>") can be parsed 305 * as <code>log10(x)</code>, <code>ln(x)</code>, or treated as an error, as 306 * desired, by using the parameter values 307 * @link libsbml#L3P_PARSE_LOG_AS_LOG10 L3P_PARSE_LOG_AS_LOG10@endlink, 308 * @link libsbml#L3P_PARSE_LOG_AS_LN L3P_PARSE_LOG_AS_LN@endlink, or 309 * @link libsbml#L3P_PARSE_LOG_AS_ERROR L3P_PARSE_LOG_AS_ERROR@endlink, respectively. 310 * 311 * @param collapseminus ('collapse minus') a flag that controls how the 312 * parser will handle minus signs in formulas. Unary minus signs can be 313 * collapsed or preserved; that is, sequential pairs of unary minuses 314 * (e.g., "<code>- -3</code>") can be removed from the input 315 * entirely and single unary minuses can be incorporated into the number 316 * node, or all minuses can be preserved in the AST node structure. 317 * The possible values of this field are 318 * @link libsbml#L3P_COLLAPSE_UNARY_MINUS L3P_COLLAPSE_UNARY_MINUS@endlink (to collapse unary minuses) and 319 * @link libsbml#L3P_EXPAND_UNARY_MINUS L3P_EXPAND_UNARY_MINUS@endlink (to expand unary minuses). 320 * 321 * @param parseunits ('parse units') a flag that controls how the parser 322 * will handle apparent references to units of measurement associated with 323 * raw numbers in a formula. If set to the value 324 * @link libsbml#L3P_PARSE_UNITS L3P_PARSE_UNITS@endlink, units are parsed; if set to the value 325 * @link libsbml#L3P_NO_UNITS L3P_NO_UNITS@endlink, units are not parsed. 326 * 327 * @param avocsymbol ('Avogadro csymbol') a flag that controls how the 328 * parser will handle the appearance of the symbol @c avogadro in a 329 * formula. If set to the value @link libsbml#L3P_AVOGADRO_IS_CSYMBOL L3P_AVOGADRO_IS_CSYMBOL@endlink, 330 * the symbol is interpreted as the SBML/MathML @em csymbol @c avogadro; if 331 * set to the value @link libsbml#L3P_AVOGADRO_IS_NAME L3P_AVOGADRO_IS_NAME@endlink, the symbol is 332 * interpreted as a plain symbol name. 333 * 334 * @param caseSensitive ('case sensitive') a flag that controls how the 335 * cases of alphabetical characters are treated when symbols are compared. 336 * If the flag is set to the value 337 * @link libsbml#L3P_COMPARE_BUILTINS_CASE_INSENSITIVE L3P_COMPARE_BUILTINS_CASE_INSENSITIVE@endlink, symbols are 338 * compared in a case-insensitive manner, which means that mathematical 339 * functions such as @c 'sin' will be matched no matter what their case is: 340 * @c 'Sin', @c 'SIN', etc. If the flag is set to the value 341 * @link libsbml#L3P_COMPARE_BUILTINS_CASE_SENSITIVE L3P_COMPARE_BUILTINS_CASE_SENSITIVE@endlink, symbols are 342 * interpreted in a case-sensitive manner. 343 * 344 * @param sbmlns ('SBML namespaces') an SBML namespaces object. The 345 * namespaces identify the SBML Level 3 packages that can extend the 346 * syntax understood by the formula parser. When non-@c null, the parser 347 * will interpret additional syntax defined by the packages; for example, 348 * it may understand vector/array extensions introduced by the SBML 349 * Level 3 @em Arrays package. 350 * 351 * @param moduloL3v2 ('modulo L3v2') a flag that controls how the 352 * parser will handle the @% ('modulo') symbol in formulas. By default, 353 * the parser will convert 'a % b' to a piecewise function that properly 354 * calculates the remainder of a with respect to be, but the parser can 355 * also be set to produce the MathML @c rem function, should the target 356 * of the produced ASTNode be an SBML Level 3 Version 2 357 * document, where the @c rem function is legal. 358 * The possible values of this field are 359 * @link libsbml#L3P_MODULO_IS_PIECEWISE L3P_MODULO_IS_PIECEWISE@endlink (to parse @% as a piecewise function) and 360 * @link libsbml#L3P_MODULO_IS_REM L3P_MODULO_IS_REM@endlink (to parse @% as @c rem). 361 * 362 * @param l3v2functions ('parse L3v2 functions directly') is a Boolean flag 363 * that controls how to translate certain mathematical functions added in SBML 364 * Level 3 Version 2 Core. The parser can either turn them into 365 * specific AST node types, or turn them all into 366 * @link libsbml#AST_FUNCTION AST_FUNCTION@endlink with the name set to the 367 * function name in question. 368 * 369 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 370 * 371 * @see getModel() 372 * @see setModel(@if java Model@endif) 373 * @see unsetModel() 374 * @see getParseLog() 375 * @see setParseLog(@if java int@endif) 376 * @see getParseUnits() 377 * @see setParseUnits(@if java boolean@endif) 378 * @see getParseCollapseMinus() 379 * @see setParseCollapseMinus(@if java boolean@endif) 380 * @see getParseAvogadroCsymbol() 381 * @see setParseAvogadroCsymbol(@if java boolean@endif) 382 * @see getParseModuloL3v2() 383 * @see setParseModuloL3v2(@if java boolean@endif) 384 * @see getParseL3v2Functions() 385 * @see setParseL3v2Functions(@if java boolean@endif) 386 */ public L3ParserSettings(Model model, int parselog, bool collapseminus, bool parseunits, bool avocsymbol, bool caseSensitive, SBMLNamespaces sbmlns, bool moduloL3v2)387 L3ParserSettings(Model model, int parselog, bool collapseminus, bool parseunits, bool avocsymbol, bool caseSensitive, SBMLNamespaces sbmlns, bool moduloL3v2) : this(libsbmlPINVOKE.new_L3ParserSettings__SWIG_2(Model.getCPtr(model), parselog, collapseminus, parseunits, avocsymbol, caseSensitive, SBMLNamespaces.getCPtr(sbmlns), moduloL3v2), true) { 388 } 389 390 391 /** 392 * Creates a new L3ParserSettings object with specific values for all 393 * possible settings. 394 * 395 * @param model a Model object to be used for disambiguating identifiers 396 * encountered by @sbmlfunction{parseL3FormulaWithSettings, String\, 397 * L3ParserSettings} in mathematical formulas. 398 * 399 * @param parselog ('parse log') a flag that controls how the parser will 400 * handle the symbol @c log in mathematical formulas. The function @c log 401 * with a single argument ("<code>log(x)</code>") can be parsed 402 * as <code>log10(x)</code>, <code>ln(x)</code>, or treated as an error, as 403 * desired, by using the parameter values 404 * @link libsbml#L3P_PARSE_LOG_AS_LOG10 L3P_PARSE_LOG_AS_LOG10@endlink, 405 * @link libsbml#L3P_PARSE_LOG_AS_LN L3P_PARSE_LOG_AS_LN@endlink, or 406 * @link libsbml#L3P_PARSE_LOG_AS_ERROR L3P_PARSE_LOG_AS_ERROR@endlink, respectively. 407 * 408 * @param collapseminus ('collapse minus') a flag that controls how the 409 * parser will handle minus signs in formulas. Unary minus signs can be 410 * collapsed or preserved; that is, sequential pairs of unary minuses 411 * (e.g., "<code>- -3</code>") can be removed from the input 412 * entirely and single unary minuses can be incorporated into the number 413 * node, or all minuses can be preserved in the AST node structure. 414 * The possible values of this field are 415 * @link libsbml#L3P_COLLAPSE_UNARY_MINUS L3P_COLLAPSE_UNARY_MINUS@endlink (to collapse unary minuses) and 416 * @link libsbml#L3P_EXPAND_UNARY_MINUS L3P_EXPAND_UNARY_MINUS@endlink (to expand unary minuses). 417 * 418 * @param parseunits ('parse units') a flag that controls how the parser 419 * will handle apparent references to units of measurement associated with 420 * raw numbers in a formula. If set to the value 421 * @link libsbml#L3P_PARSE_UNITS L3P_PARSE_UNITS@endlink, units are parsed; if set to the value 422 * @link libsbml#L3P_NO_UNITS L3P_NO_UNITS@endlink, units are not parsed. 423 * 424 * @param avocsymbol ('Avogadro csymbol') a flag that controls how the 425 * parser will handle the appearance of the symbol @c avogadro in a 426 * formula. If set to the value @link libsbml#L3P_AVOGADRO_IS_CSYMBOL L3P_AVOGADRO_IS_CSYMBOL@endlink, 427 * the symbol is interpreted as the SBML/MathML @em csymbol @c avogadro; if 428 * set to the value @link libsbml#L3P_AVOGADRO_IS_NAME L3P_AVOGADRO_IS_NAME@endlink, the symbol is 429 * interpreted as a plain symbol name. 430 * 431 * @param caseSensitive ('case sensitive') a flag that controls how the 432 * cases of alphabetical characters are treated when symbols are compared. 433 * If the flag is set to the value 434 * @link libsbml#L3P_COMPARE_BUILTINS_CASE_INSENSITIVE L3P_COMPARE_BUILTINS_CASE_INSENSITIVE@endlink, symbols are 435 * compared in a case-insensitive manner, which means that mathematical 436 * functions such as @c 'sin' will be matched no matter what their case is: 437 * @c 'Sin', @c 'SIN', etc. If the flag is set to the value 438 * @link libsbml#L3P_COMPARE_BUILTINS_CASE_SENSITIVE L3P_COMPARE_BUILTINS_CASE_SENSITIVE@endlink, symbols are 439 * interpreted in a case-sensitive manner. 440 * 441 * @param sbmlns ('SBML namespaces') an SBML namespaces object. The 442 * namespaces identify the SBML Level 3 packages that can extend the 443 * syntax understood by the formula parser. When non-@c null, the parser 444 * will interpret additional syntax defined by the packages; for example, 445 * it may understand vector/array extensions introduced by the SBML 446 * Level 3 @em Arrays package. 447 * 448 * @param moduloL3v2 ('modulo L3v2') a flag that controls how the 449 * parser will handle the @% ('modulo') symbol in formulas. By default, 450 * the parser will convert 'a % b' to a piecewise function that properly 451 * calculates the remainder of a with respect to be, but the parser can 452 * also be set to produce the MathML @c rem function, should the target 453 * of the produced ASTNode be an SBML Level 3 Version 2 454 * document, where the @c rem function is legal. 455 * The possible values of this field are 456 * @link libsbml#L3P_MODULO_IS_PIECEWISE L3P_MODULO_IS_PIECEWISE@endlink (to parse @% as a piecewise function) and 457 * @link libsbml#L3P_MODULO_IS_REM L3P_MODULO_IS_REM@endlink (to parse @% as @c rem). 458 * 459 * @param l3v2functions ('parse L3v2 functions directly') is a Boolean flag 460 * that controls how to translate certain mathematical functions added in SBML 461 * Level 3 Version 2 Core. The parser can either turn them into 462 * specific AST node types, or turn them all into 463 * @link libsbml#AST_FUNCTION AST_FUNCTION@endlink with the name set to the 464 * function name in question. 465 * 466 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 467 * 468 * @see getModel() 469 * @see setModel(@if java Model@endif) 470 * @see unsetModel() 471 * @see getParseLog() 472 * @see setParseLog(@if java int@endif) 473 * @see getParseUnits() 474 * @see setParseUnits(@if java boolean@endif) 475 * @see getParseCollapseMinus() 476 * @see setParseCollapseMinus(@if java boolean@endif) 477 * @see getParseAvogadroCsymbol() 478 * @see setParseAvogadroCsymbol(@if java boolean@endif) 479 * @see getParseModuloL3v2() 480 * @see setParseModuloL3v2(@if java boolean@endif) 481 * @see getParseL3v2Functions() 482 * @see setParseL3v2Functions(@if java boolean@endif) 483 */ public L3ParserSettings(Model model, int parselog, bool collapseminus, bool parseunits, bool avocsymbol, bool caseSensitive, SBMLNamespaces sbmlns)484 L3ParserSettings(Model model, int parselog, bool collapseminus, bool parseunits, bool avocsymbol, bool caseSensitive, SBMLNamespaces sbmlns) : this(libsbmlPINVOKE.new_L3ParserSettings__SWIG_3(Model.getCPtr(model), parselog, collapseminus, parseunits, avocsymbol, caseSensitive, SBMLNamespaces.getCPtr(sbmlns)), true) { 485 } 486 487 488 /** 489 * Creates a new L3ParserSettings object with specific values for all 490 * possible settings. 491 * 492 * @param model a Model object to be used for disambiguating identifiers 493 * encountered by @sbmlfunction{parseL3FormulaWithSettings, String\, 494 * L3ParserSettings} in mathematical formulas. 495 * 496 * @param parselog ('parse log') a flag that controls how the parser will 497 * handle the symbol @c log in mathematical formulas. The function @c log 498 * with a single argument ("<code>log(x)</code>") can be parsed 499 * as <code>log10(x)</code>, <code>ln(x)</code>, or treated as an error, as 500 * desired, by using the parameter values 501 * @link libsbml#L3P_PARSE_LOG_AS_LOG10 L3P_PARSE_LOG_AS_LOG10@endlink, 502 * @link libsbml#L3P_PARSE_LOG_AS_LN L3P_PARSE_LOG_AS_LN@endlink, or 503 * @link libsbml#L3P_PARSE_LOG_AS_ERROR L3P_PARSE_LOG_AS_ERROR@endlink, respectively. 504 * 505 * @param collapseminus ('collapse minus') a flag that controls how the 506 * parser will handle minus signs in formulas. Unary minus signs can be 507 * collapsed or preserved; that is, sequential pairs of unary minuses 508 * (e.g., "<code>- -3</code>") can be removed from the input 509 * entirely and single unary minuses can be incorporated into the number 510 * node, or all minuses can be preserved in the AST node structure. 511 * The possible values of this field are 512 * @link libsbml#L3P_COLLAPSE_UNARY_MINUS L3P_COLLAPSE_UNARY_MINUS@endlink (to collapse unary minuses) and 513 * @link libsbml#L3P_EXPAND_UNARY_MINUS L3P_EXPAND_UNARY_MINUS@endlink (to expand unary minuses). 514 * 515 * @param parseunits ('parse units') a flag that controls how the parser 516 * will handle apparent references to units of measurement associated with 517 * raw numbers in a formula. If set to the value 518 * @link libsbml#L3P_PARSE_UNITS L3P_PARSE_UNITS@endlink, units are parsed; if set to the value 519 * @link libsbml#L3P_NO_UNITS L3P_NO_UNITS@endlink, units are not parsed. 520 * 521 * @param avocsymbol ('Avogadro csymbol') a flag that controls how the 522 * parser will handle the appearance of the symbol @c avogadro in a 523 * formula. If set to the value @link libsbml#L3P_AVOGADRO_IS_CSYMBOL L3P_AVOGADRO_IS_CSYMBOL@endlink, 524 * the symbol is interpreted as the SBML/MathML @em csymbol @c avogadro; if 525 * set to the value @link libsbml#L3P_AVOGADRO_IS_NAME L3P_AVOGADRO_IS_NAME@endlink, the symbol is 526 * interpreted as a plain symbol name. 527 * 528 * @param caseSensitive ('case sensitive') a flag that controls how the 529 * cases of alphabetical characters are treated when symbols are compared. 530 * If the flag is set to the value 531 * @link libsbml#L3P_COMPARE_BUILTINS_CASE_INSENSITIVE L3P_COMPARE_BUILTINS_CASE_INSENSITIVE@endlink, symbols are 532 * compared in a case-insensitive manner, which means that mathematical 533 * functions such as @c 'sin' will be matched no matter what their case is: 534 * @c 'Sin', @c 'SIN', etc. If the flag is set to the value 535 * @link libsbml#L3P_COMPARE_BUILTINS_CASE_SENSITIVE L3P_COMPARE_BUILTINS_CASE_SENSITIVE@endlink, symbols are 536 * interpreted in a case-sensitive manner. 537 * 538 * @param sbmlns ('SBML namespaces') an SBML namespaces object. The 539 * namespaces identify the SBML Level 3 packages that can extend the 540 * syntax understood by the formula parser. When non-@c null, the parser 541 * will interpret additional syntax defined by the packages; for example, 542 * it may understand vector/array extensions introduced by the SBML 543 * Level 3 @em Arrays package. 544 * 545 * @param moduloL3v2 ('modulo L3v2') a flag that controls how the 546 * parser will handle the @% ('modulo') symbol in formulas. By default, 547 * the parser will convert 'a % b' to a piecewise function that properly 548 * calculates the remainder of a with respect to be, but the parser can 549 * also be set to produce the MathML @c rem function, should the target 550 * of the produced ASTNode be an SBML Level 3 Version 2 551 * document, where the @c rem function is legal. 552 * The possible values of this field are 553 * @link libsbml#L3P_MODULO_IS_PIECEWISE L3P_MODULO_IS_PIECEWISE@endlink (to parse @% as a piecewise function) and 554 * @link libsbml#L3P_MODULO_IS_REM L3P_MODULO_IS_REM@endlink (to parse @% as @c rem). 555 * 556 * @param l3v2functions ('parse L3v2 functions directly') is a Boolean flag 557 * that controls how to translate certain mathematical functions added in SBML 558 * Level 3 Version 2 Core. The parser can either turn them into 559 * specific AST node types, or turn them all into 560 * @link libsbml#AST_FUNCTION AST_FUNCTION@endlink with the name set to the 561 * function name in question. 562 * 563 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 564 * 565 * @see getModel() 566 * @see setModel(@if java Model@endif) 567 * @see unsetModel() 568 * @see getParseLog() 569 * @see setParseLog(@if java int@endif) 570 * @see getParseUnits() 571 * @see setParseUnits(@if java boolean@endif) 572 * @see getParseCollapseMinus() 573 * @see setParseCollapseMinus(@if java boolean@endif) 574 * @see getParseAvogadroCsymbol() 575 * @see setParseAvogadroCsymbol(@if java boolean@endif) 576 * @see getParseModuloL3v2() 577 * @see setParseModuloL3v2(@if java boolean@endif) 578 * @see getParseL3v2Functions() 579 * @see setParseL3v2Functions(@if java boolean@endif) 580 */ public L3ParserSettings(Model model, int parselog, bool collapseminus, bool parseunits, bool avocsymbol, bool caseSensitive)581 L3ParserSettings(Model model, int parselog, bool collapseminus, bool parseunits, bool avocsymbol, bool caseSensitive) : this(libsbmlPINVOKE.new_L3ParserSettings__SWIG_4(Model.getCPtr(model), parselog, collapseminus, parseunits, avocsymbol, caseSensitive), true) { 582 } 583 584 585 /** 586 * Creates a new L3ParserSettings object with specific values for all 587 * possible settings. 588 * 589 * @param model a Model object to be used for disambiguating identifiers 590 * encountered by @sbmlfunction{parseL3FormulaWithSettings, String\, 591 * L3ParserSettings} in mathematical formulas. 592 * 593 * @param parselog ('parse log') a flag that controls how the parser will 594 * handle the symbol @c log in mathematical formulas. The function @c log 595 * with a single argument ("<code>log(x)</code>") can be parsed 596 * as <code>log10(x)</code>, <code>ln(x)</code>, or treated as an error, as 597 * desired, by using the parameter values 598 * @link libsbml#L3P_PARSE_LOG_AS_LOG10 L3P_PARSE_LOG_AS_LOG10@endlink, 599 * @link libsbml#L3P_PARSE_LOG_AS_LN L3P_PARSE_LOG_AS_LN@endlink, or 600 * @link libsbml#L3P_PARSE_LOG_AS_ERROR L3P_PARSE_LOG_AS_ERROR@endlink, respectively. 601 * 602 * @param collapseminus ('collapse minus') a flag that controls how the 603 * parser will handle minus signs in formulas. Unary minus signs can be 604 * collapsed or preserved; that is, sequential pairs of unary minuses 605 * (e.g., "<code>- -3</code>") can be removed from the input 606 * entirely and single unary minuses can be incorporated into the number 607 * node, or all minuses can be preserved in the AST node structure. 608 * The possible values of this field are 609 * @link libsbml#L3P_COLLAPSE_UNARY_MINUS L3P_COLLAPSE_UNARY_MINUS@endlink (to collapse unary minuses) and 610 * @link libsbml#L3P_EXPAND_UNARY_MINUS L3P_EXPAND_UNARY_MINUS@endlink (to expand unary minuses). 611 * 612 * @param parseunits ('parse units') a flag that controls how the parser 613 * will handle apparent references to units of measurement associated with 614 * raw numbers in a formula. If set to the value 615 * @link libsbml#L3P_PARSE_UNITS L3P_PARSE_UNITS@endlink, units are parsed; if set to the value 616 * @link libsbml#L3P_NO_UNITS L3P_NO_UNITS@endlink, units are not parsed. 617 * 618 * @param avocsymbol ('Avogadro csymbol') a flag that controls how the 619 * parser will handle the appearance of the symbol @c avogadro in a 620 * formula. If set to the value @link libsbml#L3P_AVOGADRO_IS_CSYMBOL L3P_AVOGADRO_IS_CSYMBOL@endlink, 621 * the symbol is interpreted as the SBML/MathML @em csymbol @c avogadro; if 622 * set to the value @link libsbml#L3P_AVOGADRO_IS_NAME L3P_AVOGADRO_IS_NAME@endlink, the symbol is 623 * interpreted as a plain symbol name. 624 * 625 * @param caseSensitive ('case sensitive') a flag that controls how the 626 * cases of alphabetical characters are treated when symbols are compared. 627 * If the flag is set to the value 628 * @link libsbml#L3P_COMPARE_BUILTINS_CASE_INSENSITIVE L3P_COMPARE_BUILTINS_CASE_INSENSITIVE@endlink, symbols are 629 * compared in a case-insensitive manner, which means that mathematical 630 * functions such as @c 'sin' will be matched no matter what their case is: 631 * @c 'Sin', @c 'SIN', etc. If the flag is set to the value 632 * @link libsbml#L3P_COMPARE_BUILTINS_CASE_SENSITIVE L3P_COMPARE_BUILTINS_CASE_SENSITIVE@endlink, symbols are 633 * interpreted in a case-sensitive manner. 634 * 635 * @param sbmlns ('SBML namespaces') an SBML namespaces object. The 636 * namespaces identify the SBML Level 3 packages that can extend the 637 * syntax understood by the formula parser. When non-@c null, the parser 638 * will interpret additional syntax defined by the packages; for example, 639 * it may understand vector/array extensions introduced by the SBML 640 * Level 3 @em Arrays package. 641 * 642 * @param moduloL3v2 ('modulo L3v2') a flag that controls how the 643 * parser will handle the @% ('modulo') symbol in formulas. By default, 644 * the parser will convert 'a % b' to a piecewise function that properly 645 * calculates the remainder of a with respect to be, but the parser can 646 * also be set to produce the MathML @c rem function, should the target 647 * of the produced ASTNode be an SBML Level 3 Version 2 648 * document, where the @c rem function is legal. 649 * The possible values of this field are 650 * @link libsbml#L3P_MODULO_IS_PIECEWISE L3P_MODULO_IS_PIECEWISE@endlink (to parse @% as a piecewise function) and 651 * @link libsbml#L3P_MODULO_IS_REM L3P_MODULO_IS_REM@endlink (to parse @% as @c rem). 652 * 653 * @param l3v2functions ('parse L3v2 functions directly') is a Boolean flag 654 * that controls how to translate certain mathematical functions added in SBML 655 * Level 3 Version 2 Core. The parser can either turn them into 656 * specific AST node types, or turn them all into 657 * @link libsbml#AST_FUNCTION AST_FUNCTION@endlink with the name set to the 658 * function name in question. 659 * 660 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 661 * 662 * @see getModel() 663 * @see setModel(@if java Model@endif) 664 * @see unsetModel() 665 * @see getParseLog() 666 * @see setParseLog(@if java int@endif) 667 * @see getParseUnits() 668 * @see setParseUnits(@if java boolean@endif) 669 * @see getParseCollapseMinus() 670 * @see setParseCollapseMinus(@if java boolean@endif) 671 * @see getParseAvogadroCsymbol() 672 * @see setParseAvogadroCsymbol(@if java boolean@endif) 673 * @see getParseModuloL3v2() 674 * @see setParseModuloL3v2(@if java boolean@endif) 675 * @see getParseL3v2Functions() 676 * @see setParseL3v2Functions(@if java boolean@endif) 677 */ public L3ParserSettings(Model model, int parselog, bool collapseminus, bool parseunits, bool avocsymbol)678 L3ParserSettings(Model model, int parselog, bool collapseminus, bool parseunits, bool avocsymbol) : this(libsbmlPINVOKE.new_L3ParserSettings__SWIG_5(Model.getCPtr(model), parselog, collapseminus, parseunits, avocsymbol), true) { 679 } 680 681 682 /** 683 * Copy constructor. 684 * 685 * @param source the instance to copy. 686 */ public L3ParserSettings(L3ParserSettings source)687 L3ParserSettings(L3ParserSettings source) : this(libsbmlPINVOKE.new_L3ParserSettings__SWIG_6(L3ParserSettings.getCPtr(source)), true) { 688 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 689 } 690 691 692 /** 693 * Sets the model reference in this L3ParserSettings object. 694 * 695 * 696 * 697 * When a Model object is provided, identifiers (values of type @c SId) 698 * from that model are used in preference to pre-defined MathML symbol 699 * definitions. More precisely, the Model entities whose identifiers will 700 * shadow identical symbols in the mathematical formula are: Species, 701 * Compartment, Parameter, Reaction, and SpeciesReference. For instance, if 702 * the parser is given a Model containing a Species with the identifier 703 * "<code>pi</code>", and the formula to be parsed is 704 * "<code>3*pi</code>", the MathML produced will contain the 705 * construct <code><ci> pi </ci></code> instead of the construct 706 * <code><pi/></code>. Similarly, when a Model object is provided, 707 * @c SId values of user-defined functions present in the Model will be used 708 * preferentially over pre-defined MathML functions. For example, if the 709 * passed-in Model contains a FunctionDefinition with the identifier 710 * "<code>sin</code>", that function will be used instead of the 711 * predefined MathML function <code><sin/></code>. 712 * 713 * 714 * @param model a Model object to be used for disambiguating identifiers. 715 * 716 * @warning <span class='warning'>This does @em not copy the Model object. 717 * This means that modifications made to the Model after invoking this 718 * method may affect parsing behavior, because the parser will query the 719 * @em current contents of the model.</span> 720 * 721 * @see getModel() 722 * @see unsetModel() 723 */ public setModel(Model model)724 void setModel(Model model) { 725 libsbmlPINVOKE.L3ParserSettings_setModel(swigCPtr, Model.getCPtr(model)); 726 } 727 728 729 /** 730 * Returns the Model object referenced by this L3ParserSettings object. 731 * 732 * 733 * 734 * When a Model object is provided, identifiers (values of type @c SId) 735 * from that model are used in preference to pre-defined MathML symbol 736 * definitions. More precisely, the Model entities whose identifiers will 737 * shadow identical symbols in the mathematical formula are: Species, 738 * Compartment, Parameter, Reaction, and SpeciesReference. For instance, if 739 * the parser is given a Model containing a Species with the identifier 740 * "<code>pi</code>", and the formula to be parsed is 741 * "<code>3*pi</code>", the MathML produced will contain the 742 * construct <code><ci> pi </ci></code> instead of the construct 743 * <code><pi/></code>. Similarly, when a Model object is provided, 744 * @c SId values of user-defined functions present in the Model will be used 745 * preferentially over pre-defined MathML functions. For example, if the 746 * passed-in Model contains a FunctionDefinition with the identifier 747 * "<code>sin</code>", that function will be used instead of the 748 * predefined MathML function <code><sin/></code>. 749 * 750 * 751 * @see setModel(@if java Model@endif) 752 * @see unsetModel() 753 */ public getModel()754 Model getModel() { 755 global::System.IntPtr cPtr = libsbmlPINVOKE.L3ParserSettings_getModel(swigCPtr); 756 Model ret = (cPtr == global::System.IntPtr.Zero) ? null : new Model(cPtr, false); 757 return ret; 758 } 759 760 761 /** 762 * Unsets the Model reference in this L3ParserSettings object. 763 * 764 * The effect of calling this method is to set the stored model value 765 * to @c null. 766 * 767 * @see setModel(@if java Model@endif) 768 * @see getModel() 769 */ public unsetModel()770 void unsetModel() { 771 libsbmlPINVOKE.L3ParserSettings_unsetModel(swigCPtr); 772 } 773 774 775 /** 776 * Sets the behavior for handling @c log in mathematical formulas. 777 * 778 * The function @c log with a single argument 779 * ("<code>log(x)</code>") can be parsed as 780 * <code>log10(x)</code>, <code>ln(x)</code>, or treated as an error. 781 * These three behaviors are set, respectively, by using the value 782 * @link libsbml#L3P_PARSE_LOG_AS_LOG10 L3P_PARSE_LOG_AS_LOG10@endlink, 783 * @link libsbml#L3P_PARSE_LOG_AS_LN L3P_PARSE_LOG_AS_LN@endlink, or 784 * @link libsbml#L3P_PARSE_LOG_AS_ERROR L3P_PARSE_LOG_AS_ERROR@endlink 785 * for the @p type parameter. 786 * 787 * @param type a constant, one of following three possibilities: 788 * @li @link libsbml#L3P_PARSE_LOG_AS_LOG10 L3P_PARSE_LOG_AS_LOG10@endlink 789 * @li @link libsbml#L3P_PARSE_LOG_AS_LN L3P_PARSE_LOG_AS_LN@endlink 790 * @li @link libsbml#L3P_PARSE_LOG_AS_ERROR L3P_PARSE_LOG_AS_ERROR@endlink 791 * 792 * @see getParseLog() 793 */ public setParseLog(int type)794 void setParseLog(int type) { 795 libsbmlPINVOKE.L3ParserSettings_setParseLog(swigCPtr, type); 796 } 797 798 799 /** 800 * Indicates the current behavior set for handling the function @c log with 801 * one argument. 802 * 803 * The function @c log with a single argument 804 * ("<code>log(x)</code>") can be parsed as 805 * <code>log10(x)</code>, <code>ln(x)</code>, or treated as an error, as 806 * desired. These three possible behaviors are indicated, respectively, by 807 * the values 808 * @link libsbml#L3P_PARSE_LOG_AS_LOG10 L3P_PARSE_LOG_AS_LOG10@endlink, 809 * @link libsbml#L3P_PARSE_LOG_AS_LN L3P_PARSE_LOG_AS_LN@endlink, and 810 * @link libsbml#L3P_PARSE_LOG_AS_ERROR L3P_PARSE_LOG_AS_ERROR@endlink. 811 * 812 * @return One of following three constants: 813 * @li @link libsbml#L3P_PARSE_LOG_AS_LOG10 L3P_PARSE_LOG_AS_LOG10@endlink 814 * @li @link libsbml#L3P_PARSE_LOG_AS_LN L3P_PARSE_LOG_AS_LN@endlink 815 * @li @link libsbml#L3P_PARSE_LOG_AS_ERROR L3P_PARSE_LOG_AS_ERROR@endlink 816 * 817 * @see setParseLog(@if java int@endif) 818 */ public getParseLog()819 int getParseLog() { 820 int ret = libsbmlPINVOKE.L3ParserSettings_getParseLog(swigCPtr); 821 return ret; 822 } 823 824 825 /** 826 * Sets the behavior for handling unary minuses appearing in mathematical 827 * formulas. 828 * 829 * 830 * 831 * This setting affects two behaviors. First, pairs of multiple unary 832 * minuses in a row (e.g., "<code>- -3</code>") can be collapsed 833 * and ignored in the input, or the multiple minuses can be preserved in the 834 * AST node tree that is generated by the parser. Second, minus signs in 835 * front of numbers can be collapsed into the number node itself; for 836 * example, a "<code>- 4.1</code>" can be turned into a single 837 * ASTNode of type @link libsbml#AST_REAL AST_REAL@endlink with a value of 838 * <code>-4.1</code>, or it can be turned into a node of type 839 * @link libsbml#AST_MINUS AST_MINUS@endlink having a child node of type 840 * @link libsbml#AST_REAL AST_REAL@endlink. 841 * 842 * 843 * This method lets you tell the parser which behavior to use---either 844 * collapse minuses or always preserve them. The two possibilities are 845 * represented using the following constants: 846 * 847 * 848 * <ul> 849 * <li> @link libsbml#L3P_COLLAPSE_UNARY_MINUS L3P_COLLAPSE_UNARY_MINUS@endlink (value = @c true): collapse 850 * unary minuses where possible. 851 * <li> @link libsbml#L3P_EXPAND_UNARY_MINUS L3P_EXPAND_UNARY_MINUS@endlink (value = @c false): do not 852 * collapse unary minuses, and instead translate each one into an AST node of 853 * type @link libsbml#AST_MINUS AST_MINUS@endlink. 854 * </ul> 855 * 856 * 857 * @param collapseminus a boolean value (one of the constants 858 * @link libsbml#L3P_COLLAPSE_UNARY_MINUS L3P_COLLAPSE_UNARY_MINUS@endlink or 859 * @link libsbml#L3P_EXPAND_UNARY_MINUS L3P_EXPAND_UNARY_MINUS@endlink) 860 * indicating how unary minus signs in the input should be handled. 861 * 862 * @see getParseCollapseMinus() 863 */ public setParseCollapseMinus(bool collapseminus)864 void setParseCollapseMinus(bool collapseminus) { 865 libsbmlPINVOKE.L3ParserSettings_setParseCollapseMinus(swigCPtr, collapseminus); 866 } 867 868 869 /** 870 * Indicates the current behavior set for handling multiple unary minuses 871 * in formulas. 872 * 873 * 874 * 875 * This setting affects two behaviors. First, pairs of multiple unary 876 * minuses in a row (e.g., "<code>- -3</code>") can be collapsed 877 * and ignored in the input, or the multiple minuses can be preserved in the 878 * AST node tree that is generated by the parser. Second, minus signs in 879 * front of numbers can be collapsed into the number node itself; for 880 * example, a "<code>- 4.1</code>" can be turned into a single 881 * ASTNode of type @link libsbml#AST_REAL AST_REAL@endlink with a value of 882 * <code>-4.1</code>, or it can be turned into a node of type 883 * @link libsbml#AST_MINUS AST_MINUS@endlink having a child node of type 884 * @link libsbml#AST_REAL AST_REAL@endlink. 885 * 886 * 887 * @return A boolean indicating the behavior currently set. The possible 888 * values are as follows: 889 * 890 * <ul> 891 * <li> @link libsbml#L3P_COLLAPSE_UNARY_MINUS L3P_COLLAPSE_UNARY_MINUS@endlink (value = @c true): collapse 892 * unary minuses where possible. 893 * <li> @link libsbml#L3P_EXPAND_UNARY_MINUS L3P_EXPAND_UNARY_MINUS@endlink (value = @c false): do not 894 * collapse unary minuses, and instead translate each one into an AST node of 895 * type @link libsbml#AST_MINUS AST_MINUS@endlink. 896 * </ul> 897 * 898 * 899 * @see setParseCollapseMinus(@if java boolean@endif) 900 */ public getParseCollapseMinus()901 bool getParseCollapseMinus() { 902 bool ret = libsbmlPINVOKE.L3ParserSettings_getParseCollapseMinus(swigCPtr); 903 return ret; 904 } 905 906 907 /** 908 * Sets the parser's behavior in handling units associated with numbers 909 * in a mathematical formula. 910 * 911 * 912 * 913 * In SBML Level 2, there is no means of associating a unit of 914 * measurement with a pure number in a formula, while SBML Level 3 does 915 * define a syntax for this. In Level 3, MathML <code><cn></code> 916 * elements can have an attribute named @c units placed in the SBML 917 * namespace, which can be used to indicate the units to be associated with 918 * the number. The text-string infix formula parser allows units to be 919 * placed after raw numbers; they are interpreted as unit identifiers for 920 * units defined by the SBML specification or in the containing Model object. 921 * Some examples include: "<code>4 mL</code>", "<code>2.01 922 * Hz</code>", "<code>3.1e-6 M</code>", and "<code>(5/8) 923 * inches</code>". To produce a valid SBML model, there must either 924 * exist a UnitDefinition corresponding to the identifier of the unit, or the 925 * unit must be defined in Table 2 of the SBML Level 3 specification. 926 * 927 * 928 * This method sets the formula parser's behavior with respect to units. 929 * 930 * @param units a boolean indicating whether to parse units. The 931 * possible values are as follows: 932 * 933 * <ul> 934 * <li> @link libsbml#L3P_PARSE_UNITS L3P_PARSE_UNITS@endlink (value = @c true): parse units in the 935 * text-string formula. 936 * <li> @link libsbml#L3P_NO_UNITS L3P_NO_UNITS@endlink (value = @c false): treat units in the 937 * text-string formula as errors. 938 * </ul> 939 * 940 * 941 * @see getParseUnits() 942 */ public setParseUnits(bool units)943 void setParseUnits(bool units) { 944 libsbmlPINVOKE.L3ParserSettings_setParseUnits(swigCPtr, units); 945 } 946 947 948 /** 949 * Indicates the current behavior set for handling units in text-string 950 * mathematical formulas. 951 * 952 * 953 * 954 * In SBML Level 2, there is no means of associating a unit of 955 * measurement with a pure number in a formula, while SBML Level 3 does 956 * define a syntax for this. In Level 3, MathML <code><cn></code> 957 * elements can have an attribute named @c units placed in the SBML 958 * namespace, which can be used to indicate the units to be associated with 959 * the number. The text-string infix formula parser allows units to be 960 * placed after raw numbers; they are interpreted as unit identifiers for 961 * units defined by the SBML specification or in the containing Model object. 962 * Some examples include: "<code>4 mL</code>", "<code>2.01 963 * Hz</code>", "<code>3.1e-6 M</code>", and "<code>(5/8) 964 * inches</code>". To produce a valid SBML model, there must either 965 * exist a UnitDefinition corresponding to the identifier of the unit, or the 966 * unit must be defined in Table 2 of the SBML Level 3 specification. 967 * 968 * 969 * Since SBML Level 2 does not have the ability to associate units 970 * with pure numbers, the value should be expected to be @c false 971 * (@link libsbml#L3P_NO_UNITS L3P_NO_UNITS@endlink) when parsing text-string 972 * formulas intended for use in SBML Level 2 documents. 973 * 974 * @return A boolean indicating whether to parse units. The 975 * possible values are as follows: 976 * 977 * <ul> 978 * <li> @link libsbml#L3P_PARSE_UNITS L3P_PARSE_UNITS@endlink (value = @c true): parse units in the 979 * text-string formula. 980 * <li> @link libsbml#L3P_NO_UNITS L3P_NO_UNITS@endlink (value = @c false): treat units in the 981 * text-string formula as errors. 982 * </ul> 983 * 984 * 985 * @see setParseUnits(@if java boolean@endif) 986 */ public getParseUnits()987 bool getParseUnits() { 988 bool ret = libsbmlPINVOKE.L3ParserSettings_getParseUnits(swigCPtr); 989 return ret; 990 } 991 992 993 /** 994 * Sets the parser's behavior in handling the symbol @c avogadro in 995 * mathematical formulas. 996 * 997 * 998 * 999 * SBML Level 3 defines a symbol for representing the value of 1000 * Avogadro's constant, but it is not defined in SBML Level 2. As a 1001 * result, the text-string formula parser must behave differently 1002 * depending on which SBML Level is being targeted. For Level 3 1003 * documents, it can interpret instances of @c avogadro in the input 1004 * as a reference to the MathML @em csymbol for Avogadro's constant 1005 * defined in the SBML Level 3 specification. For Level 2, 1006 * it must treat @c avogadro as just another plain symbol. 1007 * 1008 * 1009 * This method allows callers to set the <code>avogadro</code>-handling 1010 * behavior in this L3ParserSettings object. The possible values of @p 1011 * l2only are as follows: 1012 * 1013 * 1014 * <ul> 1015 * <li> @link libsbml#L3P_AVOGADRO_IS_CSYMBOL L3P_AVOGADRO_IS_CSYMBOL@endlink (value = @c true): tells the 1016 * parser to translate the string @c avogadro (in any capitalization) into an 1017 * AST node of type @link libsbml#AST_NAME_AVOGADRO AST_NAME_AVOGADRO@endlink. 1018 * <li> @link libsbml#L3P_AVOGADRO_IS_NAME L3P_AVOGADRO_IS_NAME@endlink (value = @c false): tells the 1019 * parser to translate the string @c avogadro into an AST of type 1020 * @link libsbml#AST_NAME AST_NAME@endlink. 1021 * </ul> 1022 * 1023 * 1024 * Since SBML Level 2 does not define a symbol for Avogadro's 1025 * constant, the value should be set to 1026 * @link libsbml#L3P_AVOGADRO_IS_NAME L3P_AVOGADRO_IS_NAME@endlink when parsing text-string formulas 1027 * intended for use in SBML Level 2 documents. 1028 * 1029 * @param l2only a boolean value indicating how the string @c avogadro 1030 * should be treated when encountered in a formula. This will be one of 1031 * the values @link libsbml#L3P_AVOGADRO_IS_CSYMBOL L3P_AVOGADRO_IS_CSYMBOL@endlink or 1032 * @link libsbml#L3P_AVOGADRO_IS_NAME L3P_AVOGADRO_IS_NAME@endlink. 1033 * 1034 * @see getParseAvogadroCsymbol() 1035 */ public setParseAvogadroCsymbol(bool l2only)1036 void setParseAvogadroCsymbol(bool l2only) { 1037 libsbmlPINVOKE.L3ParserSettings_setParseAvogadroCsymbol(swigCPtr, l2only); 1038 } 1039 1040 1041 /** 1042 * Indicates the current behavior set for handling @c avogadro for SBML 1043 * Level 3. 1044 * 1045 * 1046 * 1047 * SBML Level 3 defines a symbol for representing the value of 1048 * Avogadro's constant, but it is not defined in SBML Level 2. As a 1049 * result, the text-string formula parser must behave differently 1050 * depending on which SBML Level is being targeted. For Level 3 1051 * documents, it can interpret instances of @c avogadro in the input 1052 * as a reference to the MathML @em csymbol for Avogadro's constant 1053 * defined in the SBML Level 3 specification. For Level 2, 1054 * it must treat @c avogadro as just another plain symbol. 1055 * 1056 * 1057 * This method returns the current setting of the 1058 * <code>avogadro</code>-handling behavior in this L3ParserSettings object. 1059 * The possible values are as follows: 1060 * 1061 * 1062 * <ul> 1063 * <li> @link libsbml#L3P_AVOGADRO_IS_CSYMBOL L3P_AVOGADRO_IS_CSYMBOL@endlink (value = @c true): tells the 1064 * parser to translate the string @c avogadro (in any capitalization) into an 1065 * AST node of type @link libsbml#AST_NAME_AVOGADRO AST_NAME_AVOGADRO@endlink. 1066 * <li> @link libsbml#L3P_AVOGADRO_IS_NAME L3P_AVOGADRO_IS_NAME@endlink (value = @c false): tells the 1067 * parser to translate the string @c avogadro into an AST of type 1068 * @link libsbml#AST_NAME AST_NAME@endlink. 1069 * </ul> 1070 * 1071 * 1072 * @return A boolean indicating which mode is currently set; one of 1073 * @link libsbml#L3P_AVOGADRO_IS_CSYMBOL L3P_AVOGADRO_IS_CSYMBOL@endlink 1074 * or 1075 * @link libsbml#L3P_AVOGADRO_IS_NAME L3P_AVOGADRO_IS_NAME@endlink. 1076 * 1077 * @see setParseAvogadroCsymbol(@if java boolean@endif) 1078 */ public getParseAvogadroCsymbol()1079 bool getParseAvogadroCsymbol() { 1080 bool ret = libsbmlPINVOKE.L3ParserSettings_getParseAvogadroCsymbol(swigCPtr); 1081 return ret; 1082 } 1083 1084 1085 /** 1086 * Sets the parser's behavior with respect to case sensitivity for 1087 * recognizing predefined symbols. 1088 * 1089 * 1090 * 1091 * By default (which is the value 1092 * @link libsbml#L3P_COMPARE_BUILTINS_CASE_INSENSITIVE L3P_COMPARE_BUILTINS_CASE_INSENSITIVE@endlink), the parser 1093 * compares symbols in a case @em insensitive manner for built-in functions 1094 * such as @c 'sin' and @c 'piecewise', and for constants such as @c 'true' 1095 * and @c 'avogadro'. Setting this option to 1096 * @link libsbml#L3P_COMPARE_BUILTINS_CASE_SENSITIVE L3P_COMPARE_BUILTINS_CASE_SENSITIVE@endlink causes the parser to 1097 * become case sensitive. In that mode, for example, the symbols @c 'sin' 1098 * and @c 'true' will match the built-in values, but the symbols @c 'SIN', 1099 * @c 'Sin', @c 'True', @c 'TRUE', and so on, will not. 1100 * 1101 * 1102 * @param strcmp a boolean indicating whether to be case sensitive (if 1103 * @c true) or be case insensitive (if @c false). 1104 * 1105 * @see getComparisonCaseSensitivity() 1106 */ public setComparisonCaseSensitivity(bool strcmp)1107 void setComparisonCaseSensitivity(bool strcmp) { 1108 libsbmlPINVOKE.L3ParserSettings_setComparisonCaseSensitivity(swigCPtr, strcmp); 1109 } 1110 1111 1112 /** 1113 * Returns @c true if the parser is configured to match built-in symbols 1114 * in a case-insensitive way. 1115 * 1116 * 1117 * 1118 * By default (which is the value 1119 * @link libsbml#L3P_COMPARE_BUILTINS_CASE_INSENSITIVE L3P_COMPARE_BUILTINS_CASE_INSENSITIVE@endlink), the parser 1120 * compares symbols in a case @em insensitive manner for built-in functions 1121 * such as @c 'sin' and @c 'piecewise', and for constants such as @c 'true' 1122 * and @c 'avogadro'. Setting this option to 1123 * @link libsbml#L3P_COMPARE_BUILTINS_CASE_SENSITIVE L3P_COMPARE_BUILTINS_CASE_SENSITIVE@endlink causes the parser to 1124 * become case sensitive. In that mode, for example, the symbols @c 'sin' 1125 * and @c 'true' will match the built-in values, but the symbols @c 'SIN', 1126 * @c 'Sin', @c 'True', @c 'TRUE', and so on, will not. 1127 * 1128 * 1129 * @return @c true if matches are done in a case-sensitive manner, and 1130 * @c false if the parser will recognize built-in functions and 1131 * constants regardless of case,. 1132 * 1133 * @see setComparisonCaseSensitivity(@if java boolean@endif) 1134 */ public getComparisonCaseSensitivity()1135 bool getComparisonCaseSensitivity() { 1136 bool ret = libsbmlPINVOKE.L3ParserSettings_getComparisonCaseSensitivity(swigCPtr); 1137 return ret; 1138 } 1139 1140 1141 /** 1142 * Sets the behavior for handling the @% symbol in mathematical 1143 * formulas. 1144 * 1145 * 1146 * 1147 * This setting affects whether the @% symbol (modulo) is parsed as a 1148 * piecewise equation that returns the modulo value of the entries on 1149 * either side of the symbol, or whether it is parsed as the MathML 1150 * 'rem' function, which was allowed in SBML Level 3 Version 2, 1151 * but not in previous level/versions. The latter is more succinct, but 1152 * might not be legal SBML for the desired target SBML document. 1153 * 1154 * 1155 * This method lets you tell the parser which behavior to use---either 1156 * parse @% as the 'rem' function or as a piecewise function with the 1157 * same interpretation. The two possibilities are 1158 * represented using the following constants: 1159 * 1160 * 1161 * <ul> 1162 * <li> @link libsbml#L3P_MODULO_IS_REM L3P_MODULO_IS_REM@endlink (value = @c true): use the 1163 * 'rem' MathML function (@link libsbml#AST_FUNCTION_REM AST_FUNCTION_REM@endlink). 1164 * <li> @link libsbml#L3P_MODULO_IS_PIECEWISE L3P_MODULO_IS_PIECEWISE@endlink (value = @c false): use 1165 * a piecewise function (@link libsbml#AST_FUNCTION_PIECEWISE AST_FUNCTION_PIECEWISE@endlink) 1166 * to encode the modulo rule explicitly. 1167 * </ul> 1168 * 1169 * 1170 * @param modulol3v2 a boolean value (one of the constants 1171 * @link libsbml#L3P_MODULO_IS_PIECEWISE L3P_MODULO_IS_PIECEWISE@endlink or 1172 * @link libsbml#L3P_MODULO_IS_REM L3P_MODULO_IS_REM@endlink) 1173 * indicating how the @% symbol in the input should be handled. 1174 * 1175 * @see getParseModuloL3v2() 1176 */ public setParseModuloL3v2(bool modulol3v2)1177 void setParseModuloL3v2(bool modulol3v2) { 1178 libsbmlPINVOKE.L3ParserSettings_setParseModuloL3v2(swigCPtr, modulol3v2); 1179 } 1180 1181 1182 /** 1183 * Indicates the current behavior set for handling the @% symbol in 1184 * mathematical formulas. 1185 * 1186 * 1187 * 1188 * This setting affects whether the @% symbol (modulo) is parsed as a 1189 * piecewise equation that returns the modulo value of the entries on 1190 * either side of the symbol, or whether it is parsed as the MathML 1191 * 'rem' function, which was allowed in SBML Level 3 Version 2, 1192 * but not in previous level/versions. The latter is more succinct, but 1193 * might not be legal SBML for the desired target SBML document. 1194 * 1195 * 1196 * @return A boolean indicating the behavior currently set. The possible 1197 * values are as follows: 1198 * 1199 * <ul> 1200 * <li> @link libsbml#L3P_MODULO_IS_REM L3P_MODULO_IS_REM@endlink (value = @c true): use the 1201 * 'rem' MathML function (@link libsbml#AST_FUNCTION_REM AST_FUNCTION_REM@endlink). 1202 * <li> @link libsbml#L3P_MODULO_IS_PIECEWISE L3P_MODULO_IS_PIECEWISE@endlink (value = @c false): use 1203 * a piecewise function (@link libsbml#AST_FUNCTION_PIECEWISE AST_FUNCTION_PIECEWISE@endlink) 1204 * to encode the modulo rule explicitly. 1205 * </ul> 1206 * 1207 * 1208 * @see setParseModuloL3v2(@if java boolean@endif) 1209 */ public getParseModuloL3v2()1210 bool getParseModuloL3v2() { 1211 bool ret = libsbmlPINVOKE.L3ParserSettings_getParseModuloL3v2(swigCPtr); 1212 return ret; 1213 } 1214 1215 1216 /** 1217 * Sets the behavior for handling functions added in SBML L3v2 1218 * 1219 * 1220 * 1221 * This setting affects whether the names of functions added in SBML 1222 * Level 3 Version 2 are parsed as those added MathML functions, 1223 * or whether they are added as generic functions with those names (to 1224 * be used in SBML as function definitions). 1225 * 1226 * 1227 * This method lets you tell the parser which behavior to use---either 1228 * to parse the functions added in L3v2 as their built-in counterparts, 1229 * or as generic functions with that name (to be defined by SBML as 1230 * function definitions). The two possibilities are 1231 * represented using the following constants: 1232 * 1233 * 1234 * <ul> 1235 * <li> @link libsbml#L3P_PARSE_L3V2_FUNCTIONS_DIRECTLY L3P_PARSE_L3V2_FUNCTIONS_DIRECTLY@endlink (value = @c true): 1236 * parse the strings <code>rateOf</code>, <code>implies</code>, 1237 * <code>max</code>, <code>min</code>, <code>quotient</code>, and 1238 * <code>rem</code> as 1239 * @link libsbml#AST_FUNCTION_RATE_OF AST_FUNCTION_RATE_OF@endlink, 1240 * @link libsbml#AST_LOGICAL_IMPLIES AST_LOGICAL_IMPLIES@endlink, 1241 * @link libsbml#AST_FUNCTION_MAX AST_FUNCTION_MAX@endlink, 1242 * @link libsbml#AST_FUNCTION_MIN AST_FUNCTION_MIN@endlink, 1243 * @link libsbml#AST_FUNCTION_QUOTIENT AST_FUNCTION_QUOTIENT@endlink, and 1244 * @link libsbml#AST_FUNCTION_REM AST_FUNCTION_REM@endlink, respectively. 1245 * <li> @link libsbml#L3P_PARSE_L3V2_FUNCTIONS_AS_GENERIC L3P_PARSE_L3V2_FUNCTIONS_AS_GENERIC@endlink (value = @c false): 1246 * parse the strings <code>rateOf</code>, <code>implies</code>, 1247 * <code>max</code>, <code>min</code>, <code>quotient</code>, and 1248 * <code>rem</code> all as 1249 * @link libsbml#AST_FUNCTION AST_FUNCTION@endlink with the appropriate 1250 * name set. 1251 * </ul> 1252 * 1253 * 1254 * @param l3v2functions a boolean value (one of the constants 1255 * @link libsbml#L3P_PARSE_L3V2_FUNCTIONS_DIRECTLY L3P_PARSE_L3V2_FUNCTIONS_DIRECTLY@endlink or 1256 * @link libsbml#L3P_PARSE_L3V2_FUNCTIONS_AS_GENERIC L3P_PARSE_L3V2_FUNCTIONS_AS_GENERIC@endlink) 1257 * indicating how to interpret those function names. 1258 * 1259 * @see getParseL3v2Functions() 1260 */ public setParseL3v2Functions(bool l3v2functions)1261 void setParseL3v2Functions(bool l3v2functions) { 1262 libsbmlPINVOKE.L3ParserSettings_setParseL3v2Functions(swigCPtr, l3v2functions); 1263 } 1264 1265 1266 /** 1267 * Indicates the current behavior set for handling whether to 1268 * parse the functions added in L3v2 as that MathML or not. 1269 * 1270 * 1271 * 1272 * This setting affects whether the names of functions added in SBML 1273 * Level 3 Version 2 are parsed as those added MathML functions, 1274 * or whether they are added as generic functions with those names (to 1275 * be used in SBML as function definitions). 1276 * 1277 * 1278 * @return A boolean indicating the behavior currently set. The possible 1279 * values are as follows: 1280 * 1281 * <ul> 1282 * <li> @link libsbml#L3P_PARSE_L3V2_FUNCTIONS_DIRECTLY L3P_PARSE_L3V2_FUNCTIONS_DIRECTLY@endlink (value = @c true): 1283 * parse the strings <code>rateOf</code>, <code>implies</code>, 1284 * <code>max</code>, <code>min</code>, <code>quotient</code>, and 1285 * <code>rem</code> as 1286 * @link libsbml#AST_FUNCTION_RATE_OF AST_FUNCTION_RATE_OF@endlink, 1287 * @link libsbml#AST_LOGICAL_IMPLIES AST_LOGICAL_IMPLIES@endlink, 1288 * @link libsbml#AST_FUNCTION_MAX AST_FUNCTION_MAX@endlink, 1289 * @link libsbml#AST_FUNCTION_MIN AST_FUNCTION_MIN@endlink, 1290 * @link libsbml#AST_FUNCTION_QUOTIENT AST_FUNCTION_QUOTIENT@endlink, and 1291 * @link libsbml#AST_FUNCTION_REM AST_FUNCTION_REM@endlink, respectively. 1292 * <li> @link libsbml#L3P_PARSE_L3V2_FUNCTIONS_AS_GENERIC L3P_PARSE_L3V2_FUNCTIONS_AS_GENERIC@endlink (value = @c false): 1293 * parse the strings <code>rateOf</code>, <code>implies</code>, 1294 * <code>max</code>, <code>min</code>, <code>quotient</code>, and 1295 * <code>rem</code> all as 1296 * @link libsbml#AST_FUNCTION AST_FUNCTION@endlink with the appropriate 1297 * name set. 1298 * </ul> 1299 * 1300 * 1301 * @see setParseL3v2Functions(@if java boolean@endif) 1302 */ public getParseL3v2Functions()1303 bool getParseL3v2Functions() { 1304 bool ret = libsbmlPINVOKE.L3ParserSettings_getParseL3v2Functions(swigCPtr); 1305 return ret; 1306 } 1307 1308 1309 /** 1310 * Sets the behavior for handling functions added in SBML packages 1311 * 1312 * 1313 * 1314 * This setting affects whether the math added in a given SBML 1315 * Level 3 package are parsed as those added MathML elements, 1316 * or whether they are added as generic functions or variables 1317 * with those names. 1318 * 1319 * 1320 * This method lets you tell the parser which behavior to use---either 1321 * to parse the functions added in a given package as their built-in counterparts, 1322 * or as generic functions with that name (to be defined by SBML as 1323 * function definitions). The two possibilities are 1324 * represented using the following constants: 1325 * 1326 * 1327 * <ul> 1328 * <li> @link libsbml#L3P_PARSE_PACKAGE_MATH_DIRECTLY L3P_PARSE_PACKAGE_MATH_DIRECTLY@endlink (value = @c true): parse any 1329 * string defined in a given SBML L3 package as its corresponding ASTType_t. 1330 * <li> @link libsbml#L3P_PARSE_PACKAGE_MATH_AS_GENERIC L3P_PARSE_PACKAGE_MATH_AS_GENERIC@endlink (value = @c false): 1331 * parse any string that would have been defined in the given SBML L3 package 1332 * as @link libsbml#AST_FUNCTION AST_FUNCTION@endlink or @link libsbml#AST_NAME AST_NAME@endlink 1333 * with the appropriate name set. 1334 * </ul> 1335 * 1336 * @param package an ExtendedMathType_t indicating the extended math package 1337 * to be queried. 1338 * @param parsepackage a boolean value (one of the constants 1339 * @link libsbml#L3P_PARSE_L3V2_FUNCTIONS_DIRECTLY L3P_PARSE_L3V2_FUNCTIONS_DIRECTLY@endlink or 1340 * @link libsbml#L3P_PARSE_L3V2_FUNCTIONS_AS_GENERIC L3P_PARSE_L3V2_FUNCTIONS_AS_GENERIC@endlink) 1341 * indicating how to interpret those function names. 1342 * 1343 * @see getParsePackageMath(@if java ExtendedMathType_t@endif) 1344 */ public setParsePackageMath(int package, bool parsepackage)1345 void setParsePackageMath(int package, bool parsepackage) { 1346 libsbmlPINVOKE.L3ParserSettings_setParsePackageMath(swigCPtr, package, parsepackage); 1347 } 1348 1349 1350 /** 1351 * Indicates the current behavior set for handling whether to 1352 * parse the functions added in the given package as that MathML or not. 1353 * 1354 * 1355 * 1356 * This setting affects whether the math added in a given SBML 1357 * Level 3 package are parsed as those added MathML elements, 1358 * or whether they are added as generic functions or variables 1359 * with those names. 1360 * 1361 * 1362 * @param package an ExtendedMathType_t indicating the extended math package 1363 * to be set. 1364 * 1365 * @return A boolean indicating the behavior currently set. The possible 1366 * values are as follows: 1367 * 1368 * <ul> 1369 * <li> @link libsbml#L3P_PARSE_PACKAGE_MATH_DIRECTLY L3P_PARSE_PACKAGE_MATH_DIRECTLY@endlink (value = @c true): parse any 1370 * string defined in a given SBML L3 package as its corresponding ASTType_t. 1371 * <li> @link libsbml#L3P_PARSE_PACKAGE_MATH_AS_GENERIC L3P_PARSE_PACKAGE_MATH_AS_GENERIC@endlink (value = @c false): 1372 * parse any string that would have been defined in the given SBML L3 package 1373 * as @link libsbml#AST_FUNCTION AST_FUNCTION@endlink or @link libsbml#AST_NAME AST_NAME@endlink 1374 * with the appropriate name set. 1375 * </ul> 1376 * 1377 * @see setParsePackageMath(@if java ExtendedMathType_t, boolean@endif) 1378 */ public getParsePackageMath(int package)1379 bool getParsePackageMath(int package) { 1380 bool ret = libsbmlPINVOKE.L3ParserSettings_getParsePackageMath(swigCPtr, package); 1381 return ret; 1382 } 1383 1384 1385 /** */ /* libsbml-internal */ public visitPackageInfixSyntax(ASTNode parent, ASTNode node, SWIGTYPE_p_StringBuffer_t sb)1386 void visitPackageInfixSyntax(ASTNode parent, ASTNode node, SWIGTYPE_p_StringBuffer_t sb) { 1387 libsbmlPINVOKE.L3ParserSettings_visitPackageInfixSyntax(swigCPtr, ASTNode.getCPtr(parent), ASTNode.getCPtr(node), SWIGTYPE_p_StringBuffer_t.getCPtr(sb)); 1388 } 1389 1390 } 1391 1392 } 1393