jaydenmilne / tib Goto Github PK
View Code? Open in Web Editor NEWTI Basic Interpreter
TI Basic Interpreter
Right now a new layer of recursion is added for each line that is parsed. This is wasteful, this functionality could be accomplished with a loop. This will mean paring down the grammar a bit.
Expected:
{1, 2} or {4, 0}
gives {1 0}
Actual:
{1, 2} or {4, 0}
gives 1
Disp
should be rudimentially implemented, instead of always outputting the result of executing a line.
When a program requests a variable that has not been set, VariableManager::get
initializes a Value
without providing a value (Value
defaults to an uninitialized double) and returns it to make initialization errors obvious. However, get
should at least check the type of the variable and return garbage data of the correct type, so Str1
at least returns a garbage string and not a double.
The Value
class is terrible. If we used some inheritance scheme, we might have to do runtime type checking, but we would be able to be much more dynamic
When parsing a string tib will continue until it finds an apostrophe or the end of the line. TI-BASIC will parse a string until it finds a token with higher precedence,
In essence, tib will parse
"burrito->Str1
as the string "burrito->Str1"
while TI-BASIC will interpret it as "burrito"βStr1
and will set Str1
to "burrito"
.
Since tib uses ->
, a hyphen and a greater than symbol, to represent the STO
character β
it would be difficult to recognize the combination ->
as a string terminator, since then a string could not contain ->
without escaping it somehow, which would be annoying.
Research needs to be done to see what other symbols have this different precedence. Maybe an alternate -> symbol could be used?
Expected:
-{1,2}
gives {-1, -2}
Actual:
-{1,2}
gives ERR:DATA TYPE
VariableManager::set
when in emulation mode (-e
) should detect the type of the variable and make sure that the value being assigned to it is of the correct type, eg "asdf"->X
and 1->Str1
gives an error
ANS needs to be implemented
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.