aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorRuben Beltran del Rio <git@r.bdr.sh>2025-09-19 12:54:29 +0200
committerRuben Beltran del Rio <git@r.bdr.sh>2025-09-19 12:54:29 +0200
commit00ea2943c81d2b3a8531e8b7b591de3443b1250c (patch)
treed3fd1d87f52388a062e42ddbd49fb8dece2dc9df /doc
Initial commit
Diffstat (limited to 'doc')
-rw-r--r--doc/example.wmap122
-rw-r--r--doc/wmap-spec.ebnf52
2 files changed, 174 insertions, 0 deletions
diff --git a/doc/example.wmap b/doc/example.wmap
new file mode 100644
index 0000000..a238ab1
--- /dev/null
+++ b/doc/example.wmap
@@ -0,0 +1,122 @@
+Anchor (40, 0)
+Tinker (4,30) [x]
+Tailor (7.03, 49.21) [Square]
+Soldier (28, 15) [Triangle]
+AMnchor (28.22, 45.27)
+Tonker (67.3, 4.4) [X]
+Tailor1 (1,1) [Square]
+Tailor2 (10,1) [Square]
+Tailor3 (1,10) [Square]
+Tailor4 (20,1) [Square]
+Tailor5 (1,20) [Square]
+Tailor7 (20,10) [Square]
+Tailor8 (9.36, 16.97) [Square]
+Tailor777(30,10) [Square]
+Tailor10 (18.77, 26.25) [Square]
+Tailor11 (10,10) [Square]
+Tailor12 (30,20)
+Tailor13 (31.10, 28.89)
+Tailor14 (13.44, 21.48) [Square]
+Tailor19 (45, 2) [triangle]
+B (50, 50)
+Hellele
+
+TailorX (20, 50) [Square]
+
+Hello World (90, 20) [x]
+
+Anchor -> Soldier… this is changing.
+Anchor -> A
+Masdlajksd -- Tailor13
+
+Mabanchorn -- Anchornalsdjalks
+
+A
+--B
+
+X (58.52, 27.07)
+
+Tailor11--Tailor12
+Tailor12--Tailor13
+Tailor777--Tailor8
+Tailor777--Tailor7
+Tailor777--Tailor6
+Tailor7-Tailor6
+
+Tinker -- Tailor
+Soldier -- Tinker
+
+[Evolution] Tinker +20
+[Inertia] Soldier
+
+[i] 15
+[ii] 35
+[iii] 80
+
+this is kind of ok … a little bit better to be honest. (69.76, 89.84)
+
+OK.
+
+This map so far is fst. asdasd asda
+
+Holy shit, this is still indeed fast. But everything flashes as I type! This is now happening so fast
+
+Hello my old friend.
+
+OK so this map should eventually start getting slow too!
+
+let’s see how long after.asd asda sda
+
+asda sdasdasd asdasdasdasdasdasd
+OK… Well we are typing. asd as asd as dasd a asdasda sdasd asd
+
+ asd asd asd asdasd asdasd
+Alright, the whole text is still fa asdlashing. Wow. This is pretty bad.
+aas dasd adsa sd a asd asd asdjlkasjd laksdjasd basldjas!!!
+
+we have deleted this (20, 40) [triangle]
+
+a(12, 12)
+Time to see if we get the same performance loss as withthis the other one. Well I will continue. Hello this is me. and i’m
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+
+b(75,75)
+c(9, 90)
+
+a -- b
+b -- c
+
+d (45, 88)
+
+c -- d
+d -- a
+d -- b
+
+q (90, 60)
+b -- q
+q -- a
+q -- c
+
+[Evolution] c +20
+[Evolution] d +10
+[Evolution] a -20
+[Evolution] q +5
+
+m(50, 60)
+n (65, 65)
+o (45, 63)
+
+m -- o
+o -- n
+n -- m
+o -- c
+n -- q
+m -- d
+
+testasd asdas
+test2asdasa asdasd asd
+
+[Note] (5, 35) Notes also influence the placement of\n labels.
+
+[Group] Tailor2, Tailor7, Tailor11, Tailor12, Tailor10, Anchor, Tinker
+[Group] Tailor3, Tailor5, Tailor14pr \ No newline at end of file
diff --git a/doc/wmap-spec.ebnf b/doc/wmap-spec.ebnf
new file mode 100644
index 0000000..6ad79c6
--- /dev/null
+++ b/doc/wmap-spec.ebnf
@@ -0,0 +1,52 @@
+(* wmap Language Specification *)
+
+(* Top-level structure *)
+program = { line } ;
+line = ( entity line_ending ) | ( ignored_line line_ending ) | line_ending ;
+
+entity = component | dependency | note | stage | group | inertia | evolution ;
+ignored_line = ? any sequence of tokens that doesn't match entity grammar ? ;
+
+(* Entities *)
+component = component_label position [ shape ] ;
+dependency = component_label dependency_type component_label ;
+note = case_insensitive("[Note]") position text ;
+stage = "[" stage_number "]" real_number ;
+group = case_insensitive("[Group]") component_label { "," component_label } ;
+inertia = case_insensitive("[Inertia]") component_label ;
+evolution = case_insensitive("[Evolution]") component_label sign real_number ;
+
+(* Component definitions *)
+position = "(" real_number "," real_number ")" ;
+shape = "[" shape_label "]" ;
+dependency_type = "--" | "->" ;
+sign = "+" | "-" ;
+
+(* Terminal symbols *)
+component_label = preserved_case( { character - ( "-" | "+" | "," | "[" | "]" | "(" | ")" | line_ending ) } ) ;
+text = preserved_case( { character - line_ending } ) ;
+real_number = [ digit ] { digit } [ "." { digit } ] | "." digit { digit } ;
+stage_number = case_insensitive( "i" | "ii" | "iii" | "iv" ) ;
+shape_label = case_insensitive( "x" | "square" | "triangle" | "circle" ) ;
+
+(* Lexical elements *)
+character = ? any Unicode character ? ;
+digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ;
+line_ending = lf | crlf | cr ;
+lf = ? U+000A (Line Feed) ? ;
+cr = ? U+000D (Carriage Return) ? ;
+crlf = cr lf ;
+
+(* Lexical rules *)
+case_insensitive(x) = ? case-insensitive match of x ? ;
+preserved_case(x) = ? case-insensitive match of x, preserving original case for display ? ;
+
+(* Notes *)
+(* - Keywords and shape labels are case-insensitive *)
+(* - Component labels are case-insensitive for matching but preserve original case *)
+(* - Text content preserves original case *)
+(* - Whitespace (except line endings) may appear between any tokens *)
+(* - Each line contains exactly one entity *)
+(* - Invalid lines should be ignored *)
+(* - Line endings support Unix (LF), Windows (CRLF), and classic Mac (CR) formats *)
+(* - CRLF is treated as a single line ending, not separate CR and LF *)