Skip to content

A simple Parser and a Lexical Analyzer using Lex (Flex) and Yacc (Bison)

Notifications You must be signed in to change notification settings

dasunpubudumal/lex-yacc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lex-yacc

Description

A simple Lexical Analyzer and a Syntax Analyzer for the language C- defined as below.

Pic One (Figure 1)

Pic Two (Figure 2)

  • lexer.l is the Lexical Analyzer.
  • parser.y is the Parser (Syntax Analyzer)
  • lex.yy.c is the compiled file from lexer.l

To Run:

  • Linux - Use ./compiler < testfile.c

In a need of compilation, run the makefile using make -f MAKEFILE (Linux).