diff doc/interpreter/grammar.txi @ 3294:bfe1573bd2ae

[project @ 1999-10-19 10:06:07 by jwe]
author jwe
date Tue, 19 Oct 1999 10:08:42 +0000
parents
children 858695b3ed62
line wrap: on
line diff
new file mode 100644
--- /dev/null
+++ b/doc/interpreter/grammar.txi
@@ -0,0 +1,58 @@
+@c Copyright (C) 1996, 1997 John W. Eaton
+@c This is part of the Octave manual.
+@c For copying conditions, see the file gpl.texi.
+
+@node Grammar, Copying, Emacs, Top
+@chapter Grammar
+@cindex grammar rules
+@cindex language definition
+
+Someday I hope to expand this to include a semi-formal description of
+Octave's language.
+
+@menu
+* Keywords::                    
+@end menu
+
+@node Keywords,  , Grammar, Grammar
+@section Keywords
+@cindex keywords
+
+The following identifiers are keywords, and may not be used as variable
+or function names:
+
+@example
+@group
+all_va_args             endwhile
+break                   for
+case                    function
+catch                   global
+continue                gplot
+else                    gsplot
+elseif                  if
+end                     otherwise
+end_try_catch           return
+end_unwind_protect      switch
+endfor                  try
+endfunction             unwind_protect
+endif                   unwind_protect_cleanup
+endswitch               while
+@end group
+@end example
+
+The following command-like functions are also speical.  They may be used
+as simple variable names, but not as formal parameters for functions, or
+as the names of structure variables.  Failed assignments leave them
+undefined (you can recover the orginal definition as a function using
+clear).
+
+@example
+@group
+casesen       echo          load          show
+cd            edit_history  ls            type
+chdir         format        more          which
+clear         help          run_history   who
+diary         history       save          whos
+dir           hold          set
+@end group
+@end example