File: runtimebase.in

package info (click to toggle)
asymptote 3.09%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 41,392 kB
  • sloc: cpp: 282,597; ansic: 69,697; python: 15,252; sh: 5,888; perl: 3,006; makefile: 1,719; lisp: 1,507; yacc: 614; lex: 449; xml: 182; javascript: 79; asm: 8
file content (64 lines) | stat: -rw-r--r-- 1,341 bytes parent folder | download | duplicates (4)
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
/*****
 * runtimebase.in
 * Andy Hammerlindl  2009/07/28
 *
 * Common declarations needed for all code-generating .in files.
 *
 *****/


// Basic types need by almost all .in files.

// Use Void f() instead of void f() to force an explicit Stack argument.
void     => primVoid()
Void     => primVoid()

Int      => primInt()
bool     => primBoolean()
double   => primReal()
real     => primReal()
string*  => primString()
string   => primString()

#include "stack.h"
#include "types.h"
#include "builtin.h"
#include "entry.h"
#include "errormsg.h"
#include "array.h"
#include "triple.h"
#include "callable.h"
#include "opsymbols.h"

using vm::stack;
using vm::error;
using vm::array;
using vm::read;
using vm::callable;
using types::formal;
using types::function;
using camp::triple;

#define PRIMITIVE(name,Name,asyName) using types::prim##Name;
#include <primitives.h>
#undef PRIMITIVE

void unused(void *);

namespace run {
typedef double real;

array *copyArray(array *a);
array *copyArray2(array *a);
array *copyArray3(array *a);

double *copyTripleArray2Components(array *a, size_t &N,
                                   GCPlacement placement=NoGC);
triple *copyTripleArray2C(array *a, size_t &N,
                          GCPlacement placement=NoGC);
}

function *realRealFunction();

#define CURRENTPEN processData().currentpen