Lexical analyzer - xml table output, Programming Languages

Assignment Help:

Lexical Analyzer:

Symbol Table - Holds the symbols accepted by the lexical analyzer or parser. 

Each symbol may be a terminal or a non-terminal.  Terminal symbols are listed first in the table ahead of non-terminals.

Attributes:

  • Count - Number of symbols in the table

Child items:

  • Symbol

Symbol - Individual symbol accepted by the lexical analyzer or parser. 

Attributes:

  • Index - Unique symbol identifier in the symbol table
  • Name - Name assigned to symbol in the grammar
  • Kind - Indicates the type of symbols. (0- nonterminal, 1 - terminal, other types are self evident)

Char Sets - Groups of characters that can trigger one (or more) DFA state transitions. 

Attributes:

  • Index - Unique identifier for a given character set
  • Count - Number of characters in a given character set

Child items:

  • Char

Char - Specifies the individual character (no array needed)

Attributes:

  • Unicode Index - Character code in Unicode (ASCII)

 

DFA Table - Holds all the DFA states that make up the lexical analyzer. 

Attributes:

1.       Count - Number of DFA states

2.       Initial state

Child Items:

1.       DFA State

DFA State - Enumerates each DFA state and the edges that transition from that state.

Attributes:

  • Index - Unique identifier (order in the DFA table)
  • EdgeCount - Number of edges from the current state to other DFA states
  • AcceptSymbol - Is this an accept state?
  • -1=false
  • Otherwise, it gives the number of the symbol index the state accepts

Child items:

  • DFA Edge

DFA Edge - Transition from one DFA state to another

Attributes:

  • Char Set Index - Points to the character set whose input causes the transition. Thus, a single transition may be cause by multiple characters.
  • Target - Points to the destination state for the transition

Related Discussions:- Lexical analyzer - xml table output

Application for a mid , The assignment has two parts: first you generate a ...

The assignment has two parts: first you generate a simple application for a MID that operates independently of other MIDs. As a second part, the application is extended to keep so

Define the syntax of for loop, Define the Syntax of FOR Loop? The unive...

Define the Syntax of FOR Loop? The universal form of this statement is for(initialization;condition;increment/decrement)             { statements;             }

Overview of procedure-oriented programming paradigm, Procedure-oriented pro...

Procedure-oriented programming (POP):- This is a top-down programming approach, where the problem is viewed as a sequence of tasks to be done such as calculating, printing etc. A n

Shell script to check whether user has logged in or not, Normal 0 ...

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

Program to change date format, Write a program that accepts a date from the...

Write a program that accepts a date from the user in the form mm/dd/yyyy and then displays it in the form month dd, yyyy, where month is the name of the month. Enter a date (mm/d

Cobol, i have 4 variables in my linkage section of PIC 9(3) ..while submitt...

i have 4 variables in my linkage section of PIC 9(3) ..while submitting i m passing parameter value i.e. numeic to them but its taking space for 2 varaible and for two its taking c

Shell script convert the given amount into words, Normal 0 fals...

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

Matrix, Write a function named prob2.m which creates and returns an N×N ide...

Write a function named prob2.m which creates and returns an N×N identity matrix. An identity matrix is a square matrix with values of one on the main diagonal and zeros in all off-

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd