spielwiese
Last change
on this file since c7d29b was
c36fda,
checked in by Oleksandr Motsak <motsak@…>, 10 years ago
|
Moved all the outdated modgen related stuff to /old_modgen/ for now
|
-
Property mode set to
100644
|
File size:
1003 bytes
|
Line | |
---|
1 | %{ |
---|
2 | /* |
---|
3 | * |
---|
4 | * Test mod fuer modgen |
---|
5 | */ |
---|
6 | |
---|
7 | #include <stdio.h> |
---|
8 | #include <kernel/mod2.h> |
---|
9 | #include <tok.h> |
---|
10 | #include <polys.h> |
---|
11 | |
---|
12 | |
---|
13 | extern void piShowProcList(); |
---|
14 | %} |
---|
15 | |
---|
16 | category="mega"; |
---|
17 | package="mega_module"; |
---|
18 | version = "$Id$"; |
---|
19 | info =" |
---|
20 | LIBRARY: mega.lib PROCEDURES OF GENERAL TYPE WRITEN IN C |
---|
21 | |
---|
22 | proclist(); Lists all procedures. |
---|
23 | "; |
---|
24 | |
---|
25 | %% |
---|
26 | |
---|
27 | %procedures |
---|
28 | |
---|
29 | /* |
---|
30 | */ |
---|
31 | poly mysum( |
---|
32 | poly i, |
---|
33 | poly j |
---|
34 | ) |
---|
35 | "Return sum of i and j" |
---|
36 | { |
---|
37 | poly h; |
---|
38 | // generate internal variable declaration |
---|
39 | // |
---|
40 | %declaration; |
---|
41 | |
---|
42 | // generate typecheck and typeconversation code |
---|
43 | %typecheck; |
---|
44 | |
---|
45 | h = pCopy(i); |
---|
46 | %return = (void *)pAdd(h , j); |
---|
47 | } |
---|
48 | int mysumint( |
---|
49 | int i, |
---|
50 | int j |
---|
51 | ) |
---|
52 | "Return sum of i and j" |
---|
53 | { |
---|
54 | // generate internal variable declaration |
---|
55 | // |
---|
56 | %declaration; |
---|
57 | |
---|
58 | // generate typecheck and typeconversation code |
---|
59 | %typecheck; |
---|
60 | |
---|
61 | //%return = (void*)((int)i->Data() + (int)j->Data()); |
---|
62 | %return = (void *)(i + j); |
---|
63 | } |
---|
64 | example |
---|
65 | { Demo::mysum(2,3); |
---|
66 | } |
---|
67 | |
---|
68 | |
---|
69 | %% |
---|
70 | %C |
---|
71 | |
---|
72 | void mytest() |
---|
73 | { |
---|
74 | printf("Test\n"); |
---|
75 | printf("here commes some other C-text\n"); |
---|
76 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.