My Project
Loading...
Searching...
No Matches
Data Structures | Typedefs | Enumerations | Functions | Variables
subexpr.h File Reference
#include <string.h>
#include "polys/monomials/ring.h"
#include "kernel/mod2.h"
#include "Singular/grammar.h"
#include "Singular/tok.h"
#include "Singular/attrib.h"
#include "Singular/fevoices.h"

Go to the source code of this file.

Data Structures

class  proc_singular
 
struct  proc_object
 
union  procinfodata
 
class  procinfo
 
struct  Subexpr
 
class  sleftv
 Class used for (list of) interpreter objects. More...
 
class  libstack
 

Typedefs

typedef procinfoprocinfov
 
typedef sleftvleftv
 
typedef libstacklibstackv
 

Enumerations

enum  language_defs {
  LANG_NONE , LANG_TOP , LANG_SINGULAR , LANG_C ,
  LANG_MIX , LANG_MAX
}
 

Functions

BOOLEAN RingDependend (int t)
 
void syMake (leftv v, const char *name, package pa=NULL)
 
void syMakeMonom (leftv v, const char *name)
 
BOOLEAN assumeStdFlag (leftv h)
 
procinfov piCopy (procinfov pi)
 
BOOLEAN piKill (procinfov l)
 
const charpiProcinfo (procinfov pi, const char *request)
 
void piShowProcinfo (procinfov pi, char *txt)
 
void s_internalDelete (const int t, void *d, const ring r)
 

Variables

EXTERN_VAR BOOLEAN siq
 
EXTERN_INST_VAR sleftv sLastPrinted
 
EXTERN_VAR omBin sSubexpr_bin
 
EXTERN_VAR omBin procinfo_bin
 
EXTERN_VAR omBin libstack_bin
 

Data Structure Documentation

◆ proc_singular

class proc_singular

Definition at line 23 of file subexpr.h.

Data Fields
char * body
long body_end
int body_lineno
long body_start
long def_end
int example_lineno
long example_start
long help_chksum
long help_end
long help_start
long proc_end
long proc_start

◆ uprocinfodata

union uprocinfodata

Definition at line 45 of file subexpr.h.

Data Fields
struct proc_object o
proc_singular s

◆ procinfo

class procinfo

Definition at line 53 of file subexpr.h.

Data Fields
procinfodata data
char is_static
language_defs language
char * libname
package pack
char * procname
short ref
char trace_flag

◆ _ssubexpr

struct _ssubexpr

Definition at line 68 of file subexpr.h.

Data Fields
struct _ssubexpr * next
int start

Typedef Documentation

◆ leftv

Definition at line 79 of file subexpr.h.

◆ libstackv

Definition at line 159 of file subexpr.h.

◆ procinfov

Definition at line 66 of file subexpr.h.

Enumeration Type Documentation

◆ language_defs

Enumerator
LANG_NONE 
LANG_TOP 
LANG_SINGULAR 
LANG_C 
LANG_MIX 
LANG_MAX 

Definition at line 22 of file subexpr.h.

language_defs
Definition subexpr.h:22
@ LANG_MAX
Definition subexpr.h:22
@ LANG_SINGULAR
Definition subexpr.h:22
@ LANG_NONE
Definition subexpr.h:22
@ LANG_MIX
Definition subexpr.h:22
@ LANG_C
Definition subexpr.h:22
@ LANG_TOP
Definition subexpr.h:22

Function Documentation

◆ assumeStdFlag()

BOOLEAN assumeStdFlag ( leftv  h)

Definition at line 1588 of file subexpr.cc.

