Class: MathGL::MglParse
- Inherits:
-
Object
- Object
- MathGL::MglParse
- Defined in:
- ../lib/mathgl/doc/libdoc_parse_en.rb
Overview
MglParse class
Instance Method Summary (collapse)
-
- (nil) add_param(n, str)
Function set the value of n-th parameter as string str (n=0, 1 … 'z'-'a'+10).
-
- (MglVar) add_var(name)
Function returns the pointer to variable with name name.
-
- (nil) allow_dll_call(a)
Allow to parse load command or not.
-
- (nil) allow_file_io(a)
Allow reading/saving files or not.
-
- (nil) allow_set_size(a)
Allow to parse setsize command or not.
-
- (MglData) calc(formula)
Function parses the string formula and return resulting data array.
-
- (String) cmd_desc(name)
Return the description of MGL command name.
-
- (String) cmd_format(name)
Return the format of arguments for MGL command name.
-
- (Integer) cmd_type(name)
Return the type of MGL command name.
-
- (nil) delete_all
Function delete all variables and reset list of commands to default one in this parser.
-
- (nil) delete_var(name)
Function delete the variable with given name.
-
- (nil) execute(gr, fp, print = false)
The same as previous but read script from the file fp.
-
- (MglVar) find_var(name)
Function returns the pointer to variable with name name or zero if variable is absent.
-
- (String) get_cmd_name(id)
Return the name of command with given id.
-
- (long) get_cmd_num
Return the number of registered MGL commands.
-
- (Integer) parse(gr, str, pos = 0)
Function parses the string str and executes it by using gr as a graphics plotter.
-
- (nil) restore_once
Restore Once flag.
-
- (nil) stop
Sends stop signal which terminate execution at next command.
Instance Method Details
- (nil) add_param(n, str)
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 |
- (MglVar) add_var(name)
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 |
- (nil) allow_dll_call(a)
Allow to parse load command or not.
126 127 |
# File '../lib/mathgl/doc/libdoc_parse_en.rb', line 126 def allow_dll_call end |
- (nil) allow_file_io(a)
Allow reading/saving files or not.
117 118 |
# File '../lib/mathgl/doc/libdoc_parse_en.rb', line 117 def allow_file_io end |
- (nil) allow_set_size(a)
Allow to parse setsize command or not.
108 109 |
# File '../lib/mathgl/doc/libdoc_parse_en.rb', line 108 def allow_set_size end |
- (MglData) calc(formula)
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 |
- (String) cmd_desc(name)
Return the description of MGL command name.
178 179 |
# File '../lib/mathgl/doc/libdoc_parse_en.rb', line 178 def cmd_desc end |
- (String) cmd_format(name)
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 |
- (Integer) cmd_type(name)
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 |
- (nil) delete_all
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 |
- (nil) delete_var(name)
Function delete the variable with given name.
83 84 |
# File '../lib/mathgl/doc/libdoc_parse_en.rb', line 83 def delete_var end |
- (nil) execute(gr, fp, print = false)
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 |
- (MglVar) find_var(name)
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 |
- (String) get_cmd_name(id)
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 |
- (long) get_cmd_num
Return the number of registered MGL commands.
142 143 |
# File '../lib/mathgl/doc/libdoc_parse_en.rb', line 142 def get_cmd_num end |
- (Integer) parse(gr, str, pos = 0)
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 |
- (nil) restore_once
Restore Once flag.
99 100 |
# File '../lib/mathgl/doc/libdoc_parse_en.rb', line 99 def restore_once end |
- (nil) stop
Sends stop signal which terminate execution at next command.
134 135 |
# File '../lib/mathgl/doc/libdoc_parse_en.rb', line 134 def stop end |