File: compiler.rst

package info (click to toggle)
squirrel3 3.1-8.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,380 kB
  • sloc: cpp: 12,722; ansic: 917; makefile: 316; python: 40
file content (79 lines) | stat: -rw-r--r-- 3,337 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
.. _api_ref_compiler:

========
Compiler
========

.. _sq_compile:

.. c:function:: SQRESULT sq_compile(HSQUIRRELVM v, HSQLEXREADFUNC read, SQUserPointer p, const SQChar * sourcename, SQBool raiseerror)

    :param HSQUIRRELVM v: the target VM
    :param HSQLEXREADFUNC read: a pointer to a read function that will feed the compiler with the program.
    :param SQUserPointer p: a user defined pointer that will be passed by the compiler to the read function at each invocation.
    :param const SQChar * sourcename: the symbolic name of the program (used only for more meaningful runtime errors)
    :param SQBool raiseerror: if this value is true the compiler error handler will be called in case of an error
    :returns: a SQRESULT. If the sq_compile fails nothing is pushed in the stack.
    :remarks: in case of an error the function will call the function set by sq_setcompilererrorhandler().

compiles a squirrel program; if it succeeds, push the compiled script as function in the stack.





.. _sq_compilebuffer:

.. c:function:: SQRESULT sq_compilebuffer(HSQUIRRELVM v, const SQChar* s, SQInteger size, const SQChar * sourcename, SQBool raiseerror)

    :param HSQUIRRELVM v: the target VM
    :param const SQChar* s: a pointer to the buffer that has to be compiled.
    :param SQInteger size: size in characters of the buffer passed in the parameter 's'.
    :param const SQChar * sourcename: the symbolic name of the program (used only for more meaningful runtime errors)
    :param SQBool raiseerror: if this value true the compiler error handler will be called in case of an error
    :returns: a SQRESULT. If the sq_compilebuffer fails nothing is pushed in the stack.
    :remarks: in case of an error the function will call the function set by sq_setcompilererrorhandler().

compiles a squirrel program from a memory buffer; if it succeeds, push the compiled script as function in the stack.





.. _sq_enabledebuginfo:

.. c:function:: void sq_enabledebuginfo(HSQUIRRELVM v, SQBool enable)

    :param HSQUIRRELVM v: the target VM
    :param SQBool enable: if true enables the debug info generation, if == 0 disables it.
    :remarks: The function affects all threads as well.

enable/disable the debug line information generation at compile time.





.. _sq_notifyallexceptions:

.. c:function:: void sq_notifyallexceptions(HSQUIRRELVM v, SQBool enable)

    :param HSQUIRRELVM v: the target VM
    :param SQBool enable: if true enables the error callback notification of handled exceptions.
    :remarks: By default the VM will invoke the error callback only if an exception is not handled (no try/catch traps are present in the call stack). If notifyallexceptions is enabled, the VM will call the error callback for any exception even if between try/catch blocks. This feature is useful for implementing debuggers.

enable/disable the error callback notification of handled exceptions.





.. _sq_setcompilererrorhandler:

.. c:function:: void sq_setcompilererrorhandler(HSQUIRRELVM v, SQCOMPILERERROR f)

    :param HSQUIRRELVM v: the target VM
    :param SQCOMPILERERROR f: A pointer to the error handler function
    :remarks: if the parameter f is NULL no function will be called when a compiler error occurs. The compiler error handler is shared between friend VMs.

sets the compiler error handler function