1589{
1590 if (h->e!=NULL)
1591 {
1592 leftv hh=h->LData();
1593 if (h!=hh) return assumeStdFlag(h->LData());
1594 }
1595 if (!hasFlag(h,FLAG_STD))
1596 {
1597 if (!TEST_VERB_NSB)
1598 {
1599 if (TEST_V_ALLWARN)
1600 Warn("%s is no standard basis in >>%s<<",h->Name(),my_yylinebuf);
1601 else
1602 Warn("%s is no standard basis",h->Name());
1603 }
1604 return FALSE;
1605 }
1606 return TRUE;
1607}
#define TRUE
Definition auxiliary.h:100
#define FALSE
Definition auxiliary.h:96
Class used for (list of) interpreter objects.
Definition subexpr.h:83
#define Warn
Definition emacs.cc:77
VAR char my_yylinebuf[80]
Definition febase.cc:44
#define hasFlag(A, F)
Definition ipid.h:112
#define FLAG_STD
Definition ipid.h:106
STATIC_VAR Poly * h
Definition janet.cc:971
#define NULL
Definition omList.c:12
#define TEST_V_ALLWARN
Definition options.h:142
#define TEST_VERB_NSB
Definition options.h:136
BOOLEAN assumeStdFlag(leftv h)
Definition subexpr.cc:1588

◆ piCopy()

procinfov piCopy ( procinfov  pi)
inline

Definition at line 149 of file subexpr.h.

150{
151 pi->ref++;
152 return pi;
153}
#define pi
Definition libparse.cc:1145

◆ piKill()

BOOLEAN piKill ( procinfov  l)

Definition at line 749 of file ipid.cc.

750{
751 (pi->ref)--;
752 if (pi->ref == 0)
753 {
754 if (pi->language==LANG_SINGULAR)
755 {
757 while (p!=NULL)
758 {
759 if (p->pi==pi && pi->ref <= 1)
760 {
761 Warn("`%s` in use, can not be killed",pi->procname);
762 return TRUE;
763 }
764 p=p->next;
765 }
766 }
767 if (pi->libname != NULL) // OB: ????
768 omFreeBinAddr((ADDRESS)pi->libname);
769 if (pi->procname != NULL) // OB: ????
770 omFreeBinAddr((ADDRESS)pi->procname);
771
772 if( pi->language == LANG_SINGULAR)
773 {
774 if (pi->data.s.body != NULL) // OB: ????
775 omFree((ADDRESS)pi->data.s.body);
776 }
777 if( pi->language == LANG_C)
778 {
779 }
780 memset((void *) pi, 0, sizeof(procinfo));
781 //pi->language=LANG_NONE;
783 }
784 return FALSE;
785}
int p
Definition cfModGcd.cc:4086
VAR Voice * currentVoice
Definition fevoices.cc:49
#define omFree(addr)
#define omFreeBin(addr, bin)
#define omFreeBinAddr(addr)
VAR omBin procinfo_bin
Definition subexpr.cc:42

◆ piProcinfo()

const char * piProcinfo ( procinfov  pi,
const char request 
)

Definition at line 725 of file ipid.cc.

726{
727 if((pi == NULL)||(pi->language==LANG_NONE)) return "empty proc";
728 else if (strcmp(request, "libname") == 0) return pi->libname;
729 else if (strcmp(request, "procname") == 0) return pi->procname;
730 else if (strcmp(request, "type") == 0)
731 {
732 switch (pi->language)
733 {
734 case LANG_SINGULAR: return "singular"; break;
735 case LANG_C: return "object"; break;
736 case LANG_NONE: return "none"; break;
737 default: return "unknown language";
738 }
739 }
740 else if (strcmp(request, "ref") == 0)
741 {
742 char p[8];
743 snprintf(p,8, "%d", pi->ref);
744 return omStrDup(p); // MEMORY-LEAK
745 }
746 return "??";
747}
#define omStrDup(s)

◆ piShowProcinfo()

void piShowProcinfo ( procinfov  pi,
char txt 
)

◆ RingDependend()

BOOLEAN RingDependend ( int  t)
inline

Definition at line 142 of file subexpr.h.

142{ return (BEGIN_RING<t)&&(t<END_RING); }
@ END_RING
Definition grammar.cc:311
@ BEGIN_RING
Definition grammar.cc:283

◆ s_internalDelete()

void s_internalDelete ( const int  t,
void d,
const ring  r 
)

Definition at line 518 of file subexpr.cc.

