/usr/share/doc/mathgl/mathgl_en/mathgl_en_68.html is in mathgl-doc-en 2.1.3.1-4ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html>
<!-- This manual is for MathGL (version 2.1.2), a collection of classes and routines for scientific plotting. Please report any errors in this manual to mathgl.abalakin@gmail.org.
Copyright C 2008-2012 Alexey A. Balakin.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
Texts. A copy of the license is included in the section entitled "GNU
Free Documentation License."
-->
<!-- Created on December 22, 2013 by texi2html 1.82
texi2html was written by:
Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
Olaf Bachmann <obachman@mathematik.uni-kl.de>
and many others.
Maintained by: Many creative people.
Send bugs and suggestions to <texi2html-bug@nongnu.org>
-->
<head>
<title>MathGL 2.1.2: 7.3 mglParse class</title>
<meta name="description" content="MathGL 2.1.2: 7.3 mglParse class">
<meta name="keywords" content="MathGL 2.1.2: 7.3 mglParse class">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html 1.82">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
pre.display {font-family: serif}
pre.format {font-family: serif}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: serif; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: serif; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.roman {font-family:serif; font-weight:normal;}
span.sansserif {font-family:sans-serif; font-weight:normal;}
ul.toc {list-style: none}
-->
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="mglParse-class"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="mathgl_en_67.html#Program-flow-commands" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_69.html#UDAV" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="mathgl_en_65.html#MGL-scripts" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_65.html#MGL-scripts" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_69.html#UDAV" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="mathgl_en.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_88.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="mglParse-class-1"></a>
<h2 class="section">7.3 mglParse class</h2>
<a name="index-mglParse"></a>
<p>Class for parsing and executing MGL script. This class is defined in <code>#include <mgl2/mgl.h></code>.
</p>
<p>Class mglParse is the interpreter for MGL scripts. The main function of mglParse class is <code>Execute()</code>. Exactly this function parses and executes the script string-by-string. Also there are subservient functions for the finding and creation of a variable. These functions can be useful for displaying values of variables (arrays) in some external program (in window, for example). Function <code>AllowSetSize()</code> allows one to prevent changing the size of the picture inside the script (forbids the MGL command <code>setsize</code>).
</p>
<dl>
<dt><a name="index-mglParse-1"></a><u>Constructor on <code>mglParse</code>:</u> <code></code> <b>mglParse</b><i> (<code>bool</code> setsize=<code>false</code>)</i></dt>
<dt><a name="index-mglParse-2"></a><u>Constructor on <code>mglParse</code>:</u> <code></code> <b>mglParse</b><i> (<code>HMPR</code> pr)</i></dt>
<dt><a name="index-mglParse-3"></a><u>Constructor on <code>mglParse</code>:</u> <code></code> <b>mglParse</b><i> (<code>mglParse &</code>pr)</i></dt>
<dt><a name="index-mgl_005fcreate_005fparser"></a><u>C function:</u> <code>HMPR</code> <b>mgl_create_parser</b><i> ()</i></dt>
<dd><p>Constructor initializes all values with zero and set <var>AllowSetSize</var> value.
</p></dd></dl>
<dl>
<dt><a name="index-_007emglParse"></a><u>Destructor on <code>mglParse</code>:</u> <code></code> <b>~mglParse</b><i> ()</i></dt>
<dt><a name="index-mgl_005fdelete_005fparser"></a><u>C function:</u> <code>void</code> <b>mgl_delete_parser</b><i> (<code>HMPR</code> p)</i></dt>
<dd><p>Destructor delete parser
</p></dd></dl>
<dl>
<dt><a name="index-Self-1"></a><u>Method on <code>mglParse</code>:</u> <code>HMPR</code> <b>Self</b><i> ()</i></dt>
<dd><p>Returns the pointer to internal object of type <code>HMPR</code>.
</p></dd></dl>
<dl>
<dt><a name="index-Execute"></a><u>Method on <code>mglParse</code>:</u> <code>void</code> <b>Execute</b><i> (<code>mglGraph *</code>gr, <code>const char *</code>text)</i></dt>
<dt><a name="index-Execute-1"></a><u>Method on <code>mglParse</code>:</u> <code>void</code> <b>Execute</b><i> (<code>mglGraph *</code>gr, <code>const wchar_t *</code>text)</i></dt>
<dt><a name="index-mgl_005fparse_005ftext"></a><u>C function:</u> <code>void</code> <b>mgl_parse_text</b><i> (<code>HMGL</code> gr, <code>HMPR</code> p, <code>const char *</code>text)</i></dt>
<dt><a name="index-mgl_005fparse_005ftextw"></a><u>C function:</u> <code>void</code> <b>mgl_parse_textw</b><i> (<code>HMGL</code> gr, <code>HMPR</code> p, <code>const wchar_t *</code>text)</i></dt>
<dd><p>Main function in the class. Function parse and execute line-by-line MGL script in array <var>text</var>. Lines are separated by newline symbol ‘<samp>\n</samp>’ as usual.
</p></dd></dl>
<dl>
<dt><a name="index-Execute-2"></a><u>Method on <code>mglParse</code>:</u> <code>void</code> <b>Execute</b><i> (<code>mglGraph *</code>gr, <code>FILE *</code>fp, <code>bool</code> print=<code>false</code>)</i></dt>
<dt><a name="index-mgl_005fparse_005ffile"></a><u>C function:</u> <code>void</code> <b>mgl_parse_file</b><i> (<code>HMGL</code> gr, <code>HMPR</code> p, <code>FILE *</code>fp, <code>int</code> print)</i></dt>
<dd><p>The same as previous but read script from the file <var>fp</var>. If <var>print</var>=<code>true</code> then all warnings and information will be printed in stdout.
</p></dd></dl>
<dl>
<dt><a name="index-Parse"></a><u>Method on <code>mglParse</code>:</u> <code>int</code> <b>Parse</b><i> (<code>mglGraph *</code>gr, <code>const char *</code>str, <code>long</code> pos=<code>0</code>)</i></dt>
<dt><a name="index-Parse-1"></a><u>Method on <code>mglParse</code>:</u> <code>int</code> <b>Parse</b><i> (<code>mglGraph *</code>gr, <code>const wchar_t *</code>str, <code>long</code> pos=<code>0</code>)</i></dt>
<dt><a name="index-mgl_005fparse_005fline"></a><u>C function:</u> <code>int</code> <b>mgl_parse_line</b><i> (<code>HMGL</code> gr, <code>HMPR</code> p, <code>const char *</code>str, <code>int</code> pos)</i></dt>
<dt><a name="index-mgl_005fparse_005flinew"></a><u>C function:</u> <code>int</code> <b>mgl_parse_linew</b><i> (<code>HMGL</code> gr, <code>HMPR</code> p, <code>const wchar_t *</code>str, <code>int</code> pos)</i></dt>
<dd><p>Function parses the string <var>str</var> and executes it by using <var>gr</var> as a graphics plotter. Returns the value depending on an error presence in the string <var>str</var>: 0 – no error, 1 – wrong command argument(s), 2 – unknown command, 3 – string is too long. Optional argument <var>pos</var> allows to save the string position in the document (or file) for using <code>for|next</code> command.
</p></dd></dl>
<dl>
<dt><a name="index-Calc"></a><u>Method on <code>mglParse</code>:</u> <code>mglData</code> <b>Calc</b><i> (<code>const char *</code>formula)</i></dt>
<dt><a name="index-Calc-1"></a><u>Method on <code>mglParse</code>:</u> <code>mglData</code> <b>Calc</b><i> (<code>const wchar_t *</code>formula)</i></dt>
<dt><a name="index-mgl_005fparser_005fcalc"></a><u>C function:</u> <code>HMDT</code> <b>mgl_parser_calc</b><i> (<code>HMPR</code> p, <code>const char *</code>formula)</i></dt>
<dt><a name="index-mgl_005fparser_005fcalcw"></a><u>C function:</u> <code>HMDT</code> <b>mgl_parser_calcw</b><i> (<code>HMPR</code> p, <code>const wchar_t *</code>formula)</i></dt>
<dd><p>Function parses the string <var>formula</var> and return resulting data array. In difference to <code>AddVar()</code> or <code>FindVar()</code>, it is usual data array which should be deleted after usage.
</p></dd></dl>
<dl>
<dt><a name="index-AddParam"></a><u>Method on <code>mglParse</code>:</u> <code>void</code> <b>AddParam</b><i> (<code>int</code> n, <code>const char *</code>str)</i></dt>
<dt><a name="index-AddParam-1"></a><u>Method on <code>mglParse</code>:</u> <code>void</code> <b>AddParam</b><i> (<code>int</code> n, <code>const wchar_t *</code>str)</i></dt>
<dt><a name="index-mgl_005fparser_005fadd_005fparam"></a><u>C function:</u> <code>void</code> <b>mgl_parser_add_param</b><i> (<code>HMPR</code> p, <code>int</code> id, <code>const char *</code>val)</i></dt>
<dt><a name="index-mgl_005fparser_005fadd_005fparamw"></a><u>C function:</u> <code>void</code> <b>mgl_parser_add_paramw</b><i> (<code>HMPR</code> p, <code>int</code> id, <code>const wchar_t *</code>val)</i></dt>
<dd><p>Function set the value of <var>n</var>-th parameter as string <var>str</var> (<var>n</var>=0, 1 ... ’z’-’a’+10). String <var>str</var> shouldn’t contain ‘<samp>$</samp>’ symbol.
</p></dd></dl>
<dl>
<dt><a name="index-FindVar"></a><u>Method on <code>mglParse</code>:</u> <code>mglVar *</code> <b>FindVar</b><i> (<code>const char *</code>name)</i></dt>
<dt><a name="index-FindVar-1"></a><u>Method on <code>mglParse</code>:</u> <code>mglVar *</code> <b>FindVar</b><i> (<code>const wchar_t *</code>name)</i></dt>
<dt><a name="index-mgl_005fparser_005ffind_005fvar"></a><u>C function:</u> <code>HMDT</code> <b>mgl_parser_find_var</b><i> (<code>HMPR</code> p, <code>const char *</code>name)</i></dt>
<dt><a name="index-mgl_005fparser_005ffind_005fvarw"></a><u>C function:</u> <code>HMDT</code> <b>mgl_parser_find_varw</b><i> (<code>HMPR</code> p, <code>const wchar_t *</code>name)</i></dt>
<dd><p>Function returns the pointer to variable with name <var>name</var> or zero if variable is absent. Use this function to put external data array to the script or get the data from the script. You must <strong>not delete</strong> obtained data arrays!
</p></dd></dl>
<dl>
<dt><a name="index-AddVar"></a><u>Method on <code>mglParse</code>:</u> <code>mglVar *</code> <b>AddVar</b><i> (<code>const char *</code>name)</i></dt>
<dt><a name="index-AddVar-1"></a><u>Method on <code>mglParse</code>:</u> <code>mglVar *</code> <b>AddVar</b><i> (<code>const wchar_t *</code>name)</i></dt>
<dt><a name="index-mgl_005fparser_005fadd_005fvar"></a><u>C function:</u> <code>HMDT</code> <b>mgl_parser_add_var</b><i> (<code>HMPR</code> p, <code>const char *</code>name)</i></dt>
<dt><a name="index-mgl_005fparser_005fadd_005fvarw"></a><u>C function:</u> <code>HMDT</code> <b>mgl_parser_add_varw</b><i> (<code>HMPR</code> p, <code>const wchar_t *</code>name)</i></dt>
<dd><p>Function returns the pointer to variable with name <var>name</var>. If variable is absent then new variable is created with name <var>name</var>. Use this function to put external data array to the script or get the data from the script. You must <strong>not delete</strong> obtained data arrays!
</p></dd></dl>
<dl>
<dt><a name="index-DeleteVar"></a><u>Method on <code>mglParse</code> (C++):</u> <code>void</code> <b>DeleteVar</b><i> (<code>const char *</code>name)</i></dt>
<dt><a name="index-DeleteVar-1"></a><u>Method on <code>mglParse</code> (C++):</u> <code>void</code> <b>DeleteVar</b><i> (<code>const wchar_t *</code>name)</i></dt>
<dt><a name="index-mgl_005fparser_005fdel_005fvar"></a><u>C function:</u> <code>void</code> <b>mgl_parser_del_var</b><i> (<code>HMPR</code> p, <code>const char *</code>name)</i></dt>
<dt><a name="index-mgl_005fparser_005fdel_005fvarw"></a><u>C function:</u> <code>void</code> <b>mgl_parser_del_varw</b><i> (<code>HMPR</code> p, <code>const wchar_t *</code>name)</i></dt>
<dd><p>Function delete the variable specified by its name or by its pointer.
</p></dd></dl>
<dl>
<dt><a name="index-DeleteAll"></a><u>Method on <code>mglParse</code> (C++):</u> <code>void</code> <b>DeleteAll</b><i> ()</i></dt>
<dt><a name="index-mgl_005fparser_005fdel_005fall"></a><u>C function:</u> <code>void</code> <b>mgl_parser_del_all</b><i> (<code>HMPR</code> p)</i></dt>
<dd><p>Function delete all variables in this parser.
</p></dd></dl>
<dl>
<dt><a name="index-RestoreOnce"></a><u>Method on <code>mglParse</code>:</u> <code>void</code> <b>RestoreOnce</b><i> ()</i></dt>
<dt><a name="index-mgl_005fparser_005frestore_005fonce"></a><u>C function:</u> <code>void</code> <b>mgl_parser_restore_once</b><i> (<code>HMPR</code> p)</i></dt>
<dd><p>Restore Once flag.
</p></dd></dl>
<dl>
<dt><a name="index-AllowSetSize"></a><u>Method on <code>mglParse</code>:</u> <code>void</code> <b>AllowSetSize</b><i> (<code>bool</code> a)</i></dt>
<dt><a name="index-mgl_005fparser_005fallow_005fsetsize"></a><u>C function:</u> <code>void</code> <b>mgl_parser_allow_setsize</b><i> (<code>HMPR</code> p, <code>int</code> a)</i></dt>
<dd><p>Allow to parse ’setsize’ command or not.
</p></dd></dl>
<dl>
<dt><a name="index-AllowFileIO"></a><u>Method on <code>mglParse</code>:</u> <code>void</code> <b>AllowFileIO</b><i> (<code>bool</code> a)</i></dt>
<dt><a name="index-mgl_005fparser_005fallow_005ffile_005fio"></a><u>C function:</u> <code>void</code> <b>mgl_parser_allow_file_io</b><i> (<code>HMPR</code> p, <code>int</code> a)</i></dt>
<dd><p>Allow reading/saving files or not.
</p></dd></dl>
<dl>
<dt><a name="index-Stop"></a><u>Method on <code>mglParse</code>:</u> <code>void</code> <b>Stop</b><i> ()</i></dt>
<dt><a name="index-mgl_005fparser_005fstop"></a><u>C function:</u> <code>void</code> <b>mgl_parser_stop</b><i> (<code>HMPR</code> p)</i></dt>
<dd><p>Sends stop signal which terminate execution at next command.
</p></dd></dl>
<dl>
<dt><a name="index-GetCmdNum"></a><u>Method on <code>mglParse</code>:</u> <code>long</code> <b>GetCmdNum</b><i> ()</i></dt>
<dt><a name="index-mgl_005fparser_005fcmd_005fnum"></a><u>C function:</u> <code>long</code> <b>mgl_parser_cmd_num</b><i> (<code>HMPR</code> p)</i></dt>
<dd><p>Return the number of registered MGL commands.
</p></dd></dl>
<dl>
<dt><a name="index-GetCmdName"></a><u>Method on <code>mglParse</code>:</u> <code>const char *</code> <b>GetCmdName</b><i> (<code>long</code> id)</i></dt>
<dt><a name="index-mgl_005fparser_005fcmd_005fname"></a><u>C function:</u> <code>const char *</code> <b>mgl_parser_cmd_name</b><i> (<code>HMPR</code> p, <code>long</code> id)</i></dt>
<dd><p>Return the name of command with given <var>id</var>.
</p></dd></dl>
<dl>
<dt><a name="index-CmdType"></a><u>Method on <code>mglParse</code>:</u> <code>int</code> <b>CmdType</b><i> (<code>const char *</code>name)</i></dt>
<dt><a name="index-mgl_005fparser_005fcmd_005ftype"></a><u>C function:</u> <code>int</code> <b>mgl_parser_cmd_type</b><i> (<code>HMPR</code> p, <code>const char *</code>name)</i></dt>
<dd><p>Return the type of MGL command <var>name</var>. Type of commands are: 0 – not the command, 1 - data plot, 2 - other plot, 3 - setup, 4 - data handle, 5 - data create, 6 - subplot, 7 - program, 8 - 1d plot, 9 - 2d plot, 10 - 3d plot, 11 - dd plot, 12 - vector plot, 13 - axis, 14 - primitives, 15 - axis setup, 16 - text/legend, 17 - data transform.
</p></dd></dl>
<dl>
<dt><a name="index-CmdFormat"></a><u>Method on <code>mglParse</code>:</u> <code>const char *</code> <b>CmdFormat</b><i> (<code>const char *</code>name)</i></dt>
<dt><a name="index-mgl_005fparser_005fcmd_005ffrmt"></a><u>C function:</u> <code>const char *</code> <b>mgl_parser_cmd_frmt</b><i> (<code>HMPR</code> p, <code>const char *</code>name)</i></dt>
<dd><p>Return the format of arguments for MGL command <var>name</var>.
</p></dd></dl>
<dl>
<dt><a name="index-CmdDesc"></a><u>Method on <code>mglParse</code>:</u> <code>const char *</code> <b>CmdDesc</b><i> (<code>const char *</code>name)</i></dt>
<dt><a name="index-mgl_005fparser_005fcmd_005fdesc"></a><u>C function:</u> <code>const char *</code> <b>mgl_parser_cmd_desc</b><i> (<code>HMPR</code> p, <code>const char *</code>name)</i></dt>
<dd><p>Return the description of MGL command <var>name</var>.
</p></dd></dl>
<hr size="6">
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="mathgl_en_67.html#Program-flow-commands" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_69.html#UDAV" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="mathgl_en_65.html#MGL-scripts" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_65.html#MGL-scripts" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_69.html#UDAV" title="Next chapter"> >> </a>]</td>
</tr></table>
<p>
<font size="-1">
This document was generated by <em>Build Daemon user</em> on <em>December 22, 2013</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.
</font>
<br>
</p>
</body>
</html>
|