Logo
Pattern

Discover published sets by community

Explore tens of thousands of sets crafted by our community.

Lexical Analysis Tokens

26

Flashcards

0/26

Still learning
StarStarStarStar

Arithmetic operator token

StarStarStarStar

Arithmetic operators perform mathematical calculations. Examples include '+', '-', '*', '/', and '%'.

StarStarStarStar

Punctuator token

StarStarStarStar

Punctuators serve as delimiters in program constructs. They include symbols like ';', ',', '.', '{}' (braces), '[]' (brackets), and '()' (parentheses).

StarStarStarStar

Block comment token

StarStarStarStar

Block comments are used to comment out blocks of code or add multi-line explanations. In C/C++, they are enclosed by '/*' and '*/'.

StarStarStarStar

Type qualifier token

StarStarStarStar

Type qualifiers specify additional information about the variables' types. Examples in C/C++ include 'const', 'volatile'.

StarStarStarStar

Integer constant token

StarStarStarStar

Integer constants represent numeric values. Rules include consisting only of digits (0-9), no leading zeros unless the number is zero itself, possibly preceded by a sign (+ or -).

StarStarStarStar

Array subscript token

StarStarStarStar

Array subscripts specify an element in an array using an index enclosed in brackets. For example, `array[3]` refers to the fourth element of 'array'.

StarStarStarStar

Relational operator token

StarStarStarStar

Relational operators compare two values. Examples include '>', '<', '>=', '<=', '==', '!='.

StarStarStarStar

Macro token

StarStarStarStar

Macros are fragments of code which are given a name. In C/C++, they are defined with '#define' and replaced by their definition throughout the code.

StarStarStarStar

Line comment token

StarStarStarStar

Line comments are used to add explanatory remarks to the code. Different languages use different symbols like '//' in C/C++ or '#' in Python for the whole line.

StarStarStarStar

Assignment operator token

StarStarStarStar

Assignment operators are used to assign values to variables. The basic assignment operator is '=', but there are compound operators like '+=', '-=', '*=', and '/='.

StarStarStarStar

Bitwise operator token

StarStarStarStar

Bitwise operators operate on binary representations of integers. They include '&', '|', '^' (XOR), '~' (NOT), '<<' (left shift), and '>>' (right shift).

StarStarStarStar

Function call token

StarStarStarStar

Function call tokens are used to invoke a function and are followed by parentheses containing the argument list, e.g., `printf('Hello World');`.

StarStarStarStar

Keyword token

StarStarStarStar

Keywords are reserved words pre-defined by the programming language which have special meanings. Examples include 'if', 'while', 'return'. They cannot be used as identifiers.

StarStarStarStar

Structure member token

StarStarStarStar

Structure member tokens are used to access a member of a structure or union. In C/C++, the dot operator '.' is used for direct access, while '->' is used for pointers.

StarStarStarStar

Storage class specifier token

StarStarStarStar

Storage class specifiers define the scope, visibility, and lifecycle of variables and/or functions. Examples in C/C++ include 'static', 'extern', 'auto', 'register'.

StarStarStarStar

Preprocessor directive token

StarStarStarStar

Preprocessor directives are instructions processed before compilation. Examples in C/C++ include '#include', '#define', '#if', '#else', '#endif'.

StarStarStarStar

Logical operator token

StarStarStarStar

Logical operators are used to evaluate boolean expressions. Examples include '&&' (logical AND), '||' (logical OR), and '!' (logical NOT).

StarStarStarStar

Escape sequence token

StarStarStarStar

Escape sequences are special sequences of characters used to represent certain special characters within string and character literals, like '\n' for newline, '\t' for tab.

StarStarStarStar

Floating-point constant token

StarStarStarStar

Floating-point constants represent numbers with fractional parts. They have digits on both sides of the decimal point, may include an exponent part, and can have a sign.

StarStarStarStar

Boolean constant token

StarStarStarStar

Boolean constants represent the truth values. In most languages, they are `true` and `false`.

StarStarStarStar

Identifier token

StarStarStarStar

An identifier is a lexical token that names language entities. Some of the rules might include: must begin with a letter or underscore, can be followed by letters, digits, or underscores, sensitive to case.

StarStarStarStar

Character constant token

StarStarStarStar

Character constants represent a single character enclosed within quotes. Rules include being surrounded by single quotes, representing a single character, or an escape sequence.

StarStarStarStar

String literal token

StarStarStarStar

String literals are a sequence of characters surrounded by double quotes. They can include escape sequences and represent text.

StarStarStarStar

Enumeration constant token

StarStarStarStar

Enumeration constants are user-defined types in C/C++ that consist of named integer constants. An example is `enum { RED, GREEN, BLUE };`.

StarStarStarStar

Null pointer token

StarStarStarStar

The null pointer is a special pointer value that means the pointer points to nothing. In C/C++, 'NULL', or in newer C++ standards, 'nullptr' represents the null pointer.

StarStarStarStar

Whitespace token

StarStarStarStar

Whitespace characters are used to separate tokens in the source code and include spaces, tabs, newlines, and comments, although they are often ignored except as separators.

Know
0
Still learning
Click to flip
Know
0
Logo

© Hypatia.Tech. 2024 All rights reserved.