519{
520 assume(d!=NULL);
521 switch (t)
522 {
523 case CRING_CMD:
524 {
525 coeffs cf=(coeffs)d;
526 if ((cf->ref<1)&&
527 ((cf->type <=n_GF)
528 ||((cf->type >=n_long_C)&&(cf->type <=n_CF))))
529 {
530 Warn("cannot kill `%s`",nCoeffName(cf));
531 }
532 else // allow nKillChar for n_long_R, extensions, and user defined:
533 nKillChar((coeffs)d);
534 break;
535 }
536#ifdef SINGULAR_4_2
537 case CNUMBER_CMD:
538 {
539 number2 n=(number2)d;
540 n2Delete(n);
541 break;
542 }
543 case CPOLY_CMD:
544 {
545 poly2 n=(poly2)d;
546 p2Delete(n);
547 break;
548 }
549 case CMATRIX_CMD: //like BIGINTMAT
550#endif
551 case BIGINTMAT_CMD:
552 case BIGINTVEC_CMD:
553 {
554 bigintmat *v=(bigintmat*)d;
555 delete v;
556 break;
557 }
558 case BUCKET_CMD:
559 {
562 break;
563 }
564 case INTVEC_CMD:
565 case INTMAT_CMD:
566 {
567 intvec *v=(intvec*)d;
568 delete v;
569 break;
570 }
571 case MAP_CMD:
572 {
573 map m=(map)d;
574 omFreeBinAddr((ADDRESS)m->preimage);
575 m->preimage=NULL;
576 /* no break: continue as IDEAL*/
577 }
578 case SMATRIX_CMD:
579 case MATRIX_CMD:
580 case IDEAL_CMD:
581 case MODUL_CMD:
582 {
583 ideal i=(ideal)d;
584 id_Delete(&i,r);
585 break;
586 }
587 case STRING_CMD:
588 omFree(d);
589 break;
590 //case PACKAGE_CMD:
591 // return (void *)paCopy((package) d);
592 case PROC_CMD:
593 piKill((procinfo*)d);
594 break;
595 case POLY_CMD:
596 case VECTOR_CMD:
597 {
598 poly p=(poly)d;
599 p_Delete(&p,r);
600 break;
601 }
602 case NUMBER_CMD:
603 {
604 number n=(number)d;
605 n_Delete(&n,r->cf);
606 break;
607 }
608 case BIGINT_CMD:
609 {
610 number n=(number)d;
612 break;
613 }
614 case LIST_CMD:
615 {
616 lists l=(lists)d;
617 l->Clean(r);
618 break;
619 }
620 case LINK_CMD:
621 {
622 si_link l=(si_link)d;
623 slKill(l);
624 break;
625 }
626 case RING_CMD:
627 {
628 ring R=(ring)d;
629 if ((R!=currRing)||(R->ref>=0))
630 rKill(R);
631 #ifdef TEST
632 else
633 Print("currRing? ref=%d\n",R->ref);
634 #endif
635 break;
636 }
637 case RESOLUTION_CMD:
638 {
640 if (s!=NULL) syKillComputation(s,r);
641 break;
642 }
643 case COMMAND:
644 {
645 command cmd=(command)d;
646 if (cmd->arg1.rtyp!=0) cmd->arg1.CleanUp(r);
647 if (cmd->arg2.rtyp!=0) cmd->arg2.CleanUp(r);
648 if (cmd->arg3.rtyp!=0) cmd->arg3.CleanUp(r);
650 break;
651 }
652 case INT_CMD:
653 case DEF_CMD:
654 case ALIAS_CMD:
655 case PACKAGE_CMD:
656 case IDHDL:
657 case NONE:
658 case ANY_TYPE:
659 case VECHO:
660 case VPRINTLEVEL:
661 case VCOLMAX:
662 case VTIMER:
663 case VRTIMER:
664 case VOICE:
665 case VMAXDEG:
666 case VMAXMULT:
667 case TRACE:
668 case VSHORTOUT:
669 case VNOETHER:
670 case VMINPOLY:
671 case 0: /* type in error case */
672 break; /* error recovery: do nothing */
673 //case COMMAND:
674 //case COMMAND:
675 default:
676 {
677 if (t>MAX_TOK)
678 {
680 if (b!=NULL) b->blackbox_destroy(b,d);
681 break;
682 }
683 else
684 Warn("s_internalDelete: cannot delete type %s(%d)",
685 Tok2Cmdname(t),t);
686 }
687 }
688}
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
Definition blackbox.cc:17
int l
Definition cfEzgcd.cc:100
int m
Definition cfEzgcd.cc:128
int i
Definition cfEzgcd.cc:132
CanonicalForm cf
Definition cfModGcd.cc:4091
CanonicalForm b
Definition cfModGcd.cc:4111
CanonicalForm map(const CanonicalForm &primElem, const Variable &alpha, const CanonicalForm &F, const Variable &beta)
map from to such that is mapped onto
Matrices of numbers.
Definition bigintmat.h:51
Definition lists.h:24
@ n_GF
\GF{p^n < 2^16}
Definition coeffs.h:32
@ n_CF
?
Definition coeffs.h:48
@ n_long_C
complex floating point (GMP) numbers
Definition coeffs.h:41
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition coeffs.h:459
static FORCE_INLINE char * nCoeffName(const coeffs cf)
Definition coeffs.h:967
void nKillChar(coeffs r)
undo all initialisations
Definition numbers.cc:574
#define Print
Definition emacs.cc:80
const CanonicalForm int s
Definition facAbsFact.cc:51
const Variable & v
< [in] a sqrfree bivariate poly
Definition facBivar.h:39
const char * Tok2Cmdname(int tok)
Definition gentable.cc:140
@ IDEAL_CMD
Definition grammar.cc:285
@ MATRIX_CMD
Definition grammar.cc:287
@ BUCKET_CMD
Definition grammar.cc:284
@ BIGINTMAT_CMD
Definition grammar.cc:278
@ MAP_CMD
Definition grammar.cc:286
@ PROC_CMD
Definition grammar.cc:281
@ INTMAT_CMD
Definition grammar.cc:280
@ VMAXMULT
Definition grammar.cc:308
@ MODUL_CMD
Definition grammar.cc:288
@ VMAXDEG
Definition grammar.cc:307
@ SMATRIX_CMD
Definition grammar.cc:292
@ VECTOR_CMD
Definition grammar.cc:293
@ RESOLUTION_CMD
Definition grammar.cc:291
@ BIGINTVEC_CMD
Definition grammar.cc:279
@ NUMBER_CMD
Definition grammar.cc:289
@ POLY_CMD
Definition grammar.cc:290
@ VMINPOLY
Definition grammar.cc:310
@ RING_CMD
Definition grammar.cc:282
@ VNOETHER
Definition grammar.cc:309
VAR omBin sip_command_bin
Definition ipid.cc:45
BOOLEAN piKill(procinfov pi)
Definition ipid.cc:749
VAR coeffs coeffs_BIGINT
Definition ipid.cc:50
ip_command * command
Definition ipid.h:23
void rKill(ring r)
Definition ipshell.cc:6189
#define assume(x)
Definition mod2.h:387
slists * lists
The main handler for Singular numbers which are suitable for Singular polynomials.
static void p_Delete(poly *p, const ring r)
Definition p_polys.h:901
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
void sBucketDeleteAndDestroy(sBucket_pt *bucket_pt)
Definition sbuckets.cc:110
sBucket * sBucket_pt
Definition sbuckets.h:16
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
#define R
Definition sirandom.c:27
void syKillComputation(syStrategy syzstr, ring r=currRing)
Definition syz1.cc:1495
ssyStrategy * syStrategy
Definition syz.h:36
#define IDHDL
Definition tok.h:31
@ VCOLMAX
Definition tok.h:211
@ ALIAS_CMD
Definition tok.h:34
@ BIGINT_CMD
Definition tok.h:38
@ CRING_CMD
Definition tok.h:56
@ LIST_CMD
Definition tok.h:118
@ VSHORTOUT
Definition tok.h:216
@ VPRINTLEVEL
Definition tok.h:217
@ INTVEC_CMD
Definition tok.h:101
@ PACKAGE_CMD
Definition tok.h:150
@ CMATRIX_CMD
Definition tok.h:46
@ DEF_CMD
Definition tok.h:58
@ VECHO
Definition tok.h:210
@ CNUMBER_CMD
Definition tok.h:47
@ LINK_CMD
Definition tok.h:117
@ TRACE
Definition tok.h:214
@ STRING_CMD
Definition tok.h:187
@ VTIMER
Definition tok.h:212
@ VRTIMER
Definition tok.h:213
@ VOICE
Definition tok.h:215
@ CPOLY_CMD
Definition tok.h:48
@ INT_CMD
Definition tok.h:96
@ MAX_TOK
Definition tok.h:220
#define NONE
Definition tok.h:223
#define COMMAND
Definition tok.h:29
#define ANY_TYPE
Definition tok.h:30

