Task

Generate Lexeme Analysis and Syntax Analysis on the following items:

X := (a+b+c+d)+e

Lexical Analysis
LexemeToken
identifierX
assignment:=
grouping(
identifiera
operator+
identifierb
operator+
identifierc
operator+
identifierd
grouping)
operator+
identifiere
Syntax Analysis

Y:= (a-b) + (c-d-e) + f

Lexical Analysis
LexemeToken
identifierY
assignment:=
grouping(
identifiera
operator-
identifierb
grouping)
operator+
grouping(
identifierc
operator-
identifierd
operator-
identifiere
grouping)
operator+
identifierf
Syntax Analysis

A := (x*y*z)*(c-d-e-f)*g*h

Lexical Analysis
LexemeToken
identifierA
assignment:=
grouping(
identifierx
operator*
identifiery
operator*
identifierz
grouping)
operator*
grouping(
identifierc
operator-
identifierd
operator-
identifiere
operator-
identifierf
grouping)
operator*
identifierg
operator*
identifierh
Syntax Analysis

X := (a*(b-d-e)*f)+(h-i-j-k)

Lexical Analysis
LexemeToken
identifierX
assignment:=
grouping(
identifiera
operator*
grouping(
identifierb
operator-
identifierd
operator-
identifiere
grouping)
operator*
identifierf
grouping)
operator+
grouping(
identifierh
operator-
identifieri
operator-
identifierj
operator-
identifierk
grouping)
Syntax Analysis

Y := a-b-c-d-e

Lexical Analysis
LexemeToken
identifierY
assignment:=
identifiera
operator-
identifierb
operator-
identifierc
operator-
identifierd
operator-
identifiere
Syntax Analysis