Introduction to Lexical Analyzer

preview_player
Показать описание
Introduction to Lexical Analyzer
Lecture By: Prof. Arnab Chakraborty, Tutorials Point India Private Limited
Рекомендации по теме
Комментарии
Автор

Use coupon ""YOUTUBE12"" to get “FLAT 12%’’ OFF at Checkout.

TutorialsPoint_
Автор

watched this video thinking i would understand but instead forgot all I knew

birataryal
Автор

Suppose for example,
position = initial + rate * 60
is the code given to lexical analyser.

So why doesn't the analyser doesn't give attribute value to the tokenization for the operator to put in the symbol table?

tusharshivan
Автор

I liked Dewey Val Schorre's metacompilers. At System Development Corporation he worked on CWIC a Compiler for Writing and Implementing Compilers consisting of a parser and generator language. MOL360, separately developed, was also included with CWIC.

The parser programming language provides three formula types:

Parsing formula are functions used in recognizing language constructs, transforming them into tree or list structures.

The tree is constructed on the parse stack. Token formula recognize and create token object's pushing then onto the parse stack.

expr = term $(('+':ADD|'-':SUB) term!2);

Besides the call stack there are two working stacks. The parse tree is constructed on the parse (or *stack). The :<node> operators creates a node object and pushes it onto the node stack. !<number> pops the top node stack entry and <number> of parse stack entries into a list. In the above a 3 element list representing a two branch tree. That tree pushed onto the parse stack.

a + b - 2

-->

SUB
/ \
ADD 2
/ \
a b

Represented by the list:

[SUB, [ADD, a, b], c]

Besides syntax recognizing formul there were token and character classes formula.

Character class;

bin: '0'|'1';
oct: bin|'2'|'3'|'4'|'5'|'6'|'7';
dgt: oct|'8'|'9';

Token formula:

id .. let $(('_'|.EMPTY) (let|dgt));

Int .. dgt $dgt MAKENUM[];

The .. token formula recognize tokens referencing character class formula. Recognized token default to being cataloged into the symbol table. MAKENUM[] is a function call to a function written in a different language.

You are basically programming a recursive decent parser.

I wrote SLIC System of Languages for Implementing Compilers. I added a machine instruction defining language defining instructions as a sequence of bit fields.

It handles 36 bit DEC-System-10 instructions. Intel 16 bit 8086 instructions.
TI990 mini computer and PDP 11 16 bit.

andrewpattersonandy
Автор

Sir Indian Ho to indian accents me hi bol do 😊

Rohan_Menaria
visit shbcf.ru