Advertisement
Manhydra

alcohol.h

Jul 15th, 2014
473
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.23 KB | None | 0 0
  1. /*
  2.  * The ALCOHOL Programming Language
  3.  * alcohol.h
  4.  *
  5.  * Copyright 2014 Marc Sylvestre <marc.sylvestre@manhydra.com>
  6.  *
  7.  * This program is free software; you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License as published by
  9.  * the Free Software Foundation; either version 3 of the License, or
  10.  * (at your option) any later version.
  11.  *
  12.  * This program is distributed in the hope that it will be useful,
  13.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  * GNU General Public License for more details.
  16.  *
  17.  * You should have received a copy of the GNU General Public License
  18.  * along with this program; if not, see <http://www.gnu.org/licenses/>,
  19.  * or if prefer good old fashion postal mail, write to the Free Software
  20.  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  21.  * MA 02110-1301, USA.
  22.  */
  23.  
  24. #define INTEGER int
  25. #define CHARACTER char
  26. #define HEAP *
  27. #define STRING CHARACTER*
  28. #define ARRAYSTR STRING*
  29. #define FLOAT float
  30. #define DOUBLE double
  31. #define GENERIC void
  32. #define FILEDEF static
  33. #define SET(a,b) a = b
  34. #define INITSET(a,b,c) a b = c
  35. #define HEAP_LOCATION(a) &a
  36. #define EQUALS ==
  37. #define IS_GT >
  38. #define IS_GT_EQ >=
  39. #define IS_LT <
  40. #define IS_LT_EQ <=
  41. #define NOT !
  42. #define IS_NOT !=
  43. #define BEGIN_ARGS (
  44. #define END_ARGS )
  45. #define NO_ARG BEGIN_ARGS END_ARGS
  46. #define BEGIN_ROUTINE {
  47. #define END_ROUTINE }
  48. #define BEGIN_PROG INTEGER main BEGIN_ARGS INTEGER argc, ARRAYSTR argv END_ARGS BEGIN_ROUTINE
  49. #define RET return
  50. #define END_PROG RET 0; END_ROUTINE
  51. #define TEST(condition) if BEGIN_ARGS condition END_ARGS BEGIN_ROUTINE
  52. #define OTHERWISE END_ROUTINE else BEGIN_ROUTINE
  53. #define END_TEST END_ROUTINE
  54. #define ELSIF(condition) END_ROUTINE else TEST(condition)
  55. #define ITERATE(condition) while BEGIN_ARGS condition END_ARGS BEGIN_ROUTINE
  56. #define END_ITERATE END_ROUTINE
  57. #define TEST_CASES(condition) switch BEGIN_ARGS condition END_ARGS BEGIN_ROUTINE
  58. #define END_TEST_CASES END_ROUTINE
  59. #define CASE(value) case value:
  60. #define CASE_DEFAULT default:
  61. #define END_CASE break;
  62. #define INPUT scanf
  63. #define INPUT_CHARACTER(x) x = getchar()
  64. #define OUTPUT printf
  65. #define OUTPUTL puts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement