Changeset 5599d6e in rtems


Ignore:
Timestamp:
Feb 6, 1998, 1:48:44 PM (22 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
1e524995
Parents:
f02ffca
Message:

Added @table/@end table capability along with the avdas.d test case where
this capability was first used.

Location:
doc/tools/pdl2texi
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • doc/tools/pdl2texi/Makefile

    rf02ffca r5599d6e  
    7474        ./$(PROG) -v -p "Magic Subsystem" \
    7575            -u "Magic Subsystem" test_cases/avdas.d
     76        ./$(PROG) -w -v -p "Magic Subsystem" \
     77            -u "Magic Subsystem" test_cases/avdas.d
    7678       
    7779clean:
  • doc/tools/pdl2texi/main.c

    rf02ffca r5599d6e  
    172172  PDL,
    173173  SYNCHRONIZATION,
    174   TIMING
     174  TIMING,
     175
     176  RAW_EXAMPLE,                       /* our own */
     177 
    175178}  Keyword_indices_t;
    176179
     
    198201
    199202typedef enum {
     203  RT_NO_CHECK,      /* don't do this at all */
    200204  RT_FORBIDDEN,     /* no text to right allowed */
    201205  RT_OPTIONAL,      /* text to right optional -- none below */
     
    317321        HEADING,    RT_MAYBE_BELOW,   BL_RAW,    Validate_synchronization },
    318322  { "TIMING:",
    319         HEADING,    RT_REQUIRED,      BL_FORBIDDEN, NULL }
     323        HEADING,    RT_REQUIRED,      BL_FORBIDDEN, NULL },
     324  { "",
     325        TEXT,       RT_NO_CHECK,   BL_RAW,       NULL }
    320326};
    321327
     
    812818  boolean       is_bullet;
    813819  int           length;
     820  int           i;
    814821
    815822  length = 0;
     
    827834
    828835    for ( ; *src && isspace( *src ) ; src++ ); /* skip leading spaces */
     836
     837    if ( !strncmp( src, "@table", 6 ) ) {
     838
     839      to_add = DeleteLine( to_add );
     840      src = to_add->Contents;
     841      for ( i=4 ; *src && isspace( *src ) && i-- ; src++ );
     842         /* skip leading spaces */
     843
     844      for ( ; ; ) {
     845        if ( _Chain_Is_last( &to_add->Node ) ) {
     846          fprintf(
     847             stderr,
     848             "Missing end table for table starting at line %d\n",
     849             starting_line
     850           );
     851           exit_application( 1 );
     852        }
     853        if ( !strncmp( src, "@end table", 10 ) ) {
     854          to_add = DeleteLine( to_add ); 
     855          return to_add;
     856        }
     857        strcpy( Paragraph, src );
     858        strcpy( to_add->Contents, Paragraph );
     859        SetLineFormat( to_add, PARAGRAPH_OUTPUT );
     860        to_add->keyword = RAW_EXAMPLE;
     861        to_add = (Line_Control *) to_add->Node.next;
     862
     863        src = to_add->Contents;
     864        for ( i=4 ; *src && isspace( *src ) && i-- ; src++ );
     865           /* skip leading spaces */
     866
     867      }
     868    }
    829869
    830870    if ( *src == '+' ) {
     
    15211561char *Format_Errors[] = {
    15221562  /* unused */             "no formatting error",
     1563  /* RT_NO_CHECK      */   "why am I here",
    15231564  /* RT_FORBIDDEN     */   "no text allowed to right or below",
    15241565  /* RT_OPTIONAL      */   "text to right optional -- none below",
     
    15661607    key = &Keywords[ line->keyword ];
    15671608
    1568     if ( !line->keyword ) {
     1609    if ( !line->keyword || key->text_mode == RT_NO_CHECK ) {
    15691610      line = (Line_Control *) line->Node.next;
    15701611      continue;
     
    15981639
    15991640    switch ( key->text_mode ) {
     1641      case RT_NO_CHECK:  /* no requirements */
     1642        break;
     1643
    16001644      case RT_FORBIDDEN: /* no text to right or below allowed */
    16011645        if ( is_text_to_right || is_text_below ) {
     
    27372781        /* at this point line points to the next keyword */
    27382782        break;
     2783
     2784      case RAW_EXAMPLE:
     2785
     2786        /* now take care of the raw text which is here */
     2787
     2788        new_line = AllocateLine();
     2789        strcpy( new_line->Contents, "@example" );
     2790        _Chain_Insert( line->Node.previous, &new_line->Node );
     2791
     2792        while ( line->keyword == RAW_EXAMPLE ) {
     2793          line = (Line_Control *) line->Node.next;
     2794        }
     2795
     2796        new_line = AllocateLine();
     2797        strcpy( new_line->Contents, "@end example" );
     2798        _Chain_Insert( line->Node.previous, &new_line->Node );
     2799
     2800        /* at this point line points to the next keyword */
     2801        break;
     2802
    27392803    }   
    27402804  }
     
    29673031        /* at this point line points to the next keyword */
    29683032        break;
     3033
     3034      case RAW_EXAMPLE:
     3035
     3036        /* now take care of the raw text which is here */
     3037
     3038        new_line = AllocateLine();
     3039        _Chain_Insert( line->Node.previous, &new_line->Node );
     3040        strcpy( new_line->Contents, "@Example = " );
     3041
     3042
     3043        while ( line->keyword == RAW_EXAMPLE ) {
     3044          if ( strlen( line->Contents ) ) {
     3045            new_line->keyword = line->keyword;
     3046            new_line->format = line->format;
     3047            length = strlen(new_line->Contents);
     3048            if ( (length + strlen(line->Contents) + 12) > PARAGRAPH_SIZE ) {
     3049              fprintf( stderr, "Output line too long at %d\n", line->number );
     3050              exit_application( 1 );
     3051            }
     3052
     3053            strcat( new_line->Contents, line->Contents );
     3054            strcat( new_line->Contents, "<@ManualCR>" );
     3055            line = DeleteLine( line );
     3056          } else {
     3057            line = (Line_Control *) line->Node.next;
     3058            new_line = AllocateLine();
     3059            _Chain_Insert( line->Node.previous, &new_line->Node );
     3060            strcpy( new_line->Contents, "@Example = " );
     3061          }
     3062        }
     3063
     3064        /* at this point line points to the next keyword */
     3065        break;
     3066
    29693067    }   
    29703068  }
Note: See TracChangeset for help on using the changeset viewer.