source: git/modules/demo.mod @ ef726a2

fieker-DuValspielwiese
Last change on this file since ef726a2 was ef726a2, checked in by Anne Frühbis-Krüger <anne@…>, 22 years ago
*anne: demo.mod moved to ${topsrcdir}/modules git-svn-id: file:///usr/local/Singular/svn/trunk@6163 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 2.1 KB
Line 
1%{
2/*
3 *  $Id: demo.mod,v 1.1 2002-06-25 08:20:49 anne Exp $
4 *
5 *  Test mod fuer modgen
6 */
7
8#include <stdio.h>
9
10extern void piShowProcList();
11%}
12
13// some comments here
14
15package="demo_module";
16version = "$Id: demo.mod,v 1.1 2002-06-25 08:20:49 anne Exp $";
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%procedures
36/*
37 * NAME:     proclist
38 *           procedure without any parameter and no return value;
39 * PURPOSE:  shows a list of all defined procedure.
40 */
41none proclist
42{
43  piShowProcList();
44  %return();
45}
46example
47{
48  proclist();
49}
50
51/*
52 *
53 * diese procedur ist mit Absicht auskommentart - ich weiss nicht,
54 * wie sie richtig gehen soll/
55static start_sg
56{
57  %singularcmd(inout::f(q,w,e));
58}
59
60/*
61 */
62int mysum(
63        int i,
64        int j
65        )
66"Return sum of i and j"
67{
68  // generate internal variable declaration
69  //
70  %declaration;
71
72  // generate typecheck and typeconversation code
73  %typecheck;
74 
75  //%return = (void*)((int)i->Data() + (int)j->Data());
76  %return = (void *)(i + j);
77}
78example
79{ Demo::mysum(2,3);
80}
81
82ideal toid()
83// call function toid();
84{
85  // generate internal variable declaration
86  // (will write nothing: there are no parameters
87  %declaration;
88
89  // generate typecheck and typeconversation code
90  // (will write nothing: there are no parameters)
91  %typecheck;
92
93  // generate return vector
94  // data=toid();
95  //%return(my_toid);
96  return FALSE;
97
98};
99
100ideal toid2(ideal) {
101  // generate internal variable declaration
102  //
103  %declaration;
104
105  return FALSE;
106//  %return();
107};
108
109/* /    typedef,
110k_test(
111        ideal,
112        int,
113        intvec,
114        intmat,
115        link,
116        list,
117        map,
118        matrix,
119        module,
120        number,
121        package,
122        poly,
123        proc,
124        qring,
125        ring,
126        string,
127        vector
128)
129//function="k_test_func";
130{
131  %declaration;
132 
133  printf("Nur ein Test\n");
134
135  %typecheck;
136  %return;
137 
138}
139
140into {
141}
142*/
143/*
144string nn(string) {
145  function=iiKernelMiscNN;
146};
147*/
148
149%%
150%C
151
152/*proc sscanf(string, string) = IOsscanf; */
153
154void mytest()
155{
156  printf("Test\n");
157  printf("here commes some other C-text\n");
158}
Note: See TracBrowser for help on using the repository browser.