comparison libinterp/parse-tree/oct-parse.in.yy @ 18537:f958e8cd6348

maint: Periodic merge of gui-release to default.
author Rik <rik@octave.org>
date Sat, 01 Mar 2014 22:11:32 -0800
parents 932aca9a7c57 4cf930a64fad
children 09eb8a2ddb02
comparison
equal deleted inserted replaced
18528:9c8321ea6f58 18537:f958e8cd6348
4117 return retval; 4117 return retval;
4118 } 4118 }
4119 4119
4120 DEFUN (autoload, args, , 4120 DEFUN (autoload, args, ,
4121 "-*- texinfo -*-\n\ 4121 "-*- texinfo -*-\n\
4122 @deftypefn {Built-in Function} {} autoload (@var{function}, @var{file})\n\ 4122 @deftypefn {Built-in Function} {@var{autoload_map} =} autoload ()\n\
4123 @deftypefnx {Built-in Function} {} autoload (@dots{}, @asis{\"remove\"})\n\ 4123 @deftypefnx {Built-in Function} {} autoload (@var{function}, @var{file})\n\
4124 @deftypefnx {Built-in Function} {} autoload (@dots{}, \"remove\")\n\
4124 Define @var{function} to autoload from @var{file}.\n\ 4125 Define @var{function} to autoload from @var{file}.\n\
4125 \n\ 4126 \n\
4126 The second argument, @var{file}, should be an absolute file name or\n\ 4127 The second argument, @var{file}, should be an absolute file name or\n\
4127 a file name in the same directory as the function or script from which\n\ 4128 a file name in the same directory as the function or script from which\n\
4128 the autoload command was run. @var{file} should not depend on the\n\ 4129 the autoload command was run. @var{file} @emph{should not} depend on the\n\
4129 Octave load path.\n\ 4130 Octave load path.\n\
4130 \n\ 4131 \n\
4131 Normally, calls to @code{autoload} appear in PKG_ADD script files that\n\ 4132 Normally, calls to @code{autoload} appear in PKG_ADD script files that\n\
4132 are evaluated when a directory is added to Octave's load path. To\n\ 4133 are evaluated when a directory is added to Octave's load path. To\n\
4133 avoid having to hardcode directory names in @var{file}, if @var{file}\n\ 4134 avoid having to hardcode directory names in @var{file}, if @var{file}\n\
4137 autoload (\"foo\", \"bar.oct\");\n\ 4138 autoload (\"foo\", \"bar.oct\");\n\
4138 @end example\n\ 4139 @end example\n\
4139 \n\ 4140 \n\
4140 @noindent\n\ 4141 @noindent\n\
4141 will load the function @code{foo} from the file @code{bar.oct}. The above\n\ 4142 will load the function @code{foo} from the file @code{bar.oct}. The above\n\
4142 usage when @code{bar.oct} is not in the same directory or usages such as\n\ 4143 usage when @code{bar.oct} is not in the same directory, or usages such as\n\
4143 \n\ 4144 \n\
4144 @example\n\ 4145 @example\n\
4145 autoload (\"foo\", file_in_loadpath (\"bar.oct\"))\n\ 4146 autoload (\"foo\", file_in_loadpath (\"bar.oct\"))\n\
4146 @end example\n\ 4147 @end example\n\
4147 \n\ 4148 \n\
4148 @noindent\n\ 4149 @noindent\n\
4149 are strongly discouraged, as their behavior may be unpredictable.\n\ 4150 are strongly discouraged, as their behavior may be unpredictable.\n\
4150 \n\ 4151 \n\
4151 With no arguments, return a structure containing the current autoload map.\n\ 4152 With no arguments, return a structure containing the current autoload map.\n\
4152 \n\ 4153 \n\
4153 If a third argument @asis{'remove'} is given, the function is cleared and\n\ 4154 If a third argument @qcode{\"remove\"} is given, the function is cleared and\n\
4154 not loaded anymore during the current Octave session.\n\ 4155 not loaded anymore during the current Octave session.\n\
4155 \n\ 4156 \n\
4156 @seealso{PKG_ADD}\n\ 4157 @seealso{PKG_ADD}\n\
4157 @end deftypefn") 4158 @end deftypefn")
4158 { 4159 {
4346 DEFUN (mfilename, args, , 4347 DEFUN (mfilename, args, ,
4347 "-*- texinfo -*-\n\ 4348 "-*- texinfo -*-\n\
4348 @deftypefn {Built-in Function} {} mfilename ()\n\ 4349 @deftypefn {Built-in Function} {} mfilename ()\n\
4349 @deftypefnx {Built-in Function} {} mfilename (\"fullpath\")\n\ 4350 @deftypefnx {Built-in Function} {} mfilename (\"fullpath\")\n\
4350 @deftypefnx {Built-in Function} {} mfilename (\"fullpathext\")\n\ 4351 @deftypefnx {Built-in Function} {} mfilename (\"fullpathext\")\n\
4351 Return the name of the currently executing file. At the top-level,\n\ 4352 Return the name of the currently executing file.\n\
4352 return the empty string. Given the argument @qcode{\"fullpath\"},\n\ 4353 \n\
4353 include the directory part of the file name, but not the extension.\n\ 4354 When called from outside an m-file return the empty string. Given the\n\
4354 Given the argument @qcode{\"fullpathext\"}, include the directory part\n\ 4355 argument @qcode{\"fullpath\"}, include the directory part of the file name,\n\
4355 of the file name and the extension.\n\ 4356 but not the extension. Given the argument @qcode{\"fullpathext\"}, include\n\
4357 the directory part of the file name and the extension.\n\
4356 @end deftypefn") 4358 @end deftypefn")
4357 { 4359 {
4358 octave_value retval; 4360 octave_value retval;
4359 4361
4360 int nargin = args.length (); 4362 int nargin = args.length ();
4412 } 4414 }
4413 4415
4414 DEFUN (source, args, , 4416 DEFUN (source, args, ,
4415 "-*- texinfo -*-\n\ 4417 "-*- texinfo -*-\n\
4416 @deftypefn {Built-in Function} {} source (@var{file})\n\ 4418 @deftypefn {Built-in Function} {} source (@var{file})\n\
4417 Parse and execute the contents of @var{file}. This is equivalent to\n\ 4419 Parse and execute the contents of @var{file}.\n\
4418 executing commands from a script file, but without requiring the file to\n\ 4420 \n\
4419 be named @file{@var{file}.m}.\n\ 4421 This is equivalent to executing commands from a script file, but without\n\
4422 requiring the file to be named @file{@var{file}.m}.\n\
4423 @seealso{run}\n\
4420 @end deftypefn") 4424 @end deftypefn")
4421 { 4425 {
4422 octave_value_list retval; 4426 octave_value_list retval;
4423 4427
4424 int nargin = args.length (); 4428 int nargin = args.length ();
4584 return retval; 4588 return retval;
4585 } 4589 }
4586 4590
4587 DEFUN (builtin, args, nargout, 4591 DEFUN (builtin, args, nargout,
4588 "-*- texinfo -*-\n\ 4592 "-*- texinfo -*-\n\
4589 @deftypefn {Loadable Function} {[@dots{}] =} builtin (@var{f}, @dots{})\n\ 4593 @deftypefn {Built-in Function} {[@dots{}] =} builtin (@var{f}, @dots{})\n\
4590 Call the base function @var{f} even if @var{f} is overloaded to\n\ 4594 Call the base function @var{f} even if @var{f} is overloaded to\n\
4591 another function for the given type signature.\n\ 4595 another function for the given type signature.\n\
4592 \n\ 4596 \n\
4593 This is normally useful when doing object-oriented programming and there\n\ 4597 This is normally useful when doing object-oriented programming and there\n\
4594 is a requirement to call one of Octave's base functions rather than\n\ 4598 is a requirement to call one of Octave's base functions rather than\n\
4751 Parse the string @var{try} and evaluate it as if it were an Octave\n\ 4755 Parse the string @var{try} and evaluate it as if it were an Octave\n\
4752 program. If that fails, evaluate the optional string @var{catch}.\n\ 4756 program. If that fails, evaluate the optional string @var{catch}.\n\
4753 The string @var{try} is evaluated in the current context,\n\ 4757 The string @var{try} is evaluated in the current context,\n\
4754 so any results remain available after @code{eval} returns.\n\ 4758 so any results remain available after @code{eval} returns.\n\
4755 \n\ 4759 \n\
4756 The following example makes the variable @var{A} with the approximate\n\ 4760 The following example creates the variable @var{A} with the approximate\n\
4757 value 3.1416 available.\n\ 4761 value of 3.1416 in the current workspace.\n\
4758 \n\ 4762 \n\
4759 @example\n\ 4763 @example\n\
4760 eval (\"A = acos(-1);\");\n\ 4764 eval (\"A = acos(-1);\");\n\
4761 @end example\n\ 4765 @end example\n\
4762 \n\ 4766 \n\
4763 If an error occurs during the evaluation of @var{try} the @var{catch}\n\ 4767 If an error occurs during the evaluation of @var{try} then the @var{catch}\n\
4764 string is evaluated, as the following example shows:\n\ 4768 string is evaluated, as the following example shows:\n\
4765 \n\ 4769 \n\
4766 @example\n\ 4770 @example\n\
4767 @group\n\ 4771 @group\n\
4768 eval ('error (\"This is a bad example\");',\n\ 4772 eval ('error (\"This is a bad example\");',\n\
4770 @print{} This error occurred:\n\ 4774 @print{} This error occurred:\n\
4771 This is a bad example\n\ 4775 This is a bad example\n\
4772 @end group\n\ 4776 @end group\n\
4773 @end example\n\ 4777 @end example\n\
4774 \n\ 4778 \n\
4775 Consider using try/catch blocks instead if you are only using @code{eval}\n\ 4779 Programming Note: if you are only using @code{eval} as an error-capturing\n\
4776 as an error-capturing mechanism rather than for the execution of arbitrary\n\ 4780 mechanism, rather than for the execution of arbitrary code strings,\n\
4777 code strings.\n\ 4781 Consider using try/catch blocks or unwind_protect/unwind_protect_cleanup\n\
4782 blocks instead. These techniques have higher performance and don't introduce\n\
4783 the security considerations that the evaluation of arbitrary code does.\n\
4778 @seealso{evalin}\n\ 4784 @seealso{evalin}\n\
4779 @end deftypefn") 4785 @end deftypefn")
4780 { 4786 {
4781 octave_value_list retval; 4787 octave_value_list retval;
4782 4788
4983 return retval; 4989 return retval;
4984 } 4990 }
4985 4991
4986 DEFUN (__parser_debug_flag__, args, nargout, 4992 DEFUN (__parser_debug_flag__, args, nargout,
4987 "-*- texinfo -*-\n\ 4993 "-*- texinfo -*-\n\
4988 @deftypefn {Built-in Function} {@var{old_val} =} __parser_debug_flag__ (@var{new_val}))\n\ 4994 @deftypefn {Built-in Function} {@var{val} =} __parser_debug_flag__ ()\n\
4989 Undocumented internal function.\n\ 4995 @deftypefnx {Built-in Function} {@var{old_val} =} __parser_debug_flag__ (@var{new_val})\n\
4996 Query or set the internal flag that determines whether Octave's parser prints\n\
4997 debug information as it processes an expression.\n\
4998 @seealso{__lexer_debug_flag__}\n\
4990 @end deftypefn") 4999 @end deftypefn")
4991 { 5000 {
4992 octave_value retval; 5001 octave_value retval;
4993 5002
4994 bool debug_flag = octave_debug; 5003 bool debug_flag = octave_debug;