⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 symbol.h

📁 a basic interpreter free basic
💻 H
字号:
#pragma once
#include "stdafx.h"
#include "Common.h"


/*
 * CSymbol - Class for containing an individual symbol
 */
class CSymbol
{
private:
	// Literal name of the symbol
	string m_Name;
	
	// Type of symbol (variable, vector or matrix)
	symboltype_t m_SymbolType;
	// Floating point value of the variable
	float m_VariableValue;
	// Vector values
	int m_VectorLength;
	float *m_VectorValue;
	int m_VectorSelectedSubscript;

	// Matrix values
	int m_MatrixFirstDimensionLength;
	int m_MatrixSecondDimensionLength;
	float **m_MatrixValue;
	int m_MatrixSelectedFirstDim;
	int m_MatrixSelectedSecondDim;

public:
	// Create a named, typed symbol
	CSymbol(void);
	~CSymbol(void);
	CSymbol(string Name);
	CSymbol(string Name, symboltype_t Type);
	
	// Set a value in an existing matrix
	void Set(float Value);
	// Create a vector from an existing, uninitialized symbol
	void CreateVector(int Dimension);
	// Create a matrix from an existing, uninitialized symbol
	void CreateMatrix(int FirstDimension, int SecondDimension);
	void Set(float Value, int Subscript);
	void Set(float Value, int FirstSubscript, int SecondSubscript);
	// Get the identifier name of the symbol
	string GetName(void);
	// Get a value from a matrix
	float Get(void);
	float Get(int Subscript);
	float Get(int FirstSubscript, int SecondSubscript);
	// Set the subscripts for a matrix
	void SetSubscript(int Dim);
	void SetSubscript(int FirstDim, int SecondDim);
};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -