Skip to content

Compiler for “Mini PHP” language using flex and yacc tool

Notifications You must be signed in to change notification settings

maheenamin9/mini-php-compiler

Repository files navigation

Mini_PHP_Compiler

The following project construct the compiler for “Mini PHP” language similar to the PHP but with fewer constructs.

  • lexicalpart.l contains the code for Lexical Phase.
  • syntaxpart.y contains the code for Syntax Phase.
  • source.txt contains the input passed to the Program for validation purposes.
  • token.txt contains the tokens in <TokenType, Lemexe> format.

Following Commands are used to run above files:

flex lexicalpart.l               # This command will generate 'lex.yy.c' file.
bison -d syntaxpart.y            # This command will produce 'syntaxpart.tab.c' and 'syntaxpart.tab.h' file.
gcc lex.yy.c syntaxpart.tab.c    # This command will produce 'a' executable file. 
a                                # This command will print the tokens in 'token.txt' file as <TokenType, Lemexe> format.

Important Note:

This Project only completes the follwings:

  • Implementation of Lexical Analysis Phase.
  • Implementation of Syntax Analysis Phase

This Project does not completes the follwings:

  • Implementation of Symbol table manager(Register variables)
  • Applying Semantic actions to evaluate expressions.
  • Error report

About

Compiler for “Mini PHP” language using flex and yacc tool

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published