-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblazon.lark
275 lines (241 loc) · 12.4 KB
/
blazon.lark
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
start: arms
arms: field "," _charge_group
| field _charge_group
| _charge_group
| field
field.4: tincture | lines
_charge_group: _charge_group AND _charge_group
| _charge_group relation subgroup
| relation charge charge
| relation charge AND charge
| _charge_group "," relation subgroup
| charge
!relation: "Between"i | "Surmounted by"i | "Each with"i | AND "Over all"i | "in"i | "on"i
| "Each charged with"i | "charged with"i | "charged of"i | "charged each of" | "with"i | "all"i | "Quartering"i | "Holding"i
charge: num? attitude* _charge_focus "s"? attitude*
| num? attitude* _charge_focus "s"? attitude? ","? arrangement
| _charge_focus
subgroup: _charge_group
// This comes up for liness / lines
ordinary_charge: num? attitude* ordinary "s"? attitude*
tincture: METAL| COLOUR | STAIN | fur | variation
| "Counterchanged"i // Split over a differently colored field with color contrasting to each side
METAL: "Or"i // Gooooold
| "Argent"i // Silver or White
COLOUR: "Azure"i // Blue
| "Gules"i // Red
| "Purpure"i // Purple
| "Sable"i // Black
| "Vert"i // Green
| "Proper"i // The color a charge ought to be, from nature
STAIN: "Sanguine"i | "Murrey"i // Dark Red
| "Tenné"i | "Tenny"i // Tan/orange
fur: ERMINE | vair | fur tincture AND tincture | tincture INFIX_FUR tincture
| tincture fur // In this case (Azure cruisly fitchy) the second tincture is specificed later.
ERMINE: "Ermine"i // Stoat Fur design (black and white spots). 4 variations
| "Ermines"i
| "Erminois"i
| "Pean"i
vair: "Vairy"i | "Vair"i // Blue and White alternating bell-shaped pattern
| "Plumeté"i | "Plumetty"i // Feather shapes alternating
| "Papelonné"i | "Papellony"i // Fan/scale shapes alternating
| "Potent"i // Tetris T's alternating
| "Kürsch"i // Fuzzy squirrel bellies (I am not making this up)
| "Crusily"i CROSS_ATTITUDE*
| "Billetty"i | "Bezanty"i // Covered with crosses, billets or cicles
INFIX_FUR: "Ermined"i
// Variations of the field provide a patterned background. Usually two colors
variation: multipattern tincture AND tincture | tincture multipattern tincture? | multipattern
quarter: num (AND num)? "quarter"i arms ";"? COMMENT? ","?
| num (AND num)? arms ";"? COMMENT? ","?
lines: "Quarterly"i ["of"i num] ":" quarter+
| "Quarterly"i ","? quarter+
| "Quarterly"? "Per"i ordinary_charge [tincture AND tincture]
| arms ", on a"i ordinary_charge arms
| "on a"i ordinary_charge arms
| arms "all"? "in" ordinary_charge
| arms ("and in" | ", in" | "within") ordinary_charge arms
| arms "," ordinary_charge
| arms "Impaling"i arms
multipattern: PATTERN "of" num [ tincture AND tincture]
| PATTERN
| PATTERN tincture
| PATTERN ordinary_attitude
| tincture "Semy"i "of" charge // repeating background image, like a myspace page
PATTERN.3: "Barry"i // Horizontal stripes. .3 to avoid conflict Bendy/Bend conflict
| "Paly"i // Vertical stripes
| "Bendy"i // Diagonal stripes
| "Chequy"i // Checkerboard pattern
| "Checky"i // Checkerboard pattern
| "Lozengy"i // Variations on diagonal checkerboard pattern
| "Fusilly"i // Variations on diagonal checkerboard pattern
| "Masculy"i // Variations on diagonal checkerboard pattern
| "Rustré"i // Variations on diagonal checkerboard pattern
| "Gyronny"i // Cool wedge pattern
| "Quarterly"i // Divided into 4
| "Fretty"i // Chain-grid design
| "Billetty"i // Covered in Billets
| "flory-counter-flory"i
| "Flory"i | "Counterflory"i // Outlined with fleurs pointing in/out
_charge_focus: OBJECT_ATTITUDE? object | animal | ordinary | ordinary "of" charge
//| referenced_name
animal.3 : HUMAN | BEAST | BIRD | REPTILE | FISH| animal "'s"? "s'"? "face" | animal "'s"? "s'"? "head"
HUMAN: "Man"i | "Men"i | "Old Man"i
| "Moor"i | "Blackamoor"i // pretty racist but they did fight these guys
BEAST: "Lion"i | "Wolf"i | "Wolves"i | "Leopard"i | "Bear"i
| "Bull"i | "Calf"i | "Calves"i
| "Buck"i | "Stag"i
| "Dog"i | "Cat"i | "Greyhound"i | "Talbot"i
| "Ram"i | "Boar"i | "Goat"i | "Mule"i | "Pig"i | "Bacon Pig"i | "Squirrel"i
| "Unicorn"i | "Griffin"i
BIRD: "Eagle"i | "Martlet"i | "Swan"i | "Raven"i | "Falcon"i | "Popinjay"i | "Cock"i | "Peacock"i | "Bird"i
| "Owl"i | "Hawk"i | "Stork"i | "Dove"i | "Pelican"i | "Moorcock"i | "Crow"i
REPTILE: "Serpent"i | "Firedrake"i | "Salamander"i | "Wyvern"i
FISH: "Herring"i | "Dolphin"i | "Whale"i
| "Barbel"i // this is a fish with a mustache
!attitude.3: "Rampant"i // Standing on it's hind legs!
| "Passant"i // Walking, one upraised arm
| "Couchant"i // Sitting like a sphinx
| "Gardant"i | "Guardant"i // With head facing the viewer
| "Regardant"i | "Reguardant"i // With head facing behind itself
| "Coward"i // Tail between legs
| "Running"i
| "Sejant"i // Seated
| "Salient"i // Leaping
| "Dormant"i // Sleeping
| "Demi-"i // only the front half of an animal
| "Muzzled"i
| "Combatant"i // Facing eachother
| "Addorsed"i // Facing away from eachother
| "Tripping"i | "Leaping"i | "Swimming"i
| "Volant"i // soaring
| "Double-headed"i // two headed! coool
| "Erect"i
| "Reversed"i // Upside down, like python logo
| "Inverted"i // Upside down, seems to also be used
| "jessant De Lys"i // with a Fleur de Lys issuing out of it
| "Hauriant"i // facing up!
| "Naiant"i // swimming
| "Nowed"i // snake twisted to form a knot
| "Embowed"i // bent, like an arm or a dolphin
| "Displayed"i
| "Pairs of"i
| "for difference"i // essentially a note that this feature distinguishes it from related crests
| attitude attitude+
| attitude AND attitude
| DIRECTION
| accessory tincture?
| general_attitude
!accessory: "Crowned"i | "Collared"i | "Chained"i
| "Erased"i // Torn off, like demi but ragged
| "Hilted"i | "Pommelled"i
| "Triple-towered"i | "Domed"i | "Triple-turreted"i // for buidlings
| "Tounges"i
| "Claws"i
| "armed"i
| "langued"i
| "stringed"i
| "Eyes"i
| "Attired"i // different colored antlers
| accessory AND accessory
// attiudes that could apply to any charge
general_attitude: tincture
| "Couped"i // cut off
ordinary_attitude: "Engrailed"i // Semicircules taken out
| "Indented"i // Triangles taken out
| "Embattled"i // Squares taken out (like battlements)
| "Dancetty"i // Triangles taken out
| "Raguly"i // Tapezoids taken out
| "Undy"i | "Wavy"i | "Nebuly"i // wavey
| "Urdy"i
| general_attitude
ORDINARY_PREFIX: "Voided"i
ordinary.2: (HONOURABLE_ORDINARY | SUBORDINARY | diminutive) "s"? DIRECTION?
| (HONOURABLE_ORDINARY | SUBORDINARY | diminutive) "s"? ordinary_attitude?
| ORDINARY_PREFIX (HONOURABLE_ORDINARY | SUBORDINARY | diminutive) "s"?
HONOURABLE_ORDINARY: "Bend"i // Diagonal Stripe
| "Chevron"i | "Cheveron"i // Check mark
| "Chief"i // Stripe on top
| "Fesse"i | "Fess"i // Horizontal Stripe
| "Pale"i // Vertical Stripe
| "Saltire"i // Giant X
| "Cross"i // Cross
| "Base"i // On bottom. Not technically an ordinary but used for division
SUBORDINARY: "Pall"i
| "Pile"i
| "Pile reversed"i
| "Quarter"i
| "Canton "i // This is a square on the upper left that can have a recursive coat
| "Bordure"i | "Border"i
| "Orle"i
| "Bars"i
| "Fret"i
| "Flaunches"i
| "Label"i
| "Gyron"i
| "Tressure"i
| "Gore"i // Looks like a flipping page
| "Dance"i // Wavey line
| "Lozenge"i | "Fusil"i | "Mascle"i // variations on diamonds
| "Roundel"i | "Annulet"i | "Bezant"i | "Hurt"i // ball or circle - variants denote color variations
| "Billet"i // verticle rectangle
diminutive: "Pallet"i
| "Cotised"i | "Cotised"i| "Bendlet"i | "Riband"i | "Ribbon"i | "Scarp"i // Different small bends
| "Latin cross"i | "Processional Cross"i
| "Cross"i CROSS_ATTITUDE* | "Crosses"i CROSS_ATTITUDE*
CROSS_ATTITUDE.3: "Trefly"i | "Crosslet"i | "of Crosslets"i
| "Flory"i | "Fitchy"i | "Formy"i | "Potent"i | "Paty"i// these guys love crosses
DIRECTION: "sinister"i | "dexter"i | "Upper"i | "Lower"i
object.2: SHAPE | BUILDING | GEOGRAPHY | PLANT | OBJECT | KNOT "Knot"i
SHAPE: "Escarbuncle"i // radiating star shape
| "Fasces"i // bound rods, mayoral symbol. Root of "Fascism"
| "Key"i // Skeleton Key - represents St. Peter and the Church
| "Crescent"i | "Cres-cent"i
| "Spearhead"i | "Cushion"i
| "Estoiles"i | "Estoil"i // Wiggly 6 pointed star
| "Mullet"i | "Star"i // 5 and 6 pointed stars
| "Canton"i // Square in upper left that says you are special
| "Another"i // Reference to a previous object
BUILDING: "Tower"i | "Castle"i | "Arch"i | "Arches"i
GEOGRAPHY: "Mount"i // Stylized Hill
PLANT: "Pomegranate"i | "Rose"i | "Thistle"i | "Acorn"i | "Oak Spring"i
| "Trefoil"i | "Quatrefoil"i | "Cinquefoil"i // 3 4 and 5 pointed flowers
| "Fleur-de-lis"i | "Fleurs-de-lys"i | "Fleurs-dely"i // French - Stylized Lily. Boy Scout Symbol
| "Fleur-de-lys"i
| "Garb"i // Sheaf of wheat
| "Holly Leaves"i | "Leaves"i
| "Lilies"i | "Lily"i
| "Hanks of Cotton"i
| "Oak sprig"i
| "Ears of Corn"i
OBJECT: "Crown"i | "Cronel"i
| "Escallop"i // Scallop Shell - represents the Santiago de Compostela pilgrimage
| "Bell"i | "Harp"i | "Trumpet"i | "Bugle-horns"i
| "Mallet"i | "Sword"i | "Battle-axes"i | "Pitchfork"i | "Gauntlet"i | "Helmet"i
| "Pair Of Wings"i | "Wings"i
| "Cup"i | "Pheon"i // Pheon is an arrowhead
| "Portcullis"i
| "Shin-bone"i | "Woolsacks"i
| "Knot"i | "Ostrich Feather"i | "Antler"i | "Wing"i // Animal parts!
| "Millrind"i | "Mill-rind"i | "Rind"i // the handle to turn a mill
| "Maunch"i // A woman's sleeve - like given as a favor at a tournament
| "Mitre"i // Bishop Stick
| "Chess-rook"i
| "Miners' picks"i
|"Quills Of Thread"i
|"Book"i // These often have letters - tod
| "Escutcheon"i | "Scutcheon"i // A shield - for recursive shielding
KNOT: "Bourchier"i | "Bowen"i | "Cavendish"i | "Dacre"i | "Harrington"i | "Hastings"i | "Heneage"i | "Hinckaert"i | "Hungerford"i | "Lacy"i | "Medici"i | "Morvillier"i | "Ormonde"i | "Savoy"i | "Shakespeare"i | "Stafford"i | "Trafford"i | "Tristram"i | "Wake"i
OBJECT_ATTITUDE: "Crossed"i | "Covered"i | "Impaling"i | "Pierced"i | "meeting in base"i | "Paleways"i
| "Open"i | "Closed"i | "Conjoined"i
AND.3: "And"i // The 2 indicates it's higher priority to avoid colision with "an"
//referenced_name.1: /[A-Z][a-zê]+/ // A reference to another coat of arms
// Ex "France impaling England"
arrangement: num AND num
| num ","? num AND num
| "set in cross"
!num: number| NUMBER_WORD | "first" | "second" | "third" | "fourth"
COMMENT: /\(([^)]+)\)/
%import .number (number, INT, NUMBER_WORD)
WHITESPACE: (" " | "\n")+
%ignore WHITESPACE