More work on getting parsing to be functional

This commit is contained in:
Michael Fabian 'Xaymar' Dirks
2025-01-25 19:25:14 +01:00
parent e191173e7b
commit b61005bcaa
16 changed files with 855 additions and 400 deletions
+59
View File
@@ -0,0 +1,59 @@
// AUTOGENERATED COPYRIGHT HEADER START
// Copyright (C) 2025 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
// AUTOGENERATED COPYRIGHT HEADER END
#include "util.hpp"
#include <cctype>
bool blitz::utility::is_symbol(int code)
{
switch (chr) {
case ';': // Comment
case ':': // Command Separator
case '=': // Equal
case '<': // Less Than
case '>': // Greater Than
case '~': // Bitwise Not
case '^': // Exponential (X ^ Y = pow(X, Y))
case '+': // Plus
case '-': // Minus
case '*': // Multiply
case '/': // Divide
case ',': // Parameter Separation
case '%': // Integer Type
case '#': // Real Type
case '$': // String Type
case '.': // Structured Type
case '\\': // Structured Type Access
case '[': // Blitz Arrays
case ']':
case '(': // Call, Grouping, Dim
case ')':
return true;
default:
return false;
}
return false;
}
bool blitz::utility::is_white_space(int code)
{
switch (chr) {
case ' ':
case '\t':
return true;
default:
return false;
}
return false;
}
bool blitz::utility::is_digit(int code)
{
return isdigit(code);
}
bool blitz::utility::is_alpha(int code) {
return isalpha(code);
}