GithubHelp home page GithubHelp logo

yacc-project's Introduction

Programming Language pin

Pinar Kok - 20160808013

Syntax

<if> ::= if (<expression>) <statement>

<while statement> ::= while (<expression>) <statement> 

<expression> ::= <expression> | <assignment>

<assignment operator> ::= =

<term> ::= <number> | <identifier>

<article> ::= <character> | <identifier>

<number> ::= <number> | <digit>

<digit> ::= 0 | 1 |2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 

<boolean> ::= 1 | 0

<math operations> ::= + | - | * | /

<comparison operations> ::= < | > | != | <= | >= | == | && | || 

Explanations

• pin takes a file with extension “.pin”.

• It has if, else, while, print, printchar, comment etc.

• The token error is reserved for error handling. This can be used in grammer rules, to indicate where error might occur, and recovery take place. When an error is detected:

  • If an error token is specified, the parser pop its stack until it finds a state where the error token is legal. It then behaves as if error is the current lookahead token, and performs the action encountered.

  • If there is no rule using the error token, processing halts when an error is encountered.

• You can run the test program by running the makefile and giving it to “pin” as input:

make ./pin
./pin < test.pin

yacc-project's People

Contributors

pinarrkok avatar

Watchers

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