Lowercase BaCon
Priskribo de la ĉi-paĝa enhavo
Programo en BaCon por ebligi verki minuskle en BaCon.
BaCon estas tradukilo de BASIC en C, kaj kompilas la finan C-kodon. Ĝi estas bonega ilo, sed devigas tajpi BaCon -kodvortoj majuskle, kio tre malkomfortas al mi, aparte uzante modalan tekstredaktilon kiel Vim.
Graŭ malgranda ekzempla programo provizita per BaCon, mi sukcesis malkovri kiel majuskligi per la C-preprocezilo. Jen la rezulta programo. Por uzi ĝin, sufiĉas enmeti ĝin en nian programon per la C-ordono #include
(ne la BaCon -ordono include
) kaj traduki ĝin kun la ŝanĝilo «-j», kiu aktivigas la C-preprocezilon, ekzemple: bacon -j mia_programo.bac
.
Fontkodo
' lowercase_bacon.bac
' Lowercase BaCon
' This file provides the C preprocessor macros required to use
' lowercase keywords in BaCon (http://www.basic-converter.org).
' Written by Marcos Cruz (programandala.net)
' ##############################################################
' Usage:
' 1) Include this program into your program:
' #include "whatever/path/to/lowercase_bacon.bac"
' 2) Compile your program with the -j option:
' bacon -j your_program.bac
' ##############################################################
' History:
' 2012-09-03 First version, based on an a little example program
' found in the BaCon package. But how to use it?
' 2012-09-06 Found out how to use it: "#include"! Added some
' missing keywords: end, by, size, then, writing, reading,
' appending, readwrite, directory, network, server, memory, as,
' open, until, string, floating, number. number, #define,
' #include, bg, fg, black, red, green, yellow, magenta, blue,
' cyan, white, normal, intense, inverse, reset, compare, socket,
' memstream, memtype, collapse, international, startpoint, else.
' 2012-09-29 Added missing keywords: endsub, endfunction, endif,
' default, endselect, cursor, off, getx, gety.
' 2012-09-30 Removed wrong keyword: exit.
' 2012-10-01 Added missing keywords: elif, rem, do.
' 2012-10-03 Added missing keywords: whence, start, current,
' offset, from, file.
' 2012-11-03 Just discovered a similar file already existed at <http://www.basic-converter.org/lowercase.bac>. I compared both files and copied the missing keywords: assoc, base, broadcast, chunk, def, down, endwith, fn, format, int, is, isnot, memtell, m
ulticast, setenviron, udp, usec. Added also: tcp. Removed: long (one of the possible arguments of memtype).
' ##############################################################
#define abs ABS
#define address ADDRESS
#define alarm ALARM
#define alias ALIAS
#define and AND
#define appending APPENDING
#define argument$ ARGUMENT$
#define array ARRAY
#define as AS
#define asc ASC
#define assoc ASSOC
#define atn ATN
#define base BASE
#define bg BG
#define black BLACK
#define blue BLUE
#define break BREAK
#define broadcast BROADCAST
#define by BY
#define call CALL
#define case CASE
#define catch CATCH
#define changedir CHANGEDIR
#define chop$ CHOP$
#define chr$ CHR$
#define chunk CHUNK
#define clear CLEAR
#define close CLOSE
#define collapse COLLAPSE
#define color COLOR
#define columns COLUMNS
#define compare COMPARE
#define concat$ CONCAT$
#define const CONST
#define continue CONTINUE
#define copy COPY
#define cos COS
#define curdir$ CURDIR$
#define current CURRENT
#define cursor CURSOR
#define cyan CYAN
#define data DATA
#define day DAY
#define dec DEC
#define declare DECLARE
#define decr DECR
#define def DEF
#define default DEFAULT
#define delete DELETE
#define directory DIRECTORY
#define do DO
#define down DOWN
#define elif ELIF
#define else ELSE
#define end END
#define endfile ENDFILE
#define endfunction ENDFUNCTION
#define endif ENDIF
#define endselect ENDSELECT
#define endsub ENDSUB
#define endusec ENDUSEC
#define endwith ENDWITH
#define eq EQ
#define equal EQUAL
#define err$ ERR$
#define error ERROR
#define even EVEN
#define exec$ EXEC$
#define exp EXP
#define false FALSE
#define fg FG
#define file FILE
#define fileexists FILEEXISTS
#define filelen FILELEN
#define filetime FILETIME
#define filetype FILETYPE
#define fill$ FILL$
#define floating FLOATING
#define floor FLOOR
#define fn FN
#define for FOR
#define format FORMAT
#define fp FP
#define free FREE
#define from FROM
#define function FUNCTION
#define getbyte GETBYTE
#define getenviron$ GETENVIRON$
#define getfile GETFILE
#define getkey GETKEY
#define getline GETLINE
#define getx GETX
#define gety GETY
#define global GLOBAL
#define gosub GOSUB
#define goto GOTO
#define gotoxy GOTOXY
#define green GREEN
#define hex$ HEX$
#define host$ HOST$
#define hour HOUR
#define if IF
#define import IMPORT
#define include INCLUDE
#define incr INCR
#define input INPUT
#define instr INSTR
#define instrrev INSTRREV
#define intense INTENSE
#define international INTERNATIONAL
#define intl$ INTL$
#define inverse INVERSE
#define is IS
#define isfalse ISFALSE
#define isnot ISNOT
#define istrue ISTRUE
#define label LABEL
#define lcase$ LCASE$
#define left$ LEFT$
#define len LEN
#define let LET
#define local LOCAL
#define log LOG
#define lookup LOOKUP
#define magenta MAGENTA
#define makedir MAKEDIR
#define maxrandom MAXRANDOM
#define memory MEMORY
#define memrewind MEMREWIND
#define memstream MEMSTREAM
#define memtell MEMTELL
#define memtype MEMTYPE
#define mid$ MID$
#define minute MINUTE
#define mod MOD
#define month MONTH
#define month$ MONTH$
#define multicast MULTICAST
#define ne NE
#define network NETWORK
#define next NEXT
#define nl$ NL$
#define nntl$ NNTL$
#define normal NORMAL
#define not NOT
#define now NOW
#define number NUMBER
#define odd ODD
#define off OFF
#define offset OFFSET
#define on ON
#define open OPEN
#define option OPTION
#define or OR
#define os$ OS$
#define peek PEEK
#define pi PI
#define poke POKE
#define pow POW
#define print PRINT
#define proto PROTO
#define pull PULL
#define push PUSH
#define putbyte PUTBYTE
#define putline PUTLINE
#define random RANDOM
#define read READ
#define reading READING
#define readln READLN
#define readwrite READWRITE
#define receive RECEIVE
#define record RECORD
#define red RED
#define redim REDIM
#define regex REGEX
#define relate RELATE
#define rem REM
#define rename RENAME
#define repeat REPEAT
#define replace$ REPLACE$
#define reset RESET
#define resize RESIZE
#define restore RESTORE
#define resume RESUME
#define return RETURN
#define retval RETVAL
#define reverse$ REVERSE$
#define rewind REWIND
#define right$ RIGHT$
#define rnd RND
#define round ROUND
#define rows ROWS
#define search SEARCH
#define second SECOND
#define seed SEED
#define seek SEEK
#define select SELECT
#define send SEND
#define server SERVER
#define setenviron SETENVIRON
#define sgn SGN
#define sin SIN
#define size SIZE
#define sizeof SIZEOF
#define sleep SLEEP
#define socket SOCKET
#define sort SORT
#define spc$ SPC$
#define split SPLIT
#define sqr SQR
#define start START
#define startpoint STARTPOINT
#define step STEP
#define stop STOP
#define str$ STR$
#define string STRING
#define sub SUB
#define system SYSTEM
#define tab$ TAB$
#define tan TAN
#define tcp TCP
#define tell TELL
#define textdomain TEXTDOMAIN
#define then THEN
#define timevalue TIMEVALUE
#define to TO
#define trace TRACE
#define trap TRAP
#define true TRUE
#define type TYPE
#define ucase$ UCASE$
#define udp UDP
#define until UNTIL
#define usec USEC
#define val VAL
#define var VAR
#define version$ VERSION$
#define wait WAIT
#define week WEEK
#define weekday$ WEEKDAY$
#define wend WEND
#define whence WHENCE
#define while WHILE
#define white WHITE
#define with WITH
#define writeln WRITELN
#define writing WRITING
#define year YEAR
#define yellow YELLOW