Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.
/ flex-bison-calc Public archive

A flex and bison calculator for Programming Language course

Notifications You must be signed in to change notification settings

fzyyy0601/flex-bison-calc

Repository files navigation

Flex and Bison Calaulator calculator

Description

A extended calculator using flex and bison.

File Description
calc.l lexical rules
calc.y grammar rules
util1.h functons for calculator(eg. variables setting...)
util.h functions for calculator(eg. MI_TO_KM, MOD...)
input.txt the file calculator would read

How to compile

In Window

bison -d cal.y
flex calc.l
g++ lex.yy.c calc.tab.c -o calculator

or

make.sh

In Linux

bison -d cal.y
flex calc.l
g++ lex.yy.c calc.tab.c -o calculator

or

./make.sh

How to run

In Windows

calculator

In Linux

 ./calculator

Result

Read in file

Read_in_file

Read in Command Line

Read_in_command_line

type int "exit", "quit", "EXIT" or "QUIT" to exit.

About

A flex and bison calculator for Programming Language course

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published