diff doc/interpreter/grammar.txi @ 12573:232a90612254

Add new section on parsing to documentation. Add functions add_input_event_hook, remove_input_event_hook, missing_function_hook to documentation.
author Rik <octave@nomad.inbox5.com>
date Sun, 03 Apr 2011 20:33:14 -0700
parents fd0a3ac60b0e
children 0f69d849360e
line wrap: on
line diff
--- a/doc/interpreter/grammar.txi
+++ b/doc/interpreter/grammar.txi
@@ -16,16 +16,17 @@
 @c along with Octave; see the file COPYING.  If not, see
 @c <http://www.gnu.org/licenses/>.
 
-@node Grammar
-@appendix Grammar
+@node Grammar and Parser
+@appendix Grammar and Parser
 @cindex grammar rules
 @cindex language definition
 
-This appendix should eventually contain a semi-formal description of
+This appendix will eventually contain a semi-formal description of
 Octave's language.
 
 @menu
 * Keywords::                    
+* Parser::                    
 @end menu
 
 @node Keywords
@@ -52,4 +53,33 @@
 @item @code{unwind_protect_cleanup}@tab @code{while}
 @end multitable
 
+The function @code{iskeyword} can be used to quickly check whether an
+identifier is reserved by Octave.
+
 @DOCSTRING(iskeyword)
+
+@node Parser
+@section Parser
+@cindex parser
+
+The parser has a number of variables that affect its internal operation.
+These variables are generally documented in the manual alongside the code that
+they affect.  For example, @code{allow_noninteger_range_as_index} is discussed
+in the section on index expressions.
+
+In addition, there are three non-specific parser customization functions.
+@code{add_input_event_hook} can be used to schedule a user function for
+periodic evaluation.  @code{remove_input_event_hook} will stop a user function
+from being evaluated periodically.
+
+@DOCSTRING(add_input_event_hook)
+
+@DOCSTRING(remove_input_event_hook)
+
+Finally, when the parser cannot identify an input token it calls a particular
+function to handle this.  By default, this is the function "unimplemented"
+which makes suggestions about possible Octave substitutes for @sc{matlab}
+functions.
+
+@DOCSTRING(missing_function_hook)
+