Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
SpamixOfficial authored Jun 6, 2024
2 parents c50645c + b5479eb commit b3d4d67
Show file tree
Hide file tree
Showing 19 changed files with 1,679 additions and 1,653 deletions.
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BasedOnStyle: google
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
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
53 changes: 53 additions & 0 deletions .github/workflows/artifacts.yml
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 }}
45 changes: 45 additions & 0 deletions .github/workflows/build.yml
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
25 changes: 25 additions & 0 deletions .github/workflows/lint.yml
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
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
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
22 changes: 14 additions & 8 deletions .gitignore
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
11 changes: 11 additions & 0 deletions CMakeLists.txt
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)
20 changes: 0 additions & 20 deletions Makefile

This file was deleted.

39 changes: 0 additions & 39 deletions README

This file was deleted.

51 changes: 51 additions & 0 deletions README.md
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>&nbsp;or&nbsp;</code> (including spaces!)
- `~` --> <code>&nbsp;xor&nbsp;</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`.
20 changes: 0 additions & 20 deletions build-etc/tibasic.sln

This file was deleted.

Loading

0 comments on commit b3d4d67

Please sign in to comment.