Class: MathGL::MglParse
- Inherits:
-
Object
- Object
- MathGL::MglParse
- Defined in:
- lib/mathgl/doc/libdoc_parse_en.rb,
ext/mathgl/mathgl.cxx
Overview
Proxy of C++ MathGL::MglParse class
Instance Method Summary collapse
-
#add_param(n, str) ⇒ nil
Function set the value of n-th parameter as string str (n=0, 1 … ‘z’-‘a’+10).
-
#add_var(name) ⇒ MglVar
Function returns the pointer to variable with name name.
-
#allow_dll_call(a) ⇒ nil
Allow to parse load command or not.
-
#allow_file_io(a) ⇒ nil
Allow reading/saving files or not.
-
#allow_set_size(a) ⇒ nil
Allow to parse setsize command or not.
-
#calc(formula) ⇒ MglData
Function parses the string formula and return resulting data array.
-
#cmd_desc(name) ⇒ String
Return the description of MGL command name.
-
#cmd_format(name) ⇒ String
Return the format of arguments for MGL command name.
-
#cmd_type(name) ⇒ Integer
Return the type of MGL command name.
-
#delete_all ⇒ nil
Function delete all variables and reset list of commands to default one in this parser.
-
#delete_var(name) ⇒ nil
Function delete the variable with given name.
-
#execute(gr, fp, print = false) ⇒ nil
The same as previous but read script from the file fp.
-
#find_var(name) ⇒ MglVar
Function returns the pointer to variable with name name or zero if variable is absent.
-
#get_cmd_name(id) ⇒ String
Return the name of command with given id.
-
#get_cmd_num ⇒ long
Return the number of registered MGL commands.
-
#parse(gr, str, pos = 0) ⇒ Integer
Function parses the string str and executes it by using gr as a graphics plotter.
-
#restore_once ⇒ nil
Restore Once flag.
-
#stop ⇒ nil
Sends stop signal which terminate execution at next command.
Instance Method Details
#add_param(n, str) ⇒ nil
Function set the value of n-th parameter as string str (n=0, 1 … ‘z’-‘a’+10). String str shouldn’t contain ‘$’ symbol.
56 57 |
# File 'lib/mathgl/doc/libdoc_parse_en.rb', line 56 def add_param end |
#add_var(name) ⇒ MglVar
Function returns the pointer to variable with name name. If variable is absent then new variable is created with name name. Use this function to put external data array to the script or get the data from the script. You must not delete obtained data arrays!
74 75 |
# File 'lib/mathgl/doc/libdoc_parse_en.rb', line 74 def add_var end |
#allow_dll_call(a) ⇒ nil
Allow to parse load command or not.
126 127 |
# File 'lib/mathgl/doc/libdoc_parse_en.rb', line 126 def allow_dll_call end |
#allow_file_io(a) ⇒ nil
Allow reading/saving files or not.
117 118 |
# File 'lib/mathgl/doc/libdoc_parse_en.rb', line 117 def allow_file_io end |
#allow_set_size(a) ⇒ nil
Allow to parse setsize command or not.
108 109 |
# File 'lib/mathgl/doc/libdoc_parse_en.rb', line 108 def allow_set_size end |
#calc(formula) ⇒ MglData
Function parses the string formula and return resulting data array. In difference to AddVar() or FindVar(), it is usual data array which should be deleted after usage.
46 47 |
# File 'lib/mathgl/doc/libdoc_parse_en.rb', line 46 def calc end |
#cmd_desc(name) ⇒ String
Return the description of MGL command name.
178 179 |
# File 'lib/mathgl/doc/libdoc_parse_en.rb', line 178 def cmd_desc end |
#cmd_format(name) ⇒ String
Return the format of arguments for MGL command name.
169 170 |
# File 'lib/mathgl/doc/libdoc_parse_en.rb', line 169 def cmd_format end |
#cmd_type(name) ⇒ Integer
Return the type of MGL command name. 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.
160 161 |
# File 'lib/mathgl/doc/libdoc_parse_en.rb', line 160 def cmd_type end |
#delete_all ⇒ nil
Function delete all variables and reset list of commands to default one in this parser.
91 92 |
# File 'lib/mathgl/doc/libdoc_parse_en.rb', line 91 def delete_all end |
#delete_var(name) ⇒ nil
Function delete the variable with given name.
83 84 |
# File 'lib/mathgl/doc/libdoc_parse_en.rb', line 83 def delete_var end |
#execute(gr, fp, print = false) ⇒ nil
The same as previous but read script from the file fp. If print=true then all warnings and information will be printed in stdout.
15 16 |
# File 'lib/mathgl/doc/libdoc_parse_en.rb', line 15 def execute end |
#find_var(name) ⇒ MglVar
Function returns the pointer to variable with name name 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 not delete obtained data arrays!
65 66 |
# File 'lib/mathgl/doc/libdoc_parse_en.rb', line 65 def find_var end |
#get_cmd_name(id) ⇒ String
Return the name of command with given id.
151 152 |
# File 'lib/mathgl/doc/libdoc_parse_en.rb', line 151 def get_cmd_name end |
#get_cmd_num ⇒ long
Return the number of registered MGL commands.
142 143 |
# File 'lib/mathgl/doc/libdoc_parse_en.rb', line 142 def get_cmd_num end |
#parse(gr, str, pos = 0) ⇒ Integer
Function parses the string str and executes it by using gr as a graphics plotter. Returns the value depending on an error presence in the string str: 0 – no error, 1 – wrong command argument(s), 2 – unknown command, 3 – string is too long, 4 – strings is not closed. Optional argument pos allows to save the string position in the document (or file) for using for|next command.
37 38 |
# File 'lib/mathgl/doc/libdoc_parse_en.rb', line 37 def parse end |
#restore_once ⇒ nil
Restore Once flag.
99 100 |
# File 'lib/mathgl/doc/libdoc_parse_en.rb', line 99 def restore_once end |
#stop ⇒ nil
Sends stop signal which terminate execution at next command.
134 135 |
# File 'lib/mathgl/doc/libdoc_parse_en.rb', line 134 def stop end |