◆ syMake()

void syMake ( leftv  v,
const char name,
package  pa = NULL 
)

Definition at line 1614 of file subexpr.cc.

1615{
1616 /* resolv an identifier: (to DEF_CMD, if siq>0)
1617 * 1) reserved id: done by scanner
1618 * 2) `basering` / 'Current`
1619 * 3) existing identifier, local
1620 * 4) ringvar, ringpar, local ring
1621 * 5) existing identifier, global
1622 * 6a) int/bigint
1623 * 6b) monom (resp. number), local ring: consisting of:
1624 * 6') ringvar, ringpar,global ring
1625 * 6'') monom (resp. number), local ring
1626 * 7) monom (resp. number), non-local ring
1627 * 8) basering
1628 * 9) `_`
1629 * 10) everything else is of type 0
1630 */
1631#ifdef TEST
1632 if ((*id<' ')||(*id>(char)126))
1633 {
1634 Print("wrong id :%s:\n",id);
1635 }
1636#endif
1638 v->Init();
1639 if(pa != NULL)
1640 {
1641 v->req_packhdl = pa;
1642 }
1643 else v->req_packhdl = currPack;
1644// if (v->req_packhdl!=basePack)
1645// Print("search %s in %s\n",id,v->req_packhdl->libname);
1646 idhdl h=NULL;
1647#ifdef SIQ
1648 if (siq<=0)
1649#endif
1650 {
1651 if (id[0]=='#')
1652 {
1653 h=ggetid(id);
1654 /* 3) existing identifier, local */
1655 if ((h!=NULL) && (IDLEV(h)==myynest))
1656 {
1657 if (id!=IDID(h)) omFreeBinAddr((ADDRESS)id); /*assume strlen(id) <1000 */
1658 goto id_found;
1659 }
1660 }
1661 else if ((id[0]!='-')&&(id[0]>='@' /* letters, _ */))
1662 {
1663 if (strcmp(id,"basering")==0)
1664 {
1665 if (currRingHdl!=NULL)
1666 {
1667 if (id!=IDID(currRingHdl)) omFreeBinAddr((ADDRESS)id);
1668 h=currRingHdl;
1669 goto id_found;
1670 }
1671 else
1672 {
1673 v->name = id;
1674 return; /* undefined */
1675 }
1676 }
1677 else if (strcmp(id,"Current")==0)
1678 {
1679 if (currPackHdl!=NULL)
1680 {
1682 h=currPackHdl;
1683 goto id_found;
1684 }
1685 else
1686 {
1687 v->name = id;
1688 return; /* undefined */
1689 }
1690 }
1691 if(v->req_packhdl!=currPack)
1692 {
1693 h=v->req_packhdl->idroot->get(id,myynest);
1694 }
1695 else
1696 {
1697 h=ggetid(id);
1698 }
1699 /* 3) existing identifier, local */
1700 if ((h!=NULL) && (IDLEV(h)==myynest))
1701 {
1702 if (id!=IDID(h)) omFreeBinAddr((ADDRESS)id); /*assume strlen(id) <1000 */
1703 goto id_found;
1704 }
1706 {
1708 }
1709 /* 4. local ring: ringvar */
1711 /*&& (!yyInRingConstruction)*/)
1712 {
1713 int vnr;
1714 if ((vnr=r_IsRingVar(id, currRing->names,currRing->N))>=0)
1715 {
1716 poly p=pOne();
1717 pSetExp(p,vnr+1,1);
1718 pSetm(p);
1719 v->data = (void *)p;
1720 v->name = id;
1721 v->rtyp = POLY_CMD;
1722 return;
1723 }
1724 if((n_NumberOfParameters(currRing->cf)>0)
1725 &&((vnr=r_IsRingVar(id, (char**)n_ParameterNames(currRing->cf),
1726 n_NumberOfParameters(currRing->cf))>=0)))
1727 {
1728 BOOLEAN ok=FALSE;
1729 poly p = pmInit(id,ok);
1730 if (ok && (p!=NULL))
1731 {
1732 v->data = pGetCoeff(p);
1733 pGetCoeff(p)=NULL;
1734 pLmFree(p);
1735 v->rtyp = NUMBER_CMD;
1736 v->name = id;
1737 return;
1738 }
1739 }
1740 }
1741 /* 5. existing identifier, global */
1742 if (h!=NULL)
1743 {
1744 if (id!=IDID(h)) omFreeBinAddr((ADDRESS)id); /*assume strlen(id) <1000 */
1745 goto id_found;
1746 }
1747 }
1748 else
1749 {
1750 /* 6a: int/bigint */
1751 int i=0;
1752 if (id[0]=='-') { i=1; }
1753 while(isdigit(id[i])) i++;
1754 if (id[i]=='\0')
1755 {
1756 int j=atoi(id);
1757 char tmp[MAX_INT_LEN+5];
1758 snprintf(tmp,MAX_INT_LEN+5,"%d",j);
1759 if (strcmp(tmp,id)!=0)
1760 {
1761 number n;
1762 n_Read(id,&n,coeffs_BIGINT);
1763 v->rtyp=BIGINT_CMD;
1764 v->data = n;
1765 }
1766 else
1767 {
1768 v->data=(void*)(long)j;
1769 v->rtyp=INT_CMD;
1770 }
1772 return;
1773 }
1774 }
1775 /* 6b local ring: number/poly */
1777 {
1778 BOOLEAN ok=FALSE;
1779 /*poly p = (!yyInRingConstruction) ? pmInit(id,ok) : (poly)NULL;*/
1780 poly p = pmInit(id,ok);
1781 if (ok)
1782 {
1783 if (p==NULL)
1784 {
1785 v->data = (void *)nInit(0);
1786 v->rtyp = NUMBER_CMD;
1787 #ifdef HAVE_PLURAL
1788 // in this case we may have monomials equal to 0 in p_Read
1789 v->name = id;
1790 #else
1792 #endif
1793 }
1794 else if (pIsConstant(p))
1795 {
1796 v->data = pGetCoeff(p);
1797 pGetCoeff(p)=NULL;
1798 pLmFree(p);
1799 v->rtyp = NUMBER_CMD;
1800 v->name = id;
1801 }
1802 else
1803 {
1804 v->name = id;
1805 #ifdef HAVE_SHIFTBBA
1806 if ((currRing->isLPring!=0)
1807 && (p_Totaldegree(p,currRing)>1))
1808 {
1810 /* v->rtyp = UNKNOWN; - already set */
1811 return; /* error, report "unknown id" */
1812 }
1813 #endif
1814 v->data = p;
1815 v->rtyp = POLY_CMD;
1816 }
1817 return;
1818 }
1819 }
1820 /* 7. non-local ring: number/poly */
1821 {
1822 BOOLEAN ok=FALSE;
1823 poly p = ((currRing!=NULL) /* ring required */
1824 && (currRingHdl!=NULL)
1825 /*&& (!yyInRingConstruction) - not in decl */
1826 && (IDLEV(currRingHdl)!=myynest)) /* already in case 4/6 */
1827 ? pmInit(id,ok) : (poly)NULL;
1828 if (ok)
1829 {
1830 if (p==NULL)
1831 {
1832 v->data = (void *)nInit(0);
1833 v->rtyp = NUMBER_CMD;
1835 }
1836 else
1837 if (pIsConstant(p))
1838 {
1839 v->data = pGetCoeff(p);
1840 pGetCoeff(p)=NULL;
1841 pLmFree(p);
1842 v->rtyp = NUMBER_CMD;
1843 v->name = id;
1844 }
1845 else
1846 {
1847 v->data = p;
1848 v->rtyp = POLY_CMD;
1849 v->name = id;
1850 }
1851 //if (TEST_V_ALLWARN /*&& (myynest>0)*/
1852 //&& ((r_IsRingVar(id, currRing->names,currRing->N)>=0)
1853 // || ((n_NumberOfParameters(currRing->cf)>0)
1854 // &&(r_IsRingVar(id, (char**)n_ParameterNames(currRing->cf),
1855 // n_NumberOfParameters(currRing->cf))>=0))))
1856 //{
1857 //// WARNING: do not use ring variable names in procedures
1858 // Warn("use of variable >>%s<< in a procedure in line %s",id,my_yylinebuf);
1859 //}
1860 return;
1861 }
1862 }
1863 /* 8. basering ? */
1864 if ((myynest>1)&&(currRingHdl!=NULL))
1865 {
1866 if (strcmp(id,IDID(currRingHdl))==0)
1867 {
1868 if (IDID(currRingHdl)!=id) omFreeBinAddr((ADDRESS)id); /*assume strlen (id) <1000 */
1869 h=currRingHdl;
1870 goto id_found;
1871 }
1872 }
1873 if((v->req_packhdl!=basePack) && (v->req_packhdl==currPack))
1874 {
1875 h=basePack->idroot->get(id,myynest);
1876 if (h!=NULL)
1877 {
1878 if (id!=IDID(h)) omFreeBinAddr((ADDRESS)id); /*assume strlen(id) <1000 */
1879 v->req_packhdl=basePack;
1880 goto id_found;
1881 }
1882 }
1883 }
1884#ifdef SIQ
1885 else
1886 v->rtyp=DEF_CMD;
1887#endif
1888 /* 9: _ */
1889 if (strcmp(id,"_")==0)
1890 {
1892 v->Copy(&sLastPrinted);
1893 }
1894 else
1895 {
1896 /* 10: everything else */
1897 /* v->rtyp = UNKNOWN;*/
1898 v->name = id;
1899 }
1901 return;
1902id_found: // we have an id (in h) found, to set the data in from h
1903 if (IDTYP(h)!=ALIAS_CMD)
1904 {
1905 v->rtyp = IDHDL;
1906 v->flag = IDFLAG(h);
1907 v->attribute=IDATTR(h);
1908 }
1909 else
1910 {
1911 v->rtyp = ALIAS_CMD;
1912 }
1913 v->name = IDID(h);
1914 v->data = (char *)h;
1916}
int BOOLEAN
Definition auxiliary.h:87
char name() const
Definition variable.cc:122
Definition idrec.h:35
static FORCE_INLINE char const ** n_ParameterNames(const coeffs r)
Returns a (const!) pointer to (const char*) names of parameters.
Definition coeffs.h:782
static FORCE_INLINE int n_NumberOfParameters(const coeffs r)
Returns the number of parameters.
Definition coeffs.h:778
static FORCE_INLINE const char * n_Read(const char *s, number *a, const coeffs r)
!!! Recommendation: This method is too cryptic to be part of the user- !!! interface....
Definition coeffs.h:602
static BOOLEAN pa(leftv res, leftv args)
Definition cohomo.cc:3770
int j
Definition facHensel.cc:110
VAR int myynest
Definition febase.cc:41
BOOLEAN yyInRingConstruction
Definition grammar.cc:172
idhdl ggetid(const char *n)
Definition ipid.cc:583
VAR package basePack
Definition ipid.cc:58
VAR idhdl currRingHdl
Definition ipid.cc:59
VAR package currPack
Definition ipid.cc:57
VAR idhdl currPackHdl
Definition ipid.cc:55
#define IDFLAG(a)
Definition ipid.h:120
#define IDID(a)
Definition ipid.h:122
#define IDLEV(a)
Definition ipid.h:121
#define IDTYP(a)
Definition ipid.h:119
#define IDATTR(a)
Definition ipid.h:123
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
Definition monomials.h:44
const int MAX_INT_LEN
Definition mylimits.h:13
#define nInit(i)
Definition numbers.h:24
static void p_LmDelete(poly p, const ring r)
Definition p_polys.h:723
static long p_Totaldegree(poly p, const ring r)
Definition p_polys.h:1507
#define pSetm(p)
Definition polys.h:271
#define pIsConstant(p)
like above, except that Comp must be 0
Definition polys.h:238
#define pmInit(a, b)
Definition polys.h:289
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced
Definition polys.h:70
#define pSetExp(p, i, v)
Definition polys.h:42
#define pOne()
Definition polys.h:315
int r_IsRingVar(const char *n, char **names, int N)
Definition ring.cc:213
INST_VAR sleftv sLastPrinted
Definition subexpr.cc:46
VAR BOOLEAN siq
Definition subexpr.cc:48

