Giter Club home page Giter Club logo

bastools's Introduction

BASIC Tools

This project is an offshoot of AppleCommander's import of a BASIC program. The tooling will have more capabilities than what is available in AppleCommander.

Subprojects

This project is split into multiple sub-projects:

  • api is the Java API
  • bt is a command-line tool for tokenizing Applesoft BASIC programs, including extensions for new directives (such as embedding a shapetable into the application).
  • st is a command-line tool for working with Applesoft Shape Tables.

bastools's People

Contributors

a2geek avatar dependabot[bot] avatar kriskennaway avatar ryandesign avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bastools's Issues

bastokenizer crashes with trailing newlines

Sample Program:

"""
100 PRINT "HELLO, WORLD!"

"""

This crashes with:

make/bt Test.bas -o Test.tok
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: picocli.CommandLine$ExecutionException: Error while calling command (io.github.applecommander.bastokenizer.tools.bt.Main@18769467): java.util.NoSuchElementException
at picocli.CommandLine.execute(CommandLine.java:837)
at picocli.CommandLine.access$700(CommandLine.java:111)
at picocli.CommandLine$RunLast.handle(CommandLine.java:994)
at picocli.CommandLine$RunLast.handle(CommandLine.java:962)
at picocli.CommandLine$AbstractParseResultHandler.handleParseResult(CommandLine.java:870)
at picocli.CommandLine.parseWithHandlers(CommandLine.java:1153)
at picocli.CommandLine.call(CommandLine.java:1405)
at picocli.CommandLine.call(CommandLine.java:1333)
at io.github.applecommander.bastokenizer.tools.bt.Main.main(Main.java:102)
... 8 more
Caused by: java.util.NoSuchElementException
at java.util.LinkedList.removeFirst(LinkedList.java:270)
at java.util.LinkedList.remove(LinkedList.java:685)
at io.github.applecommander.bastokenizer.api.Parser.expectNumber(Parser.java:64)
at io.github.applecommander.bastokenizer.api.Parser.readLine(Parser.java:34)
at io.github.applecommander.bastokenizer.api.Parser.parse(Parser.java:27)
at io.github.applecommander.bastokenizer.tools.bt.Main.process(Main.java:144)
at io.github.applecommander.bastokenizer.tools.bt.Main.call(Main.java:113)
at io.github.applecommander.bastokenizer.tools.bt.Main.call(Main.java:32)
at picocli.CommandLine.execute(CommandLine.java:830)
... 16 more
make[1]: *** [Test.tok] Error 1
make: *** [all] Error 2
Command ExternalBuildToolExecution failed with a nonzero exit code

Allow detokenization of Applesoft programs

Given the B or BAS token stream, detokenize Applesoft programs. Should recognize binary components due to gaps in basic code and export as companion binary.

Likely requires change to subcommands?

Allow removal of REM statements

Line numbers used in:

  • GOSUB n
  • GOTO n
  • IF ... THEN n
  • LIST n [ ,m ]
  • ON x GOTO n, m, ...
  • ON x GOSUB n, m, ...
  • ONERR GOTO n
  • RUN n

Bump Gradle version for tooling

Noting that current versions of Eclipse no longer reliably recognize older versions of Gradle projects reliably. Bump embedded version and adjust builds accordingly.

[bt] Improve error reporting when parsing fails

Currently if you typo something in the input program and tokenization fails, the resulting error message is not very informative about where is the problem. e.g. you get a nested exception where the lowest level is:

Caused by: java.io.IOException: Unknown! ttype=63, nval=30.000000, sval=null
at io.github.applecommander.bastokenizer.api.TokenReader.next(TokenReader.java:149)
at io.github.applecommander.bastokenizer.api.TokenReader.tokenize(TokenReader.java:54)
at io.github.applecommander.bastokenizer.api.TokenReader.tokenize(TokenReader.java:40)
at io.github.applecommander.bastokenizer.tools.bt.Main.process(Main.java:139)
at io.github.applecommander.bastokenizer.tools.bt.Main.call(Main.java:113)
at io.github.applecommander.bastokenizer.tools.bt.Main.call(Main.java:32)
at picocli.CommandLine.execute(CommandLine.java:830)

which is trying to tell me that there is an unexpected '?' character (ASCII 63) somewhere on line 30.

How do i run this on windows?

$ java bastools-tools-bt-0.4.0.jar
Error: Could not find or load main class bastools-tools-bt-0.4.0.jar
Caused by: java.lang.ClassNotFoundException: bastools-tools-bt-0.4.0.jar

Clarify license

This project includes the GPL 3 LICENSE file, but does not indicate whether it is licensed under GPL 3 only, or GPL 3 or later. Could you indicate this somewhere, maybe in the readme? Thanks.

$embed doesn't seem to be working right

Thank you for making these utilities; I'm delighted. The $embed functionality is exactly what I was looking for, unfortunately I'm having trouble getting it to work with bt 0.3.1.

printf $'\x60' > rts
echo '1 PRINT "BEFORE CALL"' > hello
echo '2 $embed file="rts", moveto="$300"' >> hello
echo '3 PRINT "AFTER CALL"' >> hello
applecommander -dos140 test.dsk
bt hello --applesingle --stdout | applecommander -as test.dsk hello

If I run this program:

]RUN HELLO
BEFORE CALL

?UNDEF'D STATEMENT ERROR IN 2

If I list this program:

]LIST

 1  PRINT "BEFORE CALL"
 2  CALL 2110: GOTO 3
 15493  SPEED= DEL = SPEED= ? DEL
     > SPEED= DEL ? SPEED=
 937  DEL C COLOR=
 24830
 17985 TER CALL"

Drop empty statements.

Presumably these are all triggered by repeated colons in the source TEXT::HOME => TEXT, empty statement, HOME.

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.