Giter VIP home page Giter VIP logo

palak807 / compiler-design-lab-codes Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 75 KB

Looking to streamline your programming language analysis? Look no further than this collection of code snippets related to compiler design! From counting comments and lines in a file to eliminating left recursion and building parsing tables, these scripts and functions are sure to make your life easier.

Python 100.00%

compiler-design-lab-codes's Introduction

Compiler Design Lab Codes

Welcome to the collection of code snippets related to compiler design! Here, you'll find a range of helpful scripts and functions to streamline the process of parsing and analyzing programming languages. Whether you're a seasoned programmer or just starting out, this repo is sure to make your life easier!

Code counting GIF

making_life_easy.py

Code to count the number of comments and lines in a file

This code can be used to count the number of comments and lines in a given file. It is useful for analyzing code metrics.

Code to detect and categorize keywords, operators, delimiters, identifiers, and numbers in a given text

This code can be used to detect and categorize different elements of a programming language, such as keywords, operators, delimiters, identifiers, and numbers. It is useful for building lexers.

Code to check for left recursion in a given grammar and, if present, to eliminate it using the left factoring method

This code can be used to check for left recursion in a given grammar and eliminate it using the left factoring method. Left recursion can cause infinite loops in a parser, so it is important to remove it.

Code to remove left recursion from a given context-free grammar and to calculate the first set of each non-terminal symbol

This code defines several functions to remove left recursion from a given context-free grammar and to calculate the first set of each non-terminal symbol. The first set is used to build a parsing table.

Code to find first set

This code can be used to find the first set of each non-terminal symbol in a given context-free grammar. The first set is used to build a parsing table.

Code to find follow set

This code can be used to find the follow set of each non-terminal symbol in a given context-free grammar. The follow set is used to build a parsing table.

Code to print the parsing table using first and follow

This code can be used to print the parsing table for a given context-free grammar using the first and follow sets of each non-terminal symbol. The parsing table is used by the LL(1) parser.

Python code that implements the LL(1) parser for a given grammar

This Python code implements the LL(1) parser for a given context-free grammar. The LL(1) parser uses a parsing table to parse a given input string.

Code to generate operator precedence table

This code can be used to generate an operator precedence table for a given set of operators. The operator precedence table is used by the parser to resolve operator ambiguities.

Code to generate operator function table

This code can be used to generate an operator function table for a given set of operators. The operator function table maps each operator to its corresponding function.

Implementation of SLR parser

This code implements the SLR parser for a given context-free grammar. The SLR parser uses a state machine to parse a given input string.

compiler-design-lab-codes's People

Contributors

palak807 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.