Skip to content

Bassil: A modern, mid-level interpreted programming language designed for efficiency and readability. Featuring robust lexical analysis, error handling, and cross-platform support for Windows and Linux. Bassil offers a balance between low-level control and high-level abstraction, making it ideal for system programming, web development, and more.

License

Notifications You must be signed in to change notification settings

nerd-bear/bassil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

THE README IS CURRENTLY NOT UPDATED AND GENERATED BY CLAUDE 3.5

Bassil Language Project

Overview

Bassil is a custom programming language project that includes a lexical analyzer and various utility functions. This project is designed to tokenize and analyze Bassil language code, providing a foundation for further language processing steps.

Table of Contents

  1. Project Structure
  2. Features
  3. Dependencies
  4. Building the Project
  5. Usage
  6. File Descriptions
  7. Key Components
  8. Error Handling
  9. Utility Functions
  10. Windows-Specific Features
  11. Contributing
  12. License

Project Structure

The project is organized into several key components:

  • main.cpp: Entry point of the application
  • lexer.h and lexer.cpp: Lexical analyzer implementation
  • error_report.h and error_report.cpp: Error reporting functionality
  • utils.h and utils.cpp: Utility functions
  • buildInfo.txt: Compilation and dependency information

Features

  • Lexical analysis of Bassil language code
  • Token generation and classification
  • Error reporting with line and column information
  • Extensive utility functions for string manipulation, file operations, and Windows API interaction
  • Console output formatting with ANSI escape sequences
  • File association and icon setting for Bassil files

Dependencies

  • Windows operating system (Tested on Windows 10)
  • GCC/G++ compiler (Tested with version 13.2.0)
  • Windows API libraries: gdi32, user32, shell32

Building the Project

To build the project, use the following command:

g++ ./src/main.cpp ./src/cpp/utils.cpp ./src/cpp/lexer.cpp ./src/cpp/error_report.cpp -o C:/coding-projects/CPP-Dev/bassil/build/Bassil-Main-Build-ORS-A01 -lgdi32 -luser32 -lshell32

Optional: Add -w flag to remove warnings from the compile message.

Usage

After building the project, run the executable Bassil-Main-Build-ORS-A01. The program will perform lexical analysis on the input file specified in main.cpp (default: C:/coding-projects/CPP-Dev/bassil/input/main.basl).

File Descriptions

  • main.cpp: Contains the WinMain function, initializes the application, performs lexical analysis, and handles errors.
  • lexer.h and lexer.cpp: Define token types and implement the lexical analyzer.
  • error_report.h and error_report.cpp: Provide error reporting functionality.
  • utils.h and utils.cpp: Contain various utility functions for string manipulation, file operations, and Windows API interactions.

Key Components

Lexical Analyzer

The lexical analyzer in lexer.cpp tokenizes input code into the following token types:

  • Identifiers
  • Keywords (int, char, float, string)
  • Literals (integers, floats, strings)
  • Operators (arithmetic, comparison, logical)
  • Punctuation (parentheses, braces, semicolons, commas)

Token Structure

Each token contains:

  • Type
  • Value
  • Line number
  • Start column
  • End column

Error Handling

The project includes an error reporting system that provides detailed information about lexical errors, including:

  • File path
  • Line number
  • Column number
  • Error message

Utility Functions

The Utils namespace in utils.cpp provides a wide range of utility functions, including:

  • String manipulation (splitting, trimming, formatting)
  • File operations (reading, writing, logging)
  • Console output formatting with ANSI escape sequences
  • Windows API interactions (message boxes, notifications)
  • Color and text formatting utilities

Windows-Specific Features

  • Creation of Windows API 32-bit message boxes
  • Windows API balloon notifications
  • File association and icon setting for Bassil files
  • Retrieval of monitor information

Contributing

Contributions to the Bassil Language Project are welcome. Please ensure that your code adheres to the existing style and includes appropriate documentation and test coverage.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Thanks to all contributors and supporters of the Bassil project.

Contact

For any queries or suggestions, please open an issue in the GitHub repository.

About

Bassil: A modern, mid-level interpreted programming language designed for efficiency and readability. Featuring robust lexical analysis, error handling, and cross-platform support for Windows and Linux. Bassil offers a balance between low-level control and high-level abstraction, making it ideal for system programming, web development, and more.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published