-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
1,679 additions
and
1,653 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
BasedOnStyle: google |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# When making changes that only change formatting or style, add the commit SHA | ||
# to this file so they are ignored for purposes of git blame calculation. | ||
d6f62273b725e8b8ee3183abefe1d7db629b439e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: upload artifacts | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build-and-upload: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
include: | ||
- os: ubuntu-latest | ||
filename: tibasic | ||
release_filename: tibasic-linux | ||
content_type: application/octet-stream | ||
- os: macos-latest | ||
filename: tibasic | ||
release_filename: tibasic-osx | ||
content_type: application/octet-stream | ||
- os: windows-latest | ||
filename: Release/tibasic.exe | ||
release_filename: tibasic.exe | ||
content_type: application/octet-stream | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- uses: lukka/get-cmake@latest | ||
|
||
- name: Create build directory | ||
run: cmake -E make_directory ${{runner.workspace}}/build | ||
|
||
- name: Configure CMake | ||
working-directory: ${{runner.workspace}}/build | ||
run: cmake ${{ github.workspace }} -DCMAKE_BUILD_TYPE=Release | ||
|
||
- name: Build Compiler | ||
working-directory: ${{runner.workspace}}/build | ||
run: cmake --build . --config Release | ||
|
||
- name: Upload to Release | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ${{runner.workspace}}/build/src/${{ matrix.filename }} | ||
asset_name: ${{ matrix.release_filename }} | ||
asset_content_type: ${{ matrix.content_type }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build-and-test: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
include: | ||
- os: ubuntu-latest | ||
release_suffix: ubuntu | ||
- os: macos-latest | ||
release_suffix: mac | ||
- os: windows-latest | ||
release_suffix: windows | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- uses: lukka/get-cmake@latest | ||
|
||
- name: Create build directory | ||
run: cmake -E make_directory ${{runner.workspace}}/build | ||
|
||
- name: Configure CMake | ||
working-directory: ${{runner.workspace}}/build | ||
run: cmake ${{ github.workspace }} -DCMAKE_BUILD_TYPE=Debug | ||
|
||
- name: Build Compiler | ||
working-directory: ${{runner.workspace}}/build | ||
run: cmake --build . | ||
|
||
- name: Test | ||
working-directory: ${{runner.workspace}}/build | ||
run: ctest -C Debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
cppcheck: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install cppcheck | ||
run: sudo apt install cppcheck | ||
|
||
- name: cppcheck | ||
run: cppcheck --enable=all --suppress=missingIncludeSystem --suppress=missingInclude --suppress=unmatchedSuppression --error-exitcode=1 src/ | ||
|
||
- name: formatting | ||
run: find src -iname '*.h' -o -iname '*.cpp' -print0 | xargs -0 clang-format --dry-run --Werror |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# This workflow will create a GH Releaes whenever a tag is pushed. | ||
# A separate workflow will actually build and upload binaries to the release. | ||
|
||
name: create release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Changelog | ||
uses: scottbrenner/generate-changelog-action@master | ||
id: changelog | ||
env: | ||
REPO: ${{ github.repository }} | ||
|
||
- name: Create Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
tag_name: ${{ github.ref }} | ||
name: ${{ github.ref_name }} | ||
body: | | ||
${{ steps.changelog.outputs.changelog }} | ||
# toggle out of draft/pre-release to build artifacts & publish. | ||
draft: true | ||
prerelease: true | ||
generate_release_notes: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
CVS | ||
build-etc/Debug | ||
build-etc/Release | ||
build-etc/ipch | ||
build-etc/*sdf | ||
build-etc/*suo | ||
build-etc/*vcxproj.* | ||
src/*.o | ||
build/ | ||
|
||
# CMake | ||
CMakeLists.txt.user | ||
CMakeCache.txt | ||
CMakeFiles | ||
CMakeScripts | ||
Testing | ||
Makefile | ||
cmake_install.cmake | ||
install_manifest.txt | ||
compile_commands.json | ||
CTestTestfile.cmake | ||
_deps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
cmake_minimum_required(VERSION 3.15) | ||
project(tibasic LANGUAGES CXX) | ||
|
||
set_property(GLOBAL PROPERTY USE_FOLDERS ON) | ||
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER ${DEPENDENCY_FOLDER}) | ||
|
||
include("cmake/compiler.cmake") | ||
|
||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
|
||
add_subdirectory(src) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# The TI-BASIC Compiler | ||
|
||
The TI-BASIC Compiler is all about compiling TI-BASIC code on your computer | ||
into an 8XP file ready for transferring to your TI-83/TI-83+/TI-84 calculator. | ||
|
||
Being able to type your programs instead of try and use the calculator's keypad | ||
is much easier :) | ||
|
||
## How to run the compiler? | ||
|
||
For most situations, just "drag and drop" the text file containing your code | ||
on top of the `tibasic.exe` file. A black window will appear for a split second | ||
and you should have an 8XP file next to your text file. | ||
|
||
If you feel comfortable using a command line, you can run `tibasic.exe` without | ||
any arguments to get usage information. | ||
|
||
## Important Note! | ||
|
||
There are a few symbols that could not be directly transferred to the language and were replaced instead with simpler tokens. Also note some of these are 'shorthand' versions of supported tokens: | ||
|
||
- `&` --> `and` | ||
- `|` --> <code> or </code> (including spaces!) | ||
- `~` --> <code> xor </code> (including spaces!) | ||
- theta --> `[theta]` | ||
- powers --> `^` (for instance, 5 squared would be `5^2`) | ||
- `e` constant --> `[e]` | ||
- Store --> `->` (same for such things as `>DMS`: `->DMS`) | ||
- Roots --> `[root]^` (for instance, square root would be `[root]^2`) | ||
|
||
All Picture variables (`Pic0` - `Pic9`) and String variables (`Str0` - `Str9`) are CAPITALIZED (ie. `STR0`) | ||
|
||
Other shorthand versions for more obscure functions exist, check `src/tokens.cpp` for the mapping. | ||
|
||
Happy programming! | ||
|
||
## How to build the compiler? | ||
|
||
You will need [CMake 3.15](https://cmake.org/download/) or above and a C++ compiler. | ||
|
||
For Windows with Visual Studio, the CMake project can usually be loaded directly into the IDE. See [this tutorial](https://learn.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio?view=msvc-170) for more. | ||
|
||
On OSX or Linux, you will need to run: | ||
|
||
```shell | ||
$ mkdir build && cd build | ||
$ cmake .. | ||
$ make | ||
``` | ||
|
||
The compiler will be built and the compiler can be found at `build/src/tibasic`. |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.