Choose Nodes> Node Dictionary> C++Text from the menu bar to access the C++Text node dictionary. In this chapter:
Table of Contents | ||
---|---|---|
|
Brackets
Brackets include parentheses, squares, and curly brackets:
Table of Content Zone | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
(Left parenthesis. In the following example, the left parenthesis has a body with a
)Right parenthesis. In the following example, the right parenthesis is directly next to the left parenthesis, which is in turn directly n ext to the
[Left square bracket. In the following example, the left square bracket has a body with
]Right square bracket. In the following example, the right square bracket is directly next to the left square bracket, which is in turn directly next to
{Left curly bracket. In the following example, the left curly bracket has a body with function's
}Right curly bracket. In the following example, the right curly bracket is directly next to the left curly bracket, which is in turn directly next to the right parenthesis. All statements in function's
|
Comments
C and C++ style comments:
Table of Content Zone | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
/*C style comment. For example:
//C++ style comment. For example:
|
Constants
The following constant expressions are included:
Table of Content Zone | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Char ConstantConstant char expression. For example:
|
Code Block |
---|
static string msgQuit = "Quit message"; // Identifiers Constant: "static", "string", "msgQuit" |
Number Constant
Constant Numerical expression. For example:
Code Block |
---|
int one = 1; // Number Constant "1" double pi = 3.14; // Number Constant "3.14" |
String Constant
Constant string expression. For example:
Code Block |
---|
char* one = "number one"; // String Constant " "number one" " string simpleText = "This is simple text"; // String Constant " "This is simple text" " |
Digraphs
Alternative token representations for some operators and punctuators.
Table of Content Zone | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
%:Alternative token for
%>Alternative token for
:>Alternative token for
<%Alternative token for
<:Alternative token for
|
Expressions
Includes all types of expression nodes.
Table of Content Zone | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
AssignmentAssignment expressions include the following operators: %=Mod-equals operator. For example:
&=Bitwise-and-equals operator. For example:
*=Multiply-equals operator. For example:
++Increment operator. For example:
+=Plus-equals operator. For example:
--Decrement operator. For example:
-=Minus-equals operator. For example:
/=Divide-equals operator. For example:
<<=Left-shift-equals operator. For example:
=Assignment operator. For example:
>>=Right-shift-equals operator. For example:
^=Bitwise-xor-equals operator. For example:
|=Bitwise-or-equals operator. For example:
BitwiseThe following bitwise operators are included: &Bitwise 'AND' operator. For example:
^Bitwise 'XOR' operator. For example:
|Bitwise 'OR' operator. For example:
~Bitwise 'NOT' operator. For example:
ComparisonThe following comparison operators are included: !='Not-equal' operator. For example:
<'Less than' operator. For example:
<='Less than or equals' operator. For example:
=='Equality' operator. For example:
>'Greater than' operator. For example:
>='Greater than or equals' operator. For example:
LogicalThe following logical operator expressions are included: !Logical 'NOT' operator. For example:
&&Logical 'AND' operator. For example:
||Logical 'OR' expression. For example:
MiscellaneousThe following miscellaneous expressions are included: ->Dereference operator. For example:
|
Code Block |
---|
class Foo { public: void func(); }; typedef void(Foo::*mpf)(); void bar(Foo *f) { mpf ampf = &Foo::func; (f->*ampf)(); // Arrow-star operator "->*" } |
.
Dot operator. For example:
Code Block |
---|
class A { public: int foo; } [...] a.foo = 1; //Dot operator. |
::
Double colon operator. For example:
Code Block |
---|
class A { int foo(); }; int A::foo() { // Double colon operator (A::foo()) return 1; } |
?
Ternary operator. For example:
Code Block |
---|
bool func(int x) { return x ? true : false; // Ternary operator "?" } |
.*
Pointer-to-member operator. For example:
Code Block |
---|
class A { public: void foo(); }; typedef void (A::*PtrToMember)(); void bar(A& a, PtrToMember ptr) { (a.*ptr)(); // ".*" operator } |
...
Ellipsis. For example:
void foo(...); /* ellipsis */
Numerical
The following numerical expressions are included:
%
Mod operator. For example:
Code Block |
---|
int j = 11; int i = j % 2; //Mod operator (j % 2) |
*
Asterisk operator. For example:
Code Block |
---|
int plus1 = 2 * 2; //Asterisk operator (multiplication) int *plus2 = &plus1; //Asterisk operator (pointer type) |
+
Plus operator. For example:
Code Block |
---|
int j = 2; int plus1 = 1 + j; //Plus operator (addition) int plus2 = +1; //Plus operator (meaningless) |
-
Minus operator. For example:
Code Block |
---|
int j = 2; int minus1 = 1 - j; //Minus operator (substraction) int minus2 = -1; //Minus operator (negation) |
/
Division operator. For example:
Code Block |
---|
float f = 3; float r = f / 2; //Division operator |
<<
Binary shift-left operator. For example:
Code Block |
---|
int i = 2; int j = i << 1; //shift-left operator (i << 1) |
>>
Binary shift-right operator. For example:
Code Block |
---|
int i = 2; int j = i >> 1; //shift-right operator (i >> 1) |
General
General nodes
File
File containing source code.
Lines
General line nodes.
Line
Single line. For example:
Code Block |
---|
//first line (#line = 1) //third line (as second is empty) //access this comment using "All" line's property |
Preprocessor Directives
The following preprocessor directives are included.
Table of Content Zone | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
#defineThe
#elifThe
#elseThe
#endifThe
#ifThe
#ifdef"#ifdef" preprocessor directive. For example:
#ifndefThe
#includeThe
#pragmaThe
#undefThe
|
Statements
General node of all types of statements.
Table of Content Zone | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||
break
case
catch
continue
default
do
else
for
goto
if
return
switch
try
while
|
Tokens
Tokens are basic language elements.
Token
This is a basic lexical object recognized by lexer. Example statement:
int Table[10]; // this is statement
The following tokens are objects in this example statement:
int
- (single space)
Table
[
10
]
;
// this is statement.
Notice that the comment (// this is statement
) is a single token.
Trigraphs
Trigraphs are special sequences of three characters. Trigraphs are replaced with a corresponding single character when they appear in a source file.
Table of Content Zone | ||||||
---|---|---|---|---|---|---|
| ||||||
??/Trigraph sequence replaced with
??)Trigraph sequence replaced with
??'Trigraph sequence replaced with
??<Trigraph sequence replaced with
??!Trigraph sequence replaced with
??>Trigraph sequence replaced with
??-Trigraph sequence replaced with
|
Various
Various nodes not fitting in other categories.
Table of Content Zone | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
,Comma operator. For example:
:Colon operator. For example:
;Semicolon operator. For example:
\Backslash. For example:
|
Whitespace
Tab and space characters.
Space
Space character. For example:
Code Block |
---|
do_something( ); /* The call above has single space at start of line and single space in parentheses body */ |
Tab
Tab character. For example:
Code Block |
---|
int i = 1; /* The statement above has a single tab at start of line */ |