aboutsummaryrefslogtreecommitdiffstats
path: root/include/modulaf
blob: 2f1221ddc76a28ccfe38afb1dd3302df8f4d2f75 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137

###############################################################################
#                                                                             #
#  Lout @Modula package for formatting Modula-2 programs (Version 1.0)        #
#                                                                             #
#  Version 1.0 by Jeffrey H. Kingston, September 1993.                        #
#                                                                             #
#  This package implements the complete Modula-2 language (in a style which   #
#  claims only to reflect its author's taste) with the following caveats:     #
#                                                                             #
#  * The symbol { must be given as lbrace                                     #
#                                                                             #
#  * The symbol } must be given as rbrace                                     #
#                                                                             #
#  * The symbol # must be given as numbersign                                 #
#                                                                             #
#  * Double quotes are used by Lout to delimit literal strings, so they       #
#    need to be quoted (Modula-2 allows single quoted strings wherever        #
#    double quoted strings can go; we recommend these be used)                #
#                                                                             #
#  * Literal strings should be enclosed in double quotes                      #
#                                                                             #
#  * The symbols B, H, C, and E as used in numeric literals will appear       #
#    in italic font                                                           #
#                                                                             #
###############################################################################

export	"0" "1" "2" "3" "4" "5" "6" "7" "8" "9"

	"*" "/" "~" "+" "-" "=" "<>" ">" ">=" "<" "<=" "("
	")" "[" "]" "," ";" "." ":" "..." ".." "|" "^" ":=" "'" "`"
	"&"

	lbrace rbrace numbersign

	AND ARRAY BEGIN BY CASE CONST DEFINITION DIV DO ELSE ELSIF
	END EXPORT EXIT FOR FROM IF IMPLEMENTATION IMPORT IN LOOP
	MOD MODULE NOT OF OR POINTER PROCEDURE QUALIFIED RECORD
	REPEAT RETURN SET TO THEN TYPE UNTIL VAR WHILE WITH @Com

def @Modula
   body @Body
@Begin

    def @R right x { Base @Font x }
    def @B right x { Bold @Font x }
    def @S right x { { Symbol Base } @Font x }

    def "0"	{ @R "0"			}
    def "1"	{ @R "1"			}
    def "2"	{ @R "2"			}
    def "3"	{ @R "3"			}
    def "4"	{ @R "4"			}
    def "5"	{ @R "5"			}
    def "6"	{ @R "6"			}
    def "7"	{ @R "7"			}
    def "8"	{ @R "8"			}
    def "9"	{ @R "9"			}

    def "*"	{ @S @Char "asteriskmath"	}
    def "/"	{ @R @Char "fraction"		}
    def "~"	{ @R "~"			}
    def "+"	{ @S "+"			}
    def "-"	{ @S "-"			}
    def "="	{ @S @Char "equal"		}
    def "<>"	{ @S @Char "notequal"		}
    def ">"	{ @S @Char "greater"		}
    def ">="	{ @S @Char "greaterequal"	}
    def "<"	{ @S @Char "less"		}
    def "<="	{ @S @Char "lessequal"		}
    def "("	{ @R "("			}
    def ")"	{ @R ")"			}
    def "["	{ @R "["			}
    def "]"	{ @R "]"			}
    def ","	{ @R ","			}
    def ";"	{ @R ";"			}
    def "."	{ @R "."			}
    def ":"	{ @R ":"			}
    def ".."	{ @R ".." &0.1f			}
    def "..."	{ @R "..." 			}
    def "|"	{ @R "|"			}
    def "^"	{ @S 0.8f @Font @Char "arrowup"	}
    def ":="	{ :{//0.03fo =}			}
    def "'"	{ @R "'"			}
    def "`"	{ @R "`"			}
    def "&"	{ @R "&"			}

    def lbrace		{ @R "{"		}
    def rbrace		{ @R "}"		}
    def numbersign	{ @R "#"		}

    def AND		{ @B "and"		}
    def ARRAY		{ @B "array"		}
    def BEGIN		{ @B "begin"		}
    def BY		{ @B "by"		}
    def CASE		{ @B "case"		}
    def CONST		{ @B "const"		}
    def DEFINITION	{ @B "definition"	}
    def DIV		{ @B "div"		}
    def DO		{ @B "do"		}
    def ELSE		{ @B "else"		}
    def ELSIF		{ @B "elsif"		}
    def END		{ @B "end"		}
    def EXPORT		{ @B "export"		}
    def EXIT		{ @B "exit"		}
    def FOR		{ @B "for"		}
    def FROM		{ @B "from"		}
    def IF		{ @B "if"		}
    def IMPLEMENTATION	{ @B "implementation"	}
    def IMPORT		{ @B "import"		}
    def IN		{ @B "in"		}
    def LOOP		{ @B "loop"		}
    def MOD		{ @B "mod"		}
    def MODULE		{ @B "module"		}
    def NOT		{ @B "not"		}
    def OF		{ @B "of"		}
    def OR		{ @B "or"		}
    def POINTER		{ @B "pointer"		}
    def PROCEDURE	{ @B "procedure"	}
    def QUALIFIED	{ @B "qualified"	}
    def RECORD		{ @B "record"		}
    def REPEAT		{ @B "repeat"		}
    def RETURN		{ @B "return"		}
    def SET		{ @B "set"		}
    def TO		{ @B "to"		}
    def THEN		{ @B "then"		}
    def TYPE		{ @B "type"		}
    def UNTIL		{ @B "until"		}
    def VAR		{ @B "var"		}
    def WHILE		{ @B "while"		}
    def WITH		{ @B "with"		}

    def @Com right x	{ @R "{" x @R "}"	}

   Slope @Font lines @Break @Body

@End @Modula