Coder Social home page Coder Social logo

compiler-construction's Introduction

ICS 2370 Compiler Construction

Part 1


- Write a LEX specification files to: >i). Count the number of words in a file and their total size

solution

file solution1.l

ii). Accepts the English language words (without bothering for the meaning) and replaces each occurrence of the string “abc” in it to “ABC”.

solution

file solution2.l

Part 2


- The following is a listing of a set of verbs: >is am are were was be being been do does did will would should can could has have had go

Write a simple LEX specification to recognize these verb

solution

solution3.c

Part 3

  • Using the Recursive Descent strategy, write a C program for a simple calculator that can be used to perform integer arithmetic involving ‘+’ and ‘*’. Let your program consist of a set of mutually recursive routines.

solution

solution4.c

Part 4

  • Using the following grammar

S -> a S | b

Create an interpreter using LEX and YACC which will count the number of a’s in the input string.

solution

solution5.c

Part 5

  • Write a LEX and YACC specification files for a small calculator that can add and subtract numbers.

solution

solution6.c

contains CFG

solution6b.c

compiler-construction's People

Contributors

samuelmuchiri avatar

Stargazers

 avatar  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.