当前位置: 首页 > 工具软件 > my_basic > 使用案例 >

MY-BASIC应用1:MY-BASIC解析器介绍

罗韬
2023-12-01

MY-BASIC is a lightweight BASIC interpreter written in standard C in dual files.
//MY-BASIC是一个轻量级的BASIC解释器,用标准C语言在双文件中编写。
 
It's aimed to be embeddable, extendable and portable.
//它的目标是可嵌入、可扩展和可移植。

It is a dynamic typed programming language,reserves structured syntax,
//它是一种动态类型的编程语言,保留结构化语法
 
supports a style of prototype-based programming (OOP),
//支持一种基于原型的编程风格(OOP)

also implements a functional paradigm by lambda abstraction.
//还通过lambda抽象实现了函数范型。

The core is written in a C source file and an associated header file.
//核心是在一个C源文件和一个相关的头文件中编写的。

It's easy to either use it as a standalone interpreter or embed it with existing projects in C, C++, Java, Objective-C, Swift, C#, etc.
and totally customizable by adding your own scripting interfaces.
它既可以作为一个独立的解释器使用,
也可以嵌入到现有的C、c++、Java、Objective-C、Swift、c#等项目中,
并且可以通过添加自己的脚本接口完全定制。

Main features
主要特征

MY-BASIC offers a wide range of features including:
MY-BASIC 提供广阔的功能,如下:

    Written in standard C, source code is portable to a dozen of platforms
    //用标准C编写的源代码可以移植到十几个平台

    Lightweight (within less than 128KB footprint), fast, and configurable
    //轻量级(小于128KB内存占用)、快速且可配置

    With both retro and modern BASIC syntax
    //具有复古和现代的基本语法

    Case-insensitive tokenization, and many other indelible BASIC flavour
    //不区分大小写的标记,和许多其他BASIC不可磨灭的元素

    Unicode support
    //Unicode 支持

    Prototype-based programming, with reflection support
    //基于原型的编程,支持反射

    Lambda abstraction enhanced functional programming
    //Lambda抽象增强了函数式编程

    Customizable referenced/non-referenced usertype
    //可定制的引用/非引用usertype

    Collection construction and manipulation functions for LIST and DICT
    //用于列表和DICT的集合构造和操作函数

    Automatic releasing for referenced values (prototype, lambda, referenced usertype, list, dictionary, etc.) benefited from reference counting and garbage collection
    //对引用值(原型、lambda、引用的usertype、列表、字典等)的自动释放得益于引用计数和垃圾收集

    Common numeric and string functions
    //常见的数字和字符串函数

    Structured sub routine definition with the DEF/ENDDEF statements
    //使用DEF/ENDDEF语句定义结构化子例程

    Structured IF/THEN/ELSEIF/ELSE/ENDIF
    //结构:IF/THEN/ELSEIF/ELSE/ENDIF

    Structured FOR/TO/STEP/NEXT, FOR/IN/NEXT, WHILE/WEND, DO/UNTIL
    //结构:FOR/TO/STEP/NEXT, FOR/IN/NEXT, WHILE/WEND, DO/UNTIL

    Reserved retro GOTO, GOSUB/RETURN
    //保留的复古 GOTO, GOSUB/RETURN

    Importing multiple source files with the IMPORT statement
    //使用IMPORT语句导入多个源文件

    Debug API
    //调试API

    Customizable memory pool
    //可定制的内存池

    Easy API, for extending new BASIC functions
    //简单的API,用于扩展新的基本函数

    Easy interacting BASIC facilities at native side, and vice versa
    //易于在本机端交互基本设施,反之亦然

    More features under development
    //更多功能正在开发中

 

 类似资料: