source: git/dyn_modules/demo.mod @ f0f0cea

spielwiese
Last change on this file since f0f0cea was 6ce030f, checked in by Oleksandr Motsak <motsak@…>, 12 years ago
removal of the $Id$ svn tag from everywhere NOTE: the git SHA1 may be used instead (only on special places) NOTE: the libraries Singular/LIB/*.lib still contain the marker due to our current use of svn
  • Property mode set to 100644
File size: 2.2 KB
Line 
1%{
2/*
3 *
4 *  Test mod fuer modgen
5 */
6
7#include <stdio.h>
8
9extern void piShowProcList();
10%}
11
12// some comments here
13
14category="tests";
15package="demo_module";
16version = "$Id$";
17info    ="
18LIBRARY: kernel.lib  PROCEDURES OF GENERAL TYPE WRITEN IN C
19
20  proclist();    Lists all procedures.
21";
22
23//%{
24//static int i;
25//%}
26
27//other ="hallo";   // should return an error
28
29//cxxsource = proclist.cc , misc.cc;
30//cxxsource = misc.cc;
31/*cxxsource = sscanf.cc
32*/
33
34%%
35%Singular
36
37proc testa (int i,int j)
38" keine Hilfe"
39{
40  "testa";
41  int a=i-j;
42  return(a);
43}
44example
45{
46  testa(2,3);
47}
48%procedures
49/*
50 * NAME:     proclist
51 *           procedure without any parameter and no return value;
52 * PURPOSE:  shows a list of all defined procedure.
53 */
54none proclist
55{
56  piShowProcList();
57  %return();
58}
59example
60{
61  proclist();
62}
63
64/*
65 *
66 * diese procedur ist mit Absicht auskommentart - ich weiss nicht,
67 * wie sie richtig gehen soll/
68static start_sg
69{
70  %singularcmd(inout::f(q,w,e));
71}
72
73/*
74 */
75int mysum(
76        int i,
77        int j
78        )
79"Return sum of i and j"
80{
81  // generate internal variable declaration
82  //
83  %declaration;
84
85  // generate typecheck and typeconversation code
86  %typecheck;
87 
88  //%return = (void*)((int)i->Data() + (int)j->Data());
89  %return = (void *)(i + j);
90}
91example
92{ Demo::mysum(2,3);
93}
94
95ideal toid()
96// call function toid();
97{
98  // generate internal variable declaration
99  // (will write nothing: there are no parameters
100  %declaration;
101
102  // generate typecheck and typeconversation code
103  // (will write nothing: there are no parameters)
104  %typecheck;
105
106  // generate return vector
107  // data=toid();
108  //%return(my_toid);
109  return FALSE;
110
111};
112
113ideal toid2(ideal) {
114  // generate internal variable declaration
115  //
116  %declaration;
117
118  return FALSE;
119//  %return();
120};
121
122/* /    typedef,
123k_test(
124        ideal,
125        int,
126        intvec,
127        intmat,
128        link,
129        list,
130        map,
131        matrix,
132        module,
133        number,
134        package,
135        poly,
136        proc,
137        qring,
138        ring,
139        string,
140        vector
141)
142//function="k_test_func";
143{
144  %declaration;
145 
146  printf("Nur ein Test\n");
147
148  %typecheck;
149  %return;
150 
151}
152
153into {
154}
155*/
156/*
157string nn(string) {
158  function=iiKernelMiscNN;
159};
160*/
161
162%%
163%C
164
165/*proc sscanf(string, string) = IOsscanf; */
166
167void mytest()
168{
169  printf("Test\n");
170  printf("here commes some other C-text\n");
171}
Note: See TracBrowser for help on using the repository browser.