Category : C Source Code
Archive   : TURBOSED.ZIP
Filename : CTRANS

 
Output of file : CTRANS contained in archive : TURBOSED.ZIP
# First, change over comment delimiters
/{/s//\/* /g
/}/s// *\//g
# Then the block start and end
/begin/s//{/g
/end/s//}/g
# Stash away assignment ops and the relationals with = in them
/:=/s//::/g
/>=/s//>:/g
/<=/s//<:/g
# Remaining Pascal = are C ==
/=/s//==/g
# Now convert to C assignment syntax and restore relationals
/::/s//=/g
/>:/s//>=/g
/<:/s//<=/g
# Now convert Pascal's not-equal
/<>/s//!=/g
# Eliminate unused thens
/ then/s///g
# Convert to C logical operators
/ or /s// || /g
/ and /s// && /g
# Convert modulo operator
/ mod /s// % /g
# Now convert procedure syntax
/procedure/s/);$/)/
/procedure/s//void/
# So C won't think it's a declare
/function/s/function \(.*\): *\(.*\);/function \2 \1/
/function/s/: [a-zA-Z0-9]+//
/function +/s///
# First hack at changing strings
/'/s//"/g
# Turn space pairs to tabs
/^ /s/ / /g
# Change standard types
/integer/s//int/g
/integer/s//bool/g
/cycle/s//continue/g


  3 Responses to “Category : C Source Code
Archive   : TURBOSED.ZIP
Filename : CTRANS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/