Next: Indentation Calculation, Previous: Syntactic Analysis, Up: Indentation Engine Basics [Contents][Index]
This section is a complete list of the syntactic symbols which appear
in the c-offsets-alist style variable, along with brief
descriptions. The previous section (see Syntactic Analysis)
states what syntactic symbols are and how the indentation engine uses
them.
More detailed descriptions of these symbols, together with snippets of source code to which they apply, appear in the examples in the subsections below. Note that, in the interests of brevity, the anchor position associated with most syntactic symbols is not specified. In cases of doubt, type C-c C-s on a pertinent line—this highlights the anchor position.
The syntactic symbols which indicate brace constructs follow a general
naming convention. When a line begins with an open or close brace,
its syntactic symbol will contain the suffix -open or
-close respectively. The first line within the brace block
construct will contain the suffix -block-intro.
In constructs which can span several lines, a distinction is usually
made between the first line that introduces the construct and the
lines that continue it. The syntactic symbols that indicate these
lines will contain the suffixes -intro or -cont
respectively.
The best way to understand how all this works is by looking at some examples. Remember that you can see the syntax of any source code line by using C-c C-s.
stringInside a multiline string. Literal Symbols.
cInside a multiline C style block comment. Literal Symbols.
defun-openBrace that opens a top-level function definition. Function Symbols.
defun-closeBrace that closes a top-level function definition. Function Symbols.
defun-block-introThe first line in a top-level defun. Function Symbols.
class-openBrace that opens a class definition. Class Symbols.
class-closeBrace that closes a class definition. Class Symbols.
inline-openBrace that opens an in-class inline method. Class Symbols.
inline-closeBrace that closes an in-class inline method. Class Symbols.
func-decl-contThe region between a function definition’s argument list and the
function opening brace (excluding K&R argument declarations). In C,
you cannot put anything but whitespace and comments in this region,
however in C++ and Java, throws declarations and other things
can appear here. Literal Symbols.
knr-argdecl-introFirst line of a K&R C argument declaration. K&R Symbols.
knr-argdeclSubsequent lines in a K&R C argument declaration. K&R Symbols.
topmost-introThe first line in a “topmost” definition. Function Symbols.
topmost-intro-contTopmost definition continuation lines. This is only used in the parts
that aren’t covered by other symbols such as func-decl-cont and
knr-argdecl. Function Symbols.
annotation-top-contTopmost definition continuation lines where all previous items are annotations. Java Symbols.
member-init-introFirst line in a member initialization list. Class Symbols.
member-init-contSubsequent member initialization list lines. Class Symbols.
inher-introFirst line of a multiple inheritance list. Class Symbols.
inher-contSubsequent multiple inheritance lines. Class Symbols.
block-openStatement block open brace. Literal Symbols.
block-closeStatement block close brace. Conditional Construct Symbols.
brace-list-openOpen brace of an enum or static array list. Brace List Symbols.
brace-list-closeClose brace of an enum or static array list. Brace List Symbols.
brace-list-introFirst line in an enum or static array list. Brace List Symbols.
brace-list-entrySubsequent lines in an enum or static array list. Brace List Symbols.
brace-entry-openSubsequent lines in an enum or static array list where the line begins with an open brace. Brace List Symbols.
statementA statement. Function Symbols.
statement-contA continuation of a statement. Function Symbols.
annotation-var-contA continuation of a statement where all previous items are annotations. Java Symbols.
statement-block-introThe first line in a new statement block. Conditional Construct Symbols.
statement-case-introThe first line in a case block. Switch Statement Symbols.
statement-case-openThe first line in a case block that starts with a brace. Switch Statement Symbols.
substatementThe first line after a conditional or loop construct. Conditional Construct Symbols.
substatement-openThe brace that opens a substatement block. Conditional Construct Symbols.
substatement-labelThe first line after a conditional or loop construct if it’s a label. Conditional Construct Symbols.
case-labelA label in a switch block. Switch Statement Symbols.
access-labelC++ access control label. Class Symbols.
labelAny other label. Literal Symbols.
do-while-closureThe while line that ends a do-while construct.
Conditional Construct Symbols.
else-clauseThe else line of an if-else construct.
Conditional Construct Symbols.
catch-clauseThe catch or finally (in Java) line of a
try-catch construct. Conditional Construct Symbols.
comment-introA line containing only a comment introduction. Literal Symbols.
arglist-introThe first line in an argument list. Paren List Symbols.
arglist-contSubsequent argument list lines when no arguments follow on the same line as the arglist opening paren. Paren List Symbols.
arglist-cont-nonemptySubsequent argument list lines when at least one argument follows on the same line as the arglist opening paren. Paren List Symbols.
arglist-closeThe solo close paren of an argument list. Paren List Symbols.
stream-opLines continuing a stream operator (C++ only). Literal Symbols.
inclassThe line is nested inside a class definition. Class Symbols.
cpp-macroThe start of a preprocessor macro definition. Literal Symbols.
cpp-define-introThe first line inside a multiline preprocessor macro if
c-syntactic-indentation-in-macros is set. Multiline Macro Symbols.
cpp-macro-contAll lines inside multiline preprocessor macros if
c-syntactic-indentation-in-macros is nil.
Multiline Macro Symbols.
friendA C++ friend declaration. Class Symbols.
objc-method-introThe first line of an Objective-C method definition. Objective-C Method Symbols.
objc-method-args-contLines continuing an Objective-C method definition. Objective-C Method Symbols.
objc-method-call-contLines continuing an Objective-C method call. Objective-C Method Symbols.
extern-lang-openBrace that opens an extern block (e.g., extern "C"
{...}). External Scope Symbols.
extern-lang-closeBrace that closes an extern block. External Scope Symbols.
inextern-langAnalogous to inclass syntactic symbol, but used inside
extern blocks. External Scope Symbols.
namespace-opennamespace-closeinnamespaceThese are analogous to the three extern-lang symbols above, but
are returned for C++ namespace blocks. External Scope Symbols.
module-openmodule-closeinmoduleAnalogous to the above, but for CORBA IDL module blocks.
External Scope Symbols.
composition-opencomposition-closeincompositionAnalogous to the above, but for CORBA CIDL composition blocks.
External Scope Symbols.
template-args-contC++ template argument list continuations. Class Symbols.
inlambdaAnalogous to inclass syntactic symbol, but used inside lambda
(i.e., anonymous) functions. Only used in Pike mode. Statement Block Symbols.
lambda-intro-contLines continuing the header of a lambda function, i.e., between the
lambda keyword and the function body. Only used in Pike mode.
Statement Block Symbols.
inexpr-statementA statement block inside an expression. The gcc C and C++ extension for this is recognized. It’s also used for the special functions that take a statement block as an argument in Pike. Statement Block Symbols.
inexpr-classA class definition inside an expression. This is used for anonymous classes in Java. It’s also used for anonymous array initializers in Java. Java Symbols.
Next: Indentation Calculation, Previous: Syntactic Analysis, Up: Indentation Engine Basics [Contents][Index]