◆ syMakeMonom()

void syMakeMonom ( leftv  v,
const char name 
)

Definition at line 1918 of file subexpr.cc.

1919{
1920 if (!isdigit(id[0]))
1921 {
1922 Print("non-digit:%s\n",id);
1923 }
1924 /* resolv an identifier: (to DEF_CMD, if siq>0)
1925 * 6) monom (resp. number), local ring
1926 * 7) monom (resp. number), non-local ring
1927 * 10) everything else is of type 0
1928 */
1929#ifdef TEST
1930 if ((*id<' ')||(*id>(char)126))
1931 {
1932 Print("wrong id :%s:\n",id);
1933 }
1934#endif
1936 v->Init();
1937 v->req_packhdl = currPack;
1938#ifdef SIQ
1939 if (siq<=0)
1940#endif
1941 {
1942 /* 6. local ring: number/poly */
1943 BOOLEAN ok=FALSE;
1944 poly p = pmInit(id,ok);
1945 if (ok)
1946 {
1947 if (p==NULL)
1948 {
1949 v->data = (void *)nInit(0);
1950 v->rtyp = NUMBER_CMD;
1951 #ifdef HAVE_PLURAL
1952 // in this case we may have monomials equal to 0 in p_Read
1953 if (rIsPluralRing(currRing)) v->name = omStrDup(id);
1954 #endif
1955 }
1956 else if (pIsConstant(p))
1957 {
1958 v->data = pGetCoeff(p);
1959 pGetCoeff(p)=NULL;
1960 pLmFree(p);
1961 v->rtyp = NUMBER_CMD;
1962 }
1963 else
1964 {
1965 v->name = omStrDup(id);
1966 #ifdef HAVE_SHIFTBBA
1967 if ((currRing->isLPring!=0)
1968 && (p_Totaldegree(p,currRing)>1))
1969 {
1971 /* v->rtyp = UNKNOWN; - already set */
1972 return; /* error, report "unknown id" */
1973 }
1974 #endif
1975 v->data = p;
1976 v->rtyp = POLY_CMD;
1977 }
1978 return;
1979 }
1980 }
1981#ifdef SIQ
1982 else
1983 {
1984 v->rtyp=DEF_CMD;
1985 }
1986#endif
1987 /* 9: _ */
1988 if (strcmp(id,"_")==0)
1989 {
1990 v->Copy(&sLastPrinted);
1991 }
1992 else
1993 {
1994 /* 10: everything else */
1995 /* v->rtyp = UNKNOWN;*/
1996 v->name = omStrDup(id);
1997 }
1999}
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition ring.h:405

Variable Documentation

◆ libstack_bin

EXTERN_VAR omBin libstack_bin

Definition at line 176 of file subexpr.h.

◆ procinfo_bin

EXTERN_VAR omBin procinfo_bin

Definition at line 175 of file subexpr.h.

◆ siq

Definition at line 76 of file subexpr.h.

◆ sLastPrinted

EXTERN_INST_VAR sleftv sLastPrinted

Definition at line 143 of file subexpr.h.

◆ sSubexpr_bin

EXTERN_VAR omBin sSubexpr_bin

Definition at line 174 of file subexpr.h.