在好例子网,分享、交流、成长!
您当前所在位置:首页Others 开发实例一般编程问题 → Squirrel 2.2 参考手册.pdf

实例介绍

【实例简介】Squirrel 2.2 参考手册.pdf
squirrel2.2 松鼠脚本参考手册,包含CAPI和脚本语法

【实例截图】

【核心代码】

Table of Contents
1. Introduction ............................................................................................................ 1
2. The language .......................................................................................................... 2
Lexical structure ................................................................................................. 2
Identifiers .................................................................................................. 2
Keywords .................................................................................................. 2
Operators ................................................................................................... 2
Other tokens ............................................................................................... 2
Literals ..................................................................................................... 2
Comments ................................................................................................. 3
Values and Data types .......................................................................................... 3
Integer ...................................................................................................... 4
Float ......................................................................................................... 4
String ........................................................................................................ 4
Null .......................................................................................................... 4
Bool ......................................................................................................... 5
Table ........................................................................................................ 5
Array ........................................................................................................ 5
Function .................................................................................................... 5
Class ........................................................................................................ 5
Class instance ............................................................................................. 5
Generator .................................................................................................. 6
Userdata .................................................................................................... 6
Thread ...................................................................................................... 6
Weak References ........................................................................................ 6
Execution Context ............................................................................................... 6
Variables ................................................................................................... 6
Statements ......................................................................................................... 8
Block ........................................................................................................ 8
Control Flow Statements .............................................................................. 8
Loops ....................................................................................................... 9
break ...................................................................................................... 10
continue .................................................................................................. 10
return ...................................................................................................... 10
yield ....................................................................................................... 11
Local variables declaration .......................................................................... 11
Function declaration .................................................................................. 11
Class declaration ....................................................................................... 11
try/catch .................................................................................................. 11
throw ...................................................................................................... 12
const ....................................................................................................... 12
enum ...................................................................................................... 12
expression statement .................................................................................. 12
Expressions ...................................................................................................... 12
Assignment(=) & new slot(<-) ..................................................................... 12
Operators ................................................................................................. 13
Table constructor ...................................................................................... 15
delegate ................................................................................................... 16
clone ...................................................................................................... 16
Array constructor ...................................................................................... 17
Tables ............................................................................................................. 17
Construction ............................................................................................ 17
Slot creation ............................................................................................. 17
Slot deletion ............................................................................................. 18
ivSquirrel 2.2 Reference Manual
Arrays ............................................................................................................. 18
Functions ......................................................................................................... 18
Function declaration .................................................................................. 18
Function calls ........................................................................................... 20
Binding an environment to a function ............................................................ 20
Free variables ........................................................................................... 21
Tail recursion ........................................................................................... 21
Classes ............................................................................................................ 21
Class declaration ....................................................................................... 21
Class instances ......................................................................................... 24
Inheritance ............................................................................................... 25
Metamethods ............................................................................................ 27
Generators ....................................................................................................... 27
Constants & Enumerations .................................................................................. 28
Constants ................................................................................................. 28
Enumerations ........................................................................................... 29
Implementation notes ................................................................................. 29
Threads ........................................................................................................... 30
Using threads ........................................................................................... 30
Weak References .............................................................................................. 32
Delegation ....................................................................................................... 33
Metamethods .................................................................................................... 33
_set ........................................................................................................ 34
_get ........................................................................................................ 34
_newslot .................................................................................................. 34
_delslot ................................................................................................... 34
_add ....................................................................................................... 35
_sub ....................................................................................................... 35
_mul ....................................................................................................... 35
_div ........................................................................................................ 35
_modulo .................................................................................................. 35
_unm ...................................................................................................... 35
_typeof ................................................................................................... 35
_cmp ...................................................................................................... 35
_call ....................................................................................................... 36
_cloned ................................................................................................... 36
_nexti ..................................................................................................... 36
_tostring .................................................................................................. 36
_inherited ................................................................................................ 36
_newmember ............................................................................................ 36
Built-in functions .............................................................................................. 37
Global symbols ......................................................................................... 37
Default delegates ...................................................................................... 38
3. Embedding Squirrel ............................................................................................... 45
Memory management ........................................................................................ 45
Unicode .......................................................................................................... 45
Squirrel on 64 bits architectures ........................................................................... 45
Squirrel with double precision floats ..................................................................... 45
Error conventions .............................................................................................. 45
Initializing Squirrel ........................................................................................... 46
The Stack ........................................................................................................ 46
Stack indexes ........................................................................................... 46
Stack manipulation .................................................................................... 47
Runtime error handling ...................................................................................... 48
Compiling a script ............................................................................................. 48
Calling a function .............................................................................................. 49
Create a C function ............................................................................................ 50
Tables and arrays manipulation ............................................................................ 51
vSquirrel 2.2 Reference Manual
Userdata and UserPointers .................................................................................. 53
The registry table .............................................................................................. 53
Mantaining strong references to Squirrel values from the C API ................................. 54
Debug Interface ................................................................................................ 54
4. API Reference ....................................................................................................... 56
Virtual Machine ................................................................................................ 56
Compiler ......................................................................................................... 61
Stack Operations ............................................................................................... 63
Object creation and handling ............................................................................... 65
Calls ............................................................................................................... 77
Objects manipulation ......................................................................................... 80
Bytecode serialization ........................................................................................ 89
Raw object handling .......................................................................................... 90
Debug interface ................................................................................................ 93
Index ...................................................................................................................... 95

squirrel2.2文档
├── Squirrel 2.2 参考手册.pdf

0 directories, 1 files

网友评论

发表评论

(您的评论需要经过审核才能显示)

查看所有0条评论>>

小贴士

感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。

  • 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
  • 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
  • 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
  • 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。

关于好例子网

本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明

;
报警