Git Product home page Git Product logo

go-hunter_power-processor's Introduction

Go-Hunter_Power-processor

This program written in Go takes a program written in Hunter–Power (Grammer:https://drive.google.com/file/d/1lXhzJVH70KI92RnhjtiwogLTwe18HOS1/view?usp=sharing), and outputs the tokens and lexemes into a new file.

The program runs like this:

prompt>./go-hunter-scanner input.txt Processing Input File input.txt 14 Tokens produced Results in Output File input.out prompt>

The tokens in the grammar are:

  • STRING
  • REAL_CONST
  • INT_CONST
  • BEGIN
  • END
  • WRITE
  • ID
  • COLON
  • POINT
  • ASSIGN
  • TIMES
  • DIVISION
  • PLUS
  • MINUS
  • POWER
  • LPAREN
  • RPAREN

Given the following program written in this language:
$x <= "hi" :
#d <= 12 :
#d <= 12 :
%r <= 3.44 :
%k <= ( #d + #d ) ^ 1.4 :
WRITE "this is the program" :
WRITE %k

The output file should look like:
ID[STRING]: x
ASSIGN
STRING: hi
COLON
D[INT]: d
ASSIGN
INT_CONST: 12
OLON
ID[REAL]: r
ASSIGN
REAL_CONST: 3.44
COLON
ID[REAL]: k
ASSIGN
LPAREN
ID[INT]: d
PLUS ID[INT]: d
RPAREN
POWER
REAL_CONST: 1.4
COLON
WRITE
STRING: this is the program
COLON
WRITE
ID[REAL]: k

go-hunter_power-processor's People

Contributors

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