1. Description
-------------------
The module PASCALC.DCU is the Pascal-like language interpreter for Delphi.
The basic differences from standard Pascal the following:
- All variables stored as variants.
- It's no need to declare variables, labels and functions. PASCALC creates
variables dynamically on first assignment. Variable type depends on the
last value assigned, type checking is not carried out.
- Expressions syntax:
Arithmetic operators: +, -, *, /, ^ (power), SHL, SHR
Bitwise operators: BITOR,BITAND,BITXOR,BITNOT
Logical operators: >, <, >=, <=, =, <>, AND, OR, NOT,
constants TRUE and FALSE.
Operators precedence standard, you can use parentheses.
- Statements supported:
BEGIN... END
IF... THEN... ELSE
CASE
FOR... TO/DOWNTO... DO
WHILE... DO
REPEAT... UNTIL
BREAK
CONTINUE
GOTO
EXIT
USES
INCLUDE
- All reserved words are declared in interface section as string array.
You can change them to anyone others. All identifiers should be different
(except assignment and equation, they may be the same).
- Multi-dimensional arrays supported. Array items are variables whose names
consist from array name and indexes (in brackets). Array items properties
same as the simple variables. It's no need to declare arrays. Array index
continuity is not requred. It's possible to access string as char array.
You can assign chars or numbers in range 0..255 to string characters.
Array name should be unique, simple variable MyArr and array item MyArr[1]
can't exist at the same time. This rule allows to distinguish access to
1-st character of string variable MyArr (MyArr[1]) from the accees to
the first item of array MyArr. To access character of string array item,
character index should be written in brackets after item name, for example
MyArr[1,2][3].
- All build-in functions are user-defined. Module pasfunc.pas contain
example of PASCALC implementations for common Delphi functions. You can use
this functions and write your own implementations for necessary functions.
There is no need to declare parameters for user-defined functions, therefore
it's types and amount are not limited. If necessary you can provide type
checking inside function code. Interpreter calculates all parameter values
and creates temporary values list (TVarList). Names of var-parameters in this
list are 'VAR', otherwise 'VALUE'. After function call interpreter updates
values for var-parameters. Function result type not checked, one function can
return number as well as string. Functions can be called as procedures (without
result usage).
- Procedures and functions (in sense of the subroutines on interpreter language)
are supported. The function heading specifies only names of formal parameters,
without parameters types and pass method (var or value). Also, function's result
types are not declared. To return function result you should assign value to
variable "result".
If actual parameter is variable (not expression), it considered as var-parameter.
In this case assigning new value to this parameter inside procedure or function
will affect the actual parameter variable.
At the same time, all interpreter global variables inside a function or procedures
looks like local variables, with the same initial values as global ones.
You can change this values inside procedures (functions), but it's don't affect
the global variables. All new variables created inside procedures and functions
are local, and will be destroyed after exiting.
Therefore, it is possible to use any names for local variables, without conflicts
with the global variables.
For libraries implementation, it is possible to use operators USES and INCLUDE.
Syntax: USES 'filename';
INCLUDE 'filename';
INCLIDE and USES are parsed by pre-processor before script execution.
INCLUDE inserts text from file 'filename' into the script, USES loads
procedures and functions declarations.
2. License
----------
This software is provided as it is, without any kind of warranty given.
The author can not be held responsible for any kind of damage, problems etc,
arised from using this software. PASCALC interpreter is shareware product.
Unregistered version has no time or functionality limitations, but can
show info screen.
If you want get source code, you should register PASCALC and get registration code.
Use your registration code as password for source archive (Source\pascsrc.zip).
Address for online registration (price $20):
https://www.regnow.com/softsell/nph-softsell.cgi?item=2608-2
You can modify PASCALC source code as you need, distribute executable files
compiled with PASCALC source. But you can't distribute original or modified
PASCALC source code, .DCU units or libraries based on PASCALC source code.
3. PASCALC inteface
-------------------
unit pascalc;
{$F+,B-,R-}
interface
uses
Windows, Messages, SysUtils, Classes, Math;
type TToken =
(tEMPTY, tVR, tCON, tTRUE, tFALSE,
tEQU, tOR, tAND, tNOT, tXOR,
tCOMMA, tLBL, tNEQ, tGT, tLS,
tGTE, tLSE, tADD, tSUB, tMUL,
tDIV, tPWR, tLBR, tRBR, tLARR,
tRARR, tSEMI, tREM, tREMB, tREME,
tASSIGN, tBEGIN, tEND, tIF, tTHEN,
tELSE, tFOR, tTO, tDOWNTO, tDO,
tWHILE, tREPEAT, tUNTIL, tBREAK, tCONTINUE,
tEXIT, tGOTO, tSHL, tSHR, tPROC,
tFUNCT, tUSES, tINCLUDE, tCASE, tOF,
tCOMMA2);
type TTokenSet = set of TToken;
const
ResWords : array[TToken] of string[10] =
('', '', '', 'TRUE', 'FALSE',
'=', 'OR', 'AND', 'NOT', 'XOR',
',', ':', '<>', '>', '<',
'>=', '<=', '+', '-', '*',
'/', '^', '(', ')', '[',
']', ';', '//', '{', '}',
':=', 'BEGIN', 'END', 'IF', 'THEN',
'ELSE', 'FOR', 'TO', 'DOWNTO', 'DO',
'WHILE', 'REPEAT', 'UNTIL', 'BREAK', 'CONTINUE',
'EXIT', 'GOTO', 'SHL', 'SHR', 'PROCEDURE',
'FUNCTION', 'USES', 'INCLUDE', 'CASE', 'OF',
'..');
const
Alpha : set of char = ['_','0'..'9','a'..'z','A'..'Z','à'..'ÿ','¸','À'..'ß','¨'];
StrDelimiter : char = '''';
DecimalPoint : char = '.';
TokenDelimiter : char = #127;
type TVar = record
Name : string;
Value : variant;
end;
type TPVar = ^TVar;
type TVarList = class (TList)
destructor Destroy; override;
procedure ClearAll;
function AddVar(V:TVar) : boolean;
function AddValue(N:string; V:variant) : boolean;
function VarExist(N:string):boolean;
function VarIndex(N:string):integer;
function VarByName(N:string;var V:TVar) : boolean;
function SetVar(V:TVar) : boolean;
function SetValue(N:string; V:variant) : boolean;
procedure CopyTo(VL:TVarList);
end;
type TPVarList = ^TVarList;
type PProcessProc = procedure;
type PFunction = function(Sender:TObject; var A:TVarList; var R:TVar) : boolean;
type TFunc = record
Name : string;
Func : Pointer;
end;
type TPFunc = ^TFunc;
type TFuncList = class (TList)
destructor Destroy; override;
procedure ClearAll;
function AddFunction(N:string; F:Pointer) : boolean;
end;
type TProcedure = record
Name : string;
Body : string;
Params : string;
Result : boolean;
end;
type TPProcedure = ^TProcedure;
type TProcList = class(TList)
destructor Destroy; override;
procedure ClearAll;
function AddProc(Proc:TProcedure):boolean;
function ProcIndex(Name:string):integer;
function ProcByName(Name:string; var Proc:TProcedure):boolean;
end;
没有合适的资源?快使用搜索试试~ 我知道了~
NeoProgrammer编程器
共71个文件
jpg:21个
pas:9个
pdf:9个
需积分: 6 13 下载量 174 浏览量
2023-03-21
17:58:00
上传
评论
收藏 10.74MB ZIP 举报
温馨提示
NeoProgrammer编程器
资源推荐
资源详情
资源评论
收起资源包目录
NeoProgrammer编程器.zip (71个子文件)
NeoProgrammer编程器
.DS_Store 6KB
Drivers
CH341A
CH341WDM.INF 5KB
CH341WDM.SYS 20KB
DRVSETUP64
DRVSETUP64.exe 46KB
CH341WDM.CAT 8KB
CH341A_install.png 9KB
SETUP.EXE 98KB
CH341W64.SYS 31KB
CH341DLL.DLL 30KB
ch341_jumper.jpg 100KB
CH341A编程器 绿色双电压改造版.docx 635KB
khan Dish Network.txt 49B
libusb0.dll 66KB
Doc
.DS_Store 6KB
CH341
.DS_Store 6KB
Programmers
ch341a_black_3.3v_5.0v_basic_(EN).pdf 225KB
ch341a_black_3.3v_5.0v_basic_(RU).pdf 227KB
ch341a_black_3.3v_5.0v_basic_(FR).pdf 227KB
5V_select.jpg 156KB
CH341_v2.0.jpg 112KB
3.3V_Fix.jpg 118KB
Adapters
I2C_ADAPTER_FOR_CH341_(EN).pdf 485KB
MB connection ENE.txt 9KB
I2C_ADAPTER_FOR_CH341_(RU).pdf 488KB
MICROWIRE_ADAPTER_FOR_CH341_(RU).pdf 607KB
SPI45xx_ADAPTER_FOR_CH341_(EN).pdf 331KB
MICROWIRE_ADAPTER_FOR_CH341_(EN).pdf 609KB
SPI45xx_ADAPTER_FOR_CH341_(RU).pdf 333KB
Dump
编程器直连主板JSPI.xlsx 69KB
NeoProgrammer.exe 4.02MB
devicelist.txt 25KB
NeoProgrammer_changes.txt 6KB
settings.xml 567B
CH341A土豪金编程器 黑色双电压改造版.docx 1.44MB
NeoProgrammer_changes_RU.txt 9KB
Adapters
.DS_Store 6KB
CH341
.DS_Store 6KB
scheme_93Cxx.jpg 102KB
scheme_ER59xx.jpg 74KB
scheme_93Cx5.jpg 126KB
I2C_1.8v_Adapter.jpg 49KB
scheme_BR90xx.jpg 164KB
scheme_I2C.jpg 54KB
SPI_1.8v_Adapter.jpg 53KB
scheme_N76Exx.jpg 142KB
scheme_SPI45.jpg 60KB
scheme_M35080.jpg 54KB
scheme_TC9WMAxx.jpg 74KB
scheme_TC8912x.jpg 70KB
scheme_93Sxx.jpg 66KB
scheme_I2C_M34E0x.jpg 70KB
scheme_KB901x.jpg 42KB
KB901x
scheme_AVRISP.jpg 58KB
scheme_CT1C08.jpg 92KB
chiplist.zip 1.75MB
chiplist.dat 14KB
CH341DLL.DLL 30KB
scripts
script_func_EN.html 32KB
SPI_NAND_utilities_MOD.pas 5KB
script_func.html 13KB
S25FL128S_Read_OTP.pas 1000B
IS25LQ040_SafeGuardRegister.pas 1KB
README_RU.TXT 16KB
MX25L1605D_OTP.pas 3KB
uch_95040_test.bin 512B
i2c_example.pas 1KB
AT45DB161E_SecurityFunc_test.pas 5KB
AT25D161_SecRegister.pas 1KB
read_write_95xxx_example.pas 8KB
README.TXT 15KB
NOR_READ_ID.pas 1KB
共 71 条
- 1
资源评论
极客点儿
- 粉丝: 4993
- 资源: 27
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功