Mercurial > hg > octave-lyh
annotate doc/interpreter/grammar.txi @ 14119:94e2a76f1e5a stable
doc: Final grammarcheck and spellcheck before 3.6.0 release.
* container.txi, aspell-octave.en.pws, expr.txi, vectorize.txi, accumarray.m,
accumdim.m, interpft.m, strread.m, parseparams.m, warning_ids.m, cellfun.cc,
help.cc: grammarcheck and spellcheck docstrings.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Thu, 29 Dec 2011 06:05:00 -0800 |
parents | 0f69d849360e |
children | 72c96de7a403 |
rev | line source |
---|---|
11523 | 1 @c Copyright (C) 1996-2011 John W. Eaton |
7018 | 2 @c |
3 @c This file is part of Octave. | |
4 @c | |
5 @c Octave is free software; you can redistribute it and/or modify it | |
6 @c under the terms of the GNU General Public License as published by the | |
7 @c Free Software Foundation; either version 3 of the License, or (at | |
8 @c your option) any later version. | |
9 @c | |
10 @c Octave is distributed in the hope that it will be useful, but WITHOUT | |
11 @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
13 @c for more details. | |
14 @c | |
15 @c You should have received a copy of the GNU General Public License | |
16 @c along with Octave; see the file COPYING. If not, see | |
17 @c <http://www.gnu.org/licenses/>. | |
3294 | 18 |
12573
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
19 @node Grammar and Parser |
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
20 @appendix Grammar and Parser |
3294 | 21 @cindex grammar rules |
22 @cindex language definition | |
23 | |
12573
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
24 This appendix will eventually contain a semi-formal description of |
3294 | 25 Octave's language. |
26 | |
27 @menu | |
28 * Keywords:: | |
12573
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
29 * Parser:: |
3294 | 30 @end menu |
31 | |
4167 | 32 @node Keywords |
3294 | 33 @section Keywords |
34 @cindex keywords | |
35 | |
36 The following identifiers are keywords, and may not be used as variable | |
37 or function names: | |
38 | |
6547 | 39 @multitable @columnfractions .33 .33 .33 |
11446
67e3edbf8ff7
Update list of keywords in Grammar chapter of documentation.
Rik <octave@nomad.inbox5.com>
parents:
7018
diff
changeset
|
40 @item @code{__FILE__} @tab @code{__LINE__} @tab @code{break} |
67e3edbf8ff7
Update list of keywords in Grammar chapter of documentation.
Rik <octave@nomad.inbox5.com>
parents:
7018
diff
changeset
|
41 @item @code{case} @tab @code{catch} @tab @code{classdef} |
6547 | 42 @item @code{continue} @tab @code{do} @tab @code{else} |
43 @item @code{elseif} @tab @code{end} @tab @code{end_try_catch} | |
13945
0f69d849360e
doc: Update list of keywords for Octave grammar.
Rik <octave@nomad.inbox5.com>
parents:
12573
diff
changeset
|
44 @item @code{end_unwind_protect} @tab @code{endclassdef} @tab @code{endenumeration} |
0f69d849360e
doc: Update list of keywords for Octave grammar.
Rik <octave@nomad.inbox5.com>
parents:
12573
diff
changeset
|
45 @item @code{endevents} @tab @code{endfor} @tab @code{endfunction} |
0f69d849360e
doc: Update list of keywords for Octave grammar.
Rik <octave@nomad.inbox5.com>
parents:
12573
diff
changeset
|
46 @item @code{endif} @tab @code{endmethods} @tab @code{endparfor} |
0f69d849360e
doc: Update list of keywords for Octave grammar.
Rik <octave@nomad.inbox5.com>
parents:
12573
diff
changeset
|
47 @item @code{endproperties} @tab @code{endswitch} @tab @code{endwhile} |
0f69d849360e
doc: Update list of keywords for Octave grammar.
Rik <octave@nomad.inbox5.com>
parents:
12573
diff
changeset
|
48 @item @code{enumeration} @tab @code{events} @tab @code{for} |
11446
67e3edbf8ff7
Update list of keywords in Grammar chapter of documentation.
Rik <octave@nomad.inbox5.com>
parents:
7018
diff
changeset
|
49 @item @code{function} @tab @code{get} @tab @code{global} |
67e3edbf8ff7
Update list of keywords in Grammar chapter of documentation.
Rik <octave@nomad.inbox5.com>
parents:
7018
diff
changeset
|
50 @item @code{if} @tab @code{methods} @tab @code{otherwise} |
13945
0f69d849360e
doc: Update list of keywords for Octave grammar.
Rik <octave@nomad.inbox5.com>
parents:
12573
diff
changeset
|
51 @item @code{parfor} @tab @code{persistent} @tab @code{properties} |
0f69d849360e
doc: Update list of keywords for Octave grammar.
Rik <octave@nomad.inbox5.com>
parents:
12573
diff
changeset
|
52 @item @code{return} @tab @code{set} @tab @code{static} |
0f69d849360e
doc: Update list of keywords for Octave grammar.
Rik <octave@nomad.inbox5.com>
parents:
12573
diff
changeset
|
53 @item @code{switch} @tab @code{try} @tab @code{until} |
0f69d849360e
doc: Update list of keywords for Octave grammar.
Rik <octave@nomad.inbox5.com>
parents:
12573
diff
changeset
|
54 @item @code{unwind_protect} @tab @code{unwind_protect_cleanup} @tab @code{while} |
6547 | 55 @end multitable |
6551 | 56 |
12573
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
57 The function @code{iskeyword} can be used to quickly check whether an |
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
58 identifier is reserved by Octave. |
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
59 |
6551 | 60 @DOCSTRING(iskeyword) |
12573
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
61 |
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
62 @node Parser |
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
63 @section Parser |
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
64 @cindex parser |
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
65 |
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
66 The parser has a number of variables that affect its internal operation. |
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
67 These variables are generally documented in the manual alongside the code that |
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
68 they affect. For example, @code{allow_noninteger_range_as_index} is discussed |
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
69 in the section on index expressions. |
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
70 |
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
71 In addition, there are three non-specific parser customization functions. |
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
72 @code{add_input_event_hook} can be used to schedule a user function for |
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
73 periodic evaluation. @code{remove_input_event_hook} will stop a user function |
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
74 from being evaluated periodically. |
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
75 |
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
76 @DOCSTRING(add_input_event_hook) |
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
77 |
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
78 @DOCSTRING(remove_input_event_hook) |
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
79 |
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
80 Finally, when the parser cannot identify an input token it calls a particular |
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
81 function to handle this. By default, this is the function "unimplemented" |
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
82 which makes suggestions about possible Octave substitutes for @sc{matlab} |
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
83 functions. |
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
84 |
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
85 @DOCSTRING(missing_function_hook) |
232a90612254
Add new section on parsing to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
86 |