source: git/Singular/subexpr.h @ 6ae4f5

spielwiese
Last change on this file since 6ae4f5 was 6ae4f5, checked in by Hans Schönemann <hannes@…>, 27 years ago
* hannes: - corrected scanner.l: parsing of strings in blocks: if (1) { write("","}"); } - corrected ipassign.cc: assignment of "dummy" types: DEF, NONE - corrected sleftv::Print(_), initialisation of _ - added conversion int->def - added CopyD(DEF) - in insert(..): object should not be of type NONE (lists.cc:lInsert0) - added int*intvec, int*intmat to iparith.cc git-svn-id: file:///usr/local/Singular/svn/trunk@145 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 2.4 KB
Line 
1#ifndef SUBEXPR_H
2#define SUBEXPR_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6/* $Id: subexpr.h,v 1.3 1997-04-09 12:20:15 Singular Exp $ */
7/*
8* ABSTRACT: handling of leftv
9*/
10
11#include <string.h>
12#include "structs.h"
13
14struct _ssubexpr
15{
16  struct _ssubexpr * next;
17  int start;
18};
19
20typedef struct _ssubexpr sSubexpr;
21typedef sSubexpr * Subexpr;
22
23extern const char sNoName[];
24extern BOOLEAN siq;
25
26class sleftv;
27typedef sleftv * leftv;
28class sleftv
29{
30  public:
31  /* !! do not change the first 6 entries !! (see ipid.h: idrec) */
32    leftv       next;
33    char *      name;
34    void *      data;
35    BITSET      flag;
36    attr        attribute;
37    int         rtyp;
38                 /* the type of the expression, describes the data field
39                  * (E) markes the type field in iparith
40                  * (S) markes the rtyp in sleftv
41                  * ANY_TYPE:   data is int: real type or 0    (E)
42                  * DEF_CMD:    all types, no change in sleftv (E)
43                  * IDHDL: existing variable         (E)
44                  * IDHDL: variable, data is idhdl   (S)
45                  * COMMAND: data is command         (S)
46                  * INT_CMD:      int constant, data is int  (E,S)
47                  * INTVEC_CMD:   intvec constant, data is intvec * (E,S)
48                  * POLY_CMD:     poly constant, data is poly (E,S)
49                  * ....
50                  */
51    Subexpr e;    /* holds the indices for indexed values */
52    inline void Init() { memset(this,0,sizeof(*this)); }
53    void Set(int val);
54    void Print(leftv store=NULL,int spaces=0);
55    void CleanUp();
56    char * String(void *d=NULL);
57    void Copy(leftv e);
58    void * CopyD();
59    attr CopyA();
60    void * CopyD(int t);
61    inline const char * Name()
62    {
63      if ((name!=NULL) && (e==NULL)) return name;
64      else return sNoName;
65    }
66    int  Typ();
67    int  LTyp(); /* returns LIST_CMD for l[i], otherwise returns Typ() */
68    void * Data();
69    leftv LData(); /* returns &(l[i]) for l[i], otherwise returns this */
70    leftv LHdl();
71    attr * Attribute();
72    inline leftv Next() { return next; }
73    int listLength();
74    int Eval(); /*replace a COMMAND by its result otherwise by CopyD*/
75};
76
77extern sleftv sLastPrinted;
78
79struct _sssym
80{
81  idhdl   h;
82  Subexpr e;
83};
84typedef struct _sssym ssym;
85typedef ssym * sym;
86
87void syMake(leftv v,char * name);
88BOOLEAN assumeStdFlag(leftv h);
89
90#endif
Note: See TracBrowser for help on using the repository browser.