Overview
Comment:Patches to allow the user to increase the buffer size of p2c.
(useful if very long lines occur when building with -c option (deprecated)).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 7e670f6594c71036f118cf668e0751c739242f6216c1a09f2d0c880e98cba5b5
User & Date: geraint@users.sourceforge.net on 2004-07-31 20:04:08
Other Links: branch diff | manifest | tags
Context
2004-07-31
22:51:55
Writes causality information to ibg.m. check-in: 5ae9f2bbec user: geraint@users.sourceforge.net tags: origin/master, trunk
20:04:08
Patches to allow the user to increase the buffer size of p2c.
(useful if very long lines occur when building with -c option (deprecated)).
check-in: 7e670f6594 user: geraint@users.sourceforge.net tags: origin/master, trunk
02:00:26
Started modifying to write ibg.m
- only writes component connection data so far.

Found a bug in abg.m generation (not fixed)
- anonymous components are not written to cmp.txt check-in: 560a17a325 user: geraint@users.sourceforge.net tags: origin/master, trunk

Changes

Added mttroot/patches/p2c/p2c-1.21alpha2/lex.c.diff version [7c654e3c9b].
































































1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
*** p2c-1.22/src/lex.c	Tue Mar 16 09:28:20 1999
--- p2c-1.22-dev/src/lex.c	Tue Jan 30 16:57:23 2001
*************** Static int skipflag;
*** 38,44 ****
  Static char modulenotation;
  Static short inputkind;
  Static Strlist *instrlist;
! Static char inbuf[300];
  Static char *oldinfname, *oldctxname;
  Static Strlist *endnotelist;
  
--- 38,44 ----
  Static char modulenotation;
  Static short inputkind;
  Static Strlist *instrlist;
! Static char *inbuf;
  Static char *oldinfname, *oldctxname;
  Static Strlist *endnotelist;
  
*************** void init_lex()
*** 411,416 ****
--- 411,417 ----
      inputkind = INP_FILE;
      inf_lnum = 0;
      inf_ltotal = 0;
+     inbuf = ALLOC(buffersize, char, strings); /* strings ? */
      *inbuf = 0;
      inbufptr = inbuf;
      keepingstrlist = NULL;
*************** void getline()
*** 1055,1061 ****
          case INP_INCFILE:
              inf_lnum++;
  	    inf_ltotal++;
!             if (fgets(inbuf, 300, inf)) {
                  cp = inbuf + strlen(inbuf);
                  if (*inbuf && cp[-1] == '\n')
                      cp[-1] = 0;
--- 1056,1062 ----
          case INP_INCFILE:
              inf_lnum++;
  	    inf_ltotal++;
!             if (fgets(inbuf, buffersize, inf)) {
                  cp = inbuf + strlen(inbuf);
                  if (*inbuf && cp[-1] == '\n')
                      cp[-1] = 0;
*************** int p2c_only, starparen;
*** 1889,1895 ****
      }
      if (!isalpha(*cp))
          return 0;
!     while ((isalnum(*cp) || *cp == '_') && cp2 < namebuf+300)
          *cp2++ = toupper(*cp++);
      if (cp[0] == '+' && cp[1] == '+' &&
  	cp == inbufptr+1 && toupper(cp[-1]) == 'C')
--- 1890,1896 ----
      }
      if (!isalpha(*cp))
          return 0;
!     while ((isalnum(*cp) || *cp == '_') && cp2 < namebuf+buffersize)
          *cp2++ = toupper(*cp++);
      if (cp[0] == '+' && cp[1] == '+' &&
  	cp == inbufptr+1 && toupper(cp[-1]) == 'C')

Added mttroot/patches/p2c/p2c-1.21alpha2/loc.p2crc version [73e4cd2acc].













1
2
3
4
5
6
7
8
9
10
11
12
+
+
+
+
+
+
+
+
+
+
+
+

# Store public p2crc commands local to your system here, so that
# you can grab a new version of sys.p2crc without losing your changes.

BufferSize=1000000.

LineWidth=1000000.
MaxLineWidth=1000000.

OverWidePenalty=0.
OverWideExtraPenalty=0.

Added mttroot/patches/p2c/p2c-1.21alpha2/parse.c.diff version [305c42d48a].




















1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
*** p2c-1.22/src/parse.c	Tue Mar 16 09:28:20 1999
--- p2c-1.22-dev/src/parse.c	Tue Jan 30 16:30:40 2001
*************** int p_search(fname, ext, need)
*** 5477,5483 ****
  char *fname, *ext;
  int need;
  {
!     char infnbuf[300];
      FILE *fp;
      Meaning *mod;
      int savesysprog, savecopysource;
--- 5477,5483 ----
  char *fname, *ext;
  int need;
  {
!     char infnbuf[buffersize];
      FILE *fp;
      Meaning *mod;
      int savesysprog, savecopysource;

Added mttroot/patches/p2c/p2c-1.21alpha2/sys.p2crc.diff version [189e9e035c].














1
2
3
4
5
6
7
8
9
10
11
12
13
+
+
+
+
+
+
+
+
+
+
+
+
+
*** p2c-1.22/src/sys.p2crc	Tue Mar 16 09:28:20 1999
--- p2c-1.22-dev/src/sys.p2crc	Tue Jan 30 17:01:14 2001
*************** MinSpacingThresh                # If spe
*** 455,460 ****
--- 455,462 ----
  
  # LINE BREAKING
  
+ BufferSize			# Maximum input line length; default=300.
+ 
  LineWidth                       # Target max output line width; default=78.
  
  MaxLineWidth                    # Absolute max output line width; default=90.

Added mttroot/patches/p2c/p2c-1.21alpha2/trans.h.diff version [e99f32563f].























1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
*** p2c-1.22/src/trans.h	Tue Mar 16 09:28:21 1999
--- p2c-1.22-dev/src/trans.h	Tue Jan 30 17:25:33 2001
*************** extern int sizeof_char, sizeof_short, si
*** 1133,1138 ****
--- 1133,1139 ----
  extern short size_t_long;
  extern int setbits, defaultsetsize, seek_base, integerwidth, realwidth;
  extern short quoteincludes, expandincludes, collectnest;
+ extern const int buffersize;
  extern int phystabsize, intabsize, linewidth, maxlinewidth;
  extern int majorspace, minorspace, declspace, functionspace, minfuncspace;
  extern int casespacing, caselimit;
*************** struct rcstruct {
*** 1351,1356 ****
--- 1352,1358 ----
      'I', 'R', "MINSPACINGTHRESH",(anyptr) &minspacingthresh, -1,
  
  /* LINE BREAKING */
+     'I', 'R', "BUFFERSIZE",	(anyptr) &buffersize,	300,
      'I', 'R', "LINEWIDTH",       (anyptr) &linewidth,        78,
      'I', 'R', "MAXLINEWIDTH",    (anyptr) &maxlinewidth,     90,
      'R', 'V', "OVERWIDEPENALTY",       (anyptr) &overwidepenalty,         2500,


MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]