Class: MathGL::MglParse

Inherits:
Object
  • Object
show all
Defined in:
lib/mathgl/doc/libdoc_parse_en.rb,
ext/mathgl/mathgl.cxx

Overview

Proxy of C++ MathGL::MglParse class

Instance Method Summary collapse

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.

Parameters:

  • n (Integer)
  • str (String)

Returns:

  • (nil)


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!

Parameters:

  • name (String)

Returns:

  • (MglVar)


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.

Parameters:

  • a (bool)

Returns:

  • (nil)


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.

Parameters:

  • a (bool)

Returns:

  • (nil)


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.

Parameters:

  • a (bool)

Returns:

  • (nil)


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.

Parameters:

  • formula (String)

Returns:



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.

Parameters:

  • name (String)

Returns:

  • (String)


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.

Parameters:

  • name (String)

Returns:

  • (String)


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.

Parameters:

  • name (String)

Returns:

  • (Integer)


160
161
# File 'lib/mathgl/doc/libdoc_parse_en.rb', line 160

def cmd_type
end

#delete_allnil

Function delete all variables and reset list of commands to default one in this parser.

Returns:

  • (nil)


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.

Parameters:

  • name (String)

Returns:

  • (nil)


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.

Parameters:

  • gr (MglGraph)
  • fp (FILE)
  • print (bool) (defaults to: false)

    default=false

Returns:

  • (nil)


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!

Parameters:

  • name (String)

Returns:

  • (MglVar)


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.

Parameters:

  • id (long)

Returns:

  • (String)


151
152
# File 'lib/mathgl/doc/libdoc_parse_en.rb', line 151

def get_cmd_name
end

#get_cmd_numlong

Return the number of registered MGL commands.

Returns:

  • (long)


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.

Parameters:

  • gr (MglGraph)
  • str (String)
  • pos (long) (defaults to: 0)

    default=0

Returns:

  • (Integer)


37
38
# File 'lib/mathgl/doc/libdoc_parse_en.rb', line 37

def parse
end

#restore_oncenil

Restore Once flag.

Returns:

  • (nil)


99
100
# File 'lib/mathgl/doc/libdoc_parse_en.rb', line 99

def restore_once
end

#stopnil

Sends stop signal which terminate execution at next command.

Returns:

  • (nil)


134
135
# File 'lib/mathgl/doc/libdoc_parse_en.rb', line 134

def stop
end