Skip to content

LexicalAnalyser.c#130

Open
kunal15112001 wants to merge 1 commit intomarkandey007:mainfrom
kunal15112001:main
Open

LexicalAnalyser.c#130
kunal15112001 wants to merge 1 commit intomarkandey007:mainfrom
kunal15112001:main

Conversation

@kunal15112001
Copy link
Copy Markdown

The lexical analyzer is the part of the compiler that detects the token of the program and sends it to the syntax analyzer. It converts the input program into a sequence of Tokens. A C program consists of various tokens and a token is either a keyword, an identifier, a constant, a string literal, or a symbol.

For Example:

  1. Keywords:
    Examples- for, while, if etc.

  2. Identifier
    Examples- Variable name, function name etc.

  3. Operators:
    Examples- '+', '++', '-' etc.

  4. Separators:
    Examples- ', ' ';' etc

It is a C program to print all the keywords, literals, valid identifiers, invalid identifiers, integer number, real number in a given C program.
Example
Keywords: for, if, include, etc
Identifier: variables, functions, etc
separators: ‘,’, ‘;’, etc
operators: ‘-’, ‘=’, ‘++’, etc

The lexical analyzer is the part of the compiler that detects the token of the program and sends it to the syntax analyzer. It converts the input program into a sequence of Tokens. 
A C program consists of various tokens and a token is either a keyword, an identifier, a constant, a string literal, or a symbol.

For Example: 

1) Keywords: 
Examples- for, while, if etc.

2) Identifier
Examples- Variable name, function name etc.

3) Operators:
Examples- '+', '++', '-' etc.

4) Separators:
Examples- ', ' ';' etc

It is a C program to print all the keywords, literals, valid identifiers, invalid identifiers, integer number, real number in a given C program.




















Examples of different types of tokens in C.

Example
Keywords: for, if, include, etc
Identifier: variables, functions, etc
separators: ‘,’, ‘;’, etc
operators: ‘-’, ‘=’, ‘++’, etc
@markandey007
Copy link
Copy Markdown
Owner

i am creating new repo after making i will be sharing till then follow my id so that u can see my activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants