home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / SED.ZIP / CTRANS next >
Text File  |  1986-05-02  |  1KB  |  41 lines

  1. # First, change over comment delimiters
  2.         /{/s//\/* /g
  3.         /}/s// *\//g
  4. # Then the block start and end
  5.         /begin/s//{/g
  6.         /end/s//}/g
  7. # Stash away assignment ops and the relationals with = in them
  8.         /:=/s//::/g
  9.         />=/s//>:/g
  10.         /<=/s//<:/g
  11. # Remaining Pascal = are C ==
  12.         /=/s//==/g
  13. # Now convert to C assignment syntax and restore relationals
  14.         /::/s//=/g
  15.         />:/s//>=/g
  16.         /<:/s//<=/g
  17. # Now convert Pascal's not-equal
  18.         /<>/s//!=/g
  19. # Eliminate unused thens
  20.         / then/s///g
  21. # Convert to C logical operators
  22.         / or /s// || /g
  23.         / and /s// && /g
  24. # Convert modulo operator
  25.         / mod /s// % /g
  26. # Now convert procedure syntax
  27.         /procedure/s/);$/)/
  28.         /procedure/s//void/
  29. # So C won't think it's a declare
  30.         /function/s/function \(.*\): *\(.*\);/function \2 \1/
  31.         /function/s/: [a-zA-Z0-9]+//
  32.         /function +/s///
  33. # First hack at changing strings
  34.         /'/s//"/g
  35. # Turn space pairs to tabs
  36.         /^  /s/  /      /g
  37. # Change standard types
  38.         /integer/s//int/g
  39.         /integer/s//bool/g
  40.         /cycle/s//continue/g
  41.