3294
|
1 @c Copyright (C) 1996, 1997 John W. Eaton |
|
2 @c This is part of the Octave manual. |
|
3 @c For copying conditions, see the file gpl.texi. |
|
4 |
|
5 @node Grammar, Copying, Emacs, Top |
|
6 @chapter Grammar |
|
7 @cindex grammar rules |
|
8 @cindex language definition |
|
9 |
|
10 Someday I hope to expand this to include a semi-formal description of |
|
11 Octave's language. |
|
12 |
|
13 @menu |
|
14 * Keywords:: |
|
15 @end menu |
|
16 |
|
17 @node Keywords, , Grammar, Grammar |
|
18 @section Keywords |
|
19 @cindex keywords |
|
20 |
|
21 The following identifiers are keywords, and may not be used as variable |
|
22 or function names: |
|
23 |
|
24 @example |
|
25 @group |
|
26 all_va_args endwhile |
|
27 break for |
|
28 case function |
|
29 catch global |
|
30 continue gplot |
|
31 else gsplot |
|
32 elseif if |
|
33 end otherwise |
|
34 end_try_catch return |
|
35 end_unwind_protect switch |
|
36 endfor try |
|
37 endfunction unwind_protect |
|
38 endif unwind_protect_cleanup |
|
39 endswitch while |
|
40 @end group |
|
41 @end example |
|
42 |
|
43 The following command-like functions are also speical. They may be used |
|
44 as simple variable names, but not as formal parameters for functions, or |
|
45 as the names of structure variables. Failed assignments leave them |
|
46 undefined (you can recover the orginal definition as a function using |
|
47 clear). |
|
48 |
|
49 @example |
|
50 @group |
|
51 casesen echo load show |
|
52 cd edit_history ls type |
|
53 chdir format more which |
|
54 clear help run_history who |
|
55 diary history save whos |
|
56 dir hold set |
|
57 @end group |
|
58 @end example |