Skip to content

Commit

Permalink
rename ubasic->basic
Browse files Browse the repository at this point in the history
  • Loading branch information
braindigitalis committed May 6, 2023
1 parent 9f324f5 commit 6202743
Show file tree
Hide file tree
Showing 12 changed files with 501 additions and 501 deletions.
268 changes: 136 additions & 132 deletions include/ubasic.h → include/basic.h

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion include/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#include "input.h"
#include "clock.h"
#include "lapic_timer.h"
#include "ubasic.h"
#include "basic.h"
#include "tokenizer.h"
#include "taskswitch.h"
#include "acpi.h"
Expand Down
2 changes: 1 addition & 1 deletion include/taskswitch.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ typedef struct process_t {
uint64_t size; /* Size of program in bytes */
const char* csd; /* Current selected directory */
struct console* cons; /* Program's console */
struct ubasic_ctx* code; /* BASIC context */
struct basic_ctx* code; /* BASIC context */
struct process_t* prev; /* Prev process in doubly linked list */
struct process_t* next; /* Next process in doubly linked list */
} process_t;
Expand Down
24 changes: 12 additions & 12 deletions include/tokenizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* redirecting into the user program.
*
* The #define below builds an enum, and can also build an array of strings of the names in the
* enum, which is built and used within ubasic.c for tokenization.
* enum, which is built and used within basic.c for tokenization.
*/
#define TOKEN(T) \
T(ERROR) \
Expand Down Expand Up @@ -136,22 +136,22 @@ GENERATE_ENUM_LIST(TOKEN, token_t)
* @param program program text
* @param ctx context
*/
void tokenizer_init(const char *program, struct ubasic_ctx* ctx);
void tokenizer_init(const char *program, struct basic_ctx* ctx);

/**
* @brief advance to next token
*
* @param ctx context
*/
void tokenizer_next(struct ubasic_ctx* ctx);
void tokenizer_next(struct basic_ctx* ctx);

/**
* @brief peek to next token
*
* @param ctx context
* @return int token
*/
int tokenizer_token(struct ubasic_ctx* ctx);
int tokenizer_token(struct basic_ctx* ctx);

/**
* @brief Get integer number as next token
Expand All @@ -161,7 +161,7 @@ int tokenizer_token(struct ubasic_ctx* ctx);
* @param token token (NUMBER or HEXNUMBER)
* @return int64_t number read from program
*/
int64_t tokenizer_num(struct ubasic_ctx* ctx, int token);
int64_t tokenizer_num(struct basic_ctx* ctx, int token);

/**
* @brief Get real number as next token
Expand All @@ -171,7 +171,7 @@ int64_t tokenizer_num(struct ubasic_ctx* ctx, int token);
* @param token token (NUMBER)
* @param f number read from program
*/
void tokenizer_fnum(struct ubasic_ctx* ctx, int token, double* f);
void tokenizer_fnum(struct basic_ctx* ctx, int token, double* f);

/**
* @brief Get a variable name as next token
Expand All @@ -180,7 +180,7 @@ void tokenizer_fnum(struct ubasic_ctx* ctx, int token, double* f);
* @param ctx context
* @return const char* variable name
*/
const char* tokenizer_variable_name(struct ubasic_ctx* ctx);
const char* tokenizer_variable_name(struct basic_ctx* ctx);

/**
* @brief Get a string constant as the next token
Expand All @@ -191,7 +191,7 @@ const char* tokenizer_variable_name(struct ubasic_ctx* ctx);
* @param ctx context
* @return true if succesfully found a string constant
*/
bool tokenizer_string(char *dest, int len, struct ubasic_ctx* ctx);
bool tokenizer_string(char *dest, int len, struct basic_ctx* ctx);

/**
* @brief Returns true if the program is finished
Expand All @@ -200,7 +200,7 @@ bool tokenizer_string(char *dest, int len, struct ubasic_ctx* ctx);
* @param ctx context
* @return int true if the program has finished
*/
int tokenizer_finished(struct ubasic_ctx* ctx);
int tokenizer_finished(struct basic_ctx* ctx);

/**
* @brief display an error to the terminal and end the program
Expand All @@ -210,7 +210,7 @@ int tokenizer_finished(struct ubasic_ctx* ctx);
* @param ctx context
* @param error error message
*/
void tokenizer_error_print(struct ubasic_ctx* ctx, const char* error);
void tokenizer_error_print(struct basic_ctx* ctx, const char* error);

/**
* @brief Get the next token
Expand All @@ -219,7 +219,7 @@ void tokenizer_error_print(struct ubasic_ctx* ctx, const char* error);
* @param ctx context
* @return int token found
*/
int get_next_token(struct ubasic_ctx* ctx);
int get_next_token(struct basic_ctx* ctx);

/**
* @brief Check if a decimal number is at the current
Expand All @@ -229,4 +229,4 @@ int get_next_token(struct ubasic_ctx* ctx);
* @param ctx context
* @return true if pointer points at a decimal number
*/
bool tokenizer_decimal_number(struct ubasic_ctx* ctx);
bool tokenizer_decimal_number(struct basic_ctx* ctx);
Loading

0 comments on commit 6202743

Please sign in to comment.