From: adam Date: Sun, 27 May 2007 20:38:12 +0000 (-0400) Subject: remove more crud from test/ subdirectory X-Git-Url: http://git.megacz.com/?p=sbp.git;a=commitdiff_plain;h=3094f58635dc32e4f0ba3922a0ce2f13267ea06e;hp=5eea0a7ad35fb17a5b7203fa40119ad5cab01ec0 remove more crud from test/ subdirectory darcs-hash:20070527203812-5007d-8822b0600eff063f9d89debde1070d0035b66128.gz --- diff --git a/tests/ArchSimA3.jar b/tests/ArchSimA3.jar deleted file mode 100644 index 96f120a..0000000 Binary files a/tests/ArchSimA3.jar and /dev/null differ diff --git a/tests/ArchSimModel.dtd b/tests/ArchSimModel.dtd deleted file mode 100644 index 31a71d8..0000000 --- a/tests/ArchSimModel.dtd +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/ComponentList.dtd b/tests/ComponentList.dtd deleted file mode 100644 index d480fe1..0000000 --- a/tests/ComponentList.dtd +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/OperationList.dtd b/tests/OperationList.dtd deleted file mode 100644 index 6b69174..0000000 --- a/tests/OperationList.dtd +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/SimpleFleet.xml b/tests/SimpleFleet.xml deleted file mode 100644 index e45a469..0000000 --- a/tests/SimpleFleet.xml +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/archscript.g b/tests/archscript.g deleted file mode 100644 index 5e36d45..0000000 --- a/tests/archscript.g +++ /dev/null @@ -1,45 +0,0 @@ -// A grammar for assembling archsim networks - -s = !ws (Statement +/ ws) !ws - -Statement = Import | Instance | Settings | Operations - -Settings = "settings" (Setting+/newline) /newline -Setting = Name ^"=" quoted /ws - -Import = ^"import" JavaClassName "as" Type /ws -JavaClassName = Name +/ "." - -Instance = ^"component" !ws ComponentName !ws ":" !ws Type (!newline Connection +/ newline)? - -Connection = Port ^"->" ForeignPort /ws - | Port ^"<-" ForeignPort /ws - -ForeignPort = ComponentName ^"." Port - -Type = Name -Port = Name -ComponentName = Name -Name = string:: [a-zA-Z0-9_]++ - -quoted = "\"" ~[\"]* "\"" -newline = !ws "\n" !ws -ws = [\r\n ]** - | [\r\n ]** !Comment !ws -Comment = "//" ~[\n]* "\n" - | "/*" ~[\n]* "*/" - -Operations = ^"operations" (Operation+/newline) /newline -Operation = ^"build_GASP_model" - | ^"output" quoted /ws - | ^"journal" quoted /ws - | ^"error" quoted /ws - | ^"info" quoted /ws - | ^"run" [0-9]++ /ws - | ^"step" [0-9]++ /ws - | ^"self_check" - | ^"reset" - | ^"print_parameters" - | ^"print_components" - | ^"print_model" - | ^"print_model_description" diff --git a/tests/components.xml b/tests/components.xml deleted file mode 100644 index 2494edc..0000000 --- a/tests/components.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - -PayloadSourcecom.sunlabs.archsim.assignJan18.Source -PayloadSinkcom.sunlabs.archsim.assignJan18.Sink -FifoElementcom.sunlabs.archsim.assignJan18.FifoElement - diff --git a/tests/connections.xml b/tests/connections.xml deleted file mode 100644 index 11e601d..0000000 --- a/tests/connections.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/tests/fleet.g b/tests/fleet.g deleted file mode 100644 index 965a712..0000000 --- a/tests/fleet.g +++ /dev/null @@ -1,55 +0,0 @@ -// The FLEET Assembly Language Grammar -// As specified in document 2005-ucies06 - -// comments are included where the grammar had to go beyond the strict -// "letter of the law" in ies06 - -// Note that this is the *entire, complete* formal specification of -// the grammar. An equivalent lex+yacc grammar and support code would -// be several times as long. - -Comment = "//" ~[\n]* "\n" - | "/*" ~[\n]* "*/" - -w = [\r\n ]* -ws = (w | Comment)* -> ~[\r\n ] - -s = ws! Program ws! -Program = Program:: - (Directive ws!)* - CodeBagBody - -Directive = Memory:: "#memory" "{" (int +/ (ws! "," ws!)) "}" /ws - | Import:: "#import" [A-Za-z_.]++ /ws - | Ship:: "#ship" shipname ":" [A-Za-z_\.]++ /ws - - -Statement = Move ((ws ";")?)! - | CodeBag -// | ^"#define" Port Port /ws - -Move = Source ^"->" Destination /ws - | Source ^"->*" Destination /ws - | Port ^":=" Source /ws - -Destination = Port +/ (ws! "," ws!) -Source = Port - | CodeBag -CodeBagBody = CodeBag:: (Statement +/ ws) -CodeBag = NamedCodeBag:: - name:(name ws! ":" ws!)? - "{" - ws! statements:(Statement +/ ws) ws! - "}" - (ws! ";")?! - -//Port = Port:: shipname ("." portname)* -Port = Port:: shipname "." portname - | Port:: shipname -shipname = ShipName:: name (index?) -portname = PortName:: name (index?) -name = [A-Za-z0-9\[\]]** -index = "[" [0-9]+ "]" - | [0-9]+ -int = [0-9]++ - diff --git a/tests/grappa.jar b/tests/grappa.jar deleted file mode 100644 index 8ee8988..0000000 Binary files a/tests/grappa.jar and /dev/null differ diff --git a/tests/ifthen.tc b/tests/ifthen.tc deleted file mode 100644 index 6d23a52..0000000 --- a/tests/ifthen.tc +++ /dev/null @@ -1,13 +0,0 @@ -testcase { - input "if (foo) if (bar) baz else bop"; - output "IfThen:{Identifier:{{f o o}} IfThenElse:{IfThen:{Identifier:{{b a r}} Identifier:{{b a z}}} Identifier:{{b o p}}}}"; - - s = Expr - - Expr = IfThen:: "if" "(" Expr ")" Expr /ws - | IfThenElse:: "if" "(" Expr ")" (x:: Expr "else" Expr /ws &~ Expr) /ws - | Identifier:: [a-z]++ - - ws = [\n ]** - -} diff --git a/tests/input.tibdoc b/tests/input.tibdoc deleted file mode 100644 index 30d0d77..0000000 --- a/tests/input.tibdoc +++ /dev/null @@ -1,35 +0,0 @@ -header - "auth\nor" = Adam Megacz - myemail = x adam@foo.megacz.com y - comment = my homepage is at http://www.megacz.com you should it out - -== Introduction == - - this is the body adam@megacz.com text \today - You can visit {my website}->adam@megacz.com with -- a !hyperlink to it! - - The following {demonstrates}->http://www.slashdot.org/ verbatim - stuff [[Knu68]], as well \br as \br a \br footnote ((like)) because - are coool in an O(n^^3) way. - - "" this is a test of \sc{paragraph of fun} - the blockquote mechanism they,,{yer mom} - -== Conclusion == - - Furthermore we can try things like - - * trhis is fun - * this - * this - * that - * that - * these - * that - 1. them - # thar - 45) dorks - * this - * this - - this stuff \ No newline at end of file diff --git a/tests/java.tc b/tests/java.tc deleted file mode 100644 index d9dcf69..0000000 --- a/tests/java.tc +++ /dev/null @@ -1,6 +0,0 @@ -javacase { - input "1+1"; - s = Expr - Expr = left:Expr ^"+" right:Expr - | num:: num:[0-9]+ -} \ No newline at end of file diff --git a/tests/join.g b/tests/join.g deleted file mode 100644 index 0ad7281..0000000 --- a/tests/join.g +++ /dev/null @@ -1,26 +0,0 @@ - - - -Expr = - - - -ram addr data we -> data ack = - clock => we ? data -> storage.data[addr] - : - - -merge ( a b c ) = - a(x) => rega=x | a_ok - b(x) => regb=x | b_ok - a_ok & b_ok => c=x - - - -bit[32] -{ alpha= - - -X (datapath) -Event-of-X (control) - diff --git a/tests/library.xml b/tests/library.xml deleted file mode 100644 index 1498416..0000000 --- a/tests/library.xml +++ /dev/null @@ -1,804 +0,0 @@ - - - - - - - - - - - -SourceFunnel - com.sunlabs.archsim.fleet.HornAndFunnel.SourceFunnel - - - - - - - - - - - - - -InstructionHorn - com.sunlabs.archsim.fleet.HornAndFunnel.InstructionHorn - - - - - - - - - - -DestinationHorn - com.sunlabs.archsim.fleet.HornAndFunnel.DestinationHorn - - - - - - - - - - -DataMaskBranch - com.sunlabs.archsim.fleet.components.switchFabric.DataMaskBranch - - - - - - - - - - - - -DestinationMaskBranch - com.sunlabs.archsim.fleet.components.switchFabric.DestinationMaskBranch - - - - - - - - - - - - -SourceMaskBranch - com.sunlabs.archsim.fleet.components.switchFabric.SourceMaskBranch - - - - - - - - - - - - -ToggleBranch - com.sunlabs.archsim.fleet.components.switchFabric.ToggleBranch - - - - - - - - - - - -Merge - com.sunlabs.archsim.fleet.components.switchFabric.Merge - - - - - - - - - - - - - - - - - - - - - - - - - -DataPayloadMerge - com.sunlabs.archsim.fleet.HornAndFunnel.SourceSync - - - - - - - - - - - -Trunk - com.sunlabs.archsim.fleet.components.trunk.Trunk - - - - - - - - - - - - - - - - - - - - -FifoElement - com.sunlabs.archsim.fleet.ships.fifo.FifoElement - - - - - - - - - - - - - - -Fifo - com.sunlabs.archsim.fleet.ships.fifo.Fifo - - - - - - - - - - - - - - - - -FetchAndIssue - com.sunlabs.archsim.fleet.ships.fetchAndIssue.FetchAndIssue - - - - - - - - - - - - -Accumulator - com.sunlabs.archsim.fleet.ships.accumulator.Accumulator - - - - - - - - - - - -TokenAccumulator - com.sunlabs.archsim.fleet.ships.tokenaccumulator.TokenAccumulator - - - - - - - - - - - -Adder - com.sunlabs.archsim.fleet.ships.adder.Adder - - - - - - - - - - - - -TokenAdder - com.sunlabs.archsim.fleet.ships.tokenadder.TokenAdder - - - - - - - - - - - - - - - -AdderOOB - com.sunlabs.archsim.fleet.ships.adder_oob.Adder_oob - - - - - - - - - - - - -BitBucket - com.sunlabs.archsim.fleet.ships.bitbucket.BitBucket - - - - - - - - - - - - -Constant - com.sunlabs.archsim.fleet.ships.constant.Constant - - - - - - - - - - - - -Duplicator - com.sunlabs.archsim.fleet.ships.duplicator.Duplicator - - - - - - - - - - - - - -FifoShipElement - com.sunlabs.archsim.fleet.ships.fifo.FifoShipElement - - - - - - - - - - - - - - -FifoShip - com.sunlabs.archsim.fleet.ships.fifo.FifoShip - - - - - - - - - - - - - - -TokenFifoShipElement - com.sunlabs.archsim.fleet.ships.tokenFifo.TokenFifoShipElement - - - - - - - - - - - - - - - - - -TokenFifoShip - com.sunlabs.archsim.fleet.ships.tokenFifo.TokenFifoShip - - - - - - - - - - - - - - - - - - -SimpleMemory - com.sunlabs.archsim.fleet.ships.memory.SimpleMemory - - - - - - - - - - - - - - - - - - - - -Selector - com.sunlabs.archsim.fleet.ships.selector.Selector - - - - - - - - - - - - - -Stride - com.sunlabs.archsim.fleet.ships.stride.Stride - - - - - - - - - - - - - - - - - - - -TwoMerge - com.sunlabs.archsim.assignJan25.TwoMerge - - - -Toggle - com.sunlabs.archsim.assignJan25.Toggle - - - -RandomBranch - com.sunlabs.archsim.assignJan25.RandomBranch - - - -MaskBranch - com.sunlabs.archsim.assignJan25.MaskBranch - - - -PayloadSource - com.sunlabs.archsim.assignJan18.Source - - - -PayloadSink - com.sunlabs.archsim.assignJan18.Sink - - - - - - -TestDataSink - com.sunlabs.archsim.fleet.ships.testing.DataSink - - - - -TestDataSource - com.sunlabs.archsim.fleet.ships.testing.DataSource - - - - -TestIntegerSequenceSource - com.sunlabs.archsim.fleet.ships.testing.IntegerSequenceSource - - - - -TestPayloadSink - com.sunlabs.archsim.fleet.ships.testing.PayloadSink - - - - -TestPayloadSource - com.sunlabs.archsim.fleet.ships.testing.PayloadSource - - - - -TestTokenSource - com.sunlabs.archsim.fleet.ships.testing.TokenSource - - - - -InstructionHorn4 - com.sunlabs.archsim.fleet.components.hornAndFunnelFabric.InstructionHorn4 - - - - - - -InstructionHorn8 - com.sunlabs.archsim.fleet.components.hornAndFunnelFabric.InstructionHorn8 - - - -InstructionHorn16 - com.sunlabs.archsim.fleet.components.hornAndFunnelFabric.InstructionHorn16 - - - -SourceFunnel4 - com.sunlabs.archsim.fleet.components.hornAndFunnelFabric.SourceFunnel4 - - - -SourceFunnel8 - com.sunlabs.archsim.fleet.components.hornAndFunnelFabric.SourceFunnel8 - - - -SourceFunnel16 - com.sunlabs.archsim.fleet.components.hornAndFunnelFabric.SourceFunnel16 - - - -DestinationHorn4 - com.sunlabs.archsim.fleet.components.hornAndFunnelFabric.DestinationHorn4 - - - -DestinationHorn8 - com.sunlabs.archsim.fleet.components.hornAndFunnelFabric.DestinationHorn8 - - - -DestinationHorn16 - com.sunlabs.archsim.fleet.components.hornAndFunnelFabric.DestinationHorn16 - - - -InstructionGenerator - com.sunlabs.archsim.fleet.components.hornAndFunnelFabric.TestInstrGen - - - -InstrGen4 - com.sunlabs.archsim.fleet.components.hornAndFunnelFabric.TestInstrGen4 - - - -TestShip - com.sunlabs.archsim.fleet.components.hornAndFunnelFabric.TestShip - - - -TestShipRnd - com.sunlabs.archsim.fleet.components.hornAndFunnelFabric.TestShipRnd - - - diff --git a/tests/loop.tc b/tests/loop.tc deleted file mode 100644 index d29cb2f..0000000 --- a/tests/loop.tc +++ /dev/null @@ -1,20 +0,0 @@ -testcase { - input "if (bar) if (bop) baz"; - output ""; - - s = Expr - Expr = IfThen - | IfThenElse - | id:: [a-z]++ - IfThen = IfThen:: - "if" "(" Expr ")" - Expr - /ws - IfThenElse = IfThenElse:: - "if" "(" Expr ")" - ((thenelse:: Expr - "else" - Expr /ws)) /ws - /ws - ws = [\n ]** -} \ No newline at end of file diff --git a/tests/parameters.xml b/tests/parameters.xml deleted file mode 100644 index 68edf67..0000000 --- a/tests/parameters.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/performance.tc b/tests/performance.tc deleted file mode 100644 index 50ef79b..0000000 --- a/tests/performance.tc +++ /dev/null @@ -1,23 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -// performance hogs -// -//testcase { -// input "aaaaaXaaaa"; -// output ""; -// s = ManyA &~ EndsWithZ -// EndsWithZ = Anything "Z" -// ManyA = () | "a" ManyA -// Anything = () | ("a" | "X" | "Z") Anything -//} - -//testcase { -// input "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; -// output ""; -// s = ManyA -// ManyA = () -// | A ManyA! & ManyAB -// A = "a" -// ManyAB = () -// | "a" ManyAB -// | "b" ManyAB -//} diff --git a/tests/scl.g b/tests/scl.g deleted file mode 100644 index 11f2dd1..0000000 --- a/tests/scl.g +++ /dev/null @@ -1,107 +0,0 @@ - - -data foo = bar; -type foo = bar; - -type Bit = 0 | 1 -type Char = Bit[16] -type Boolean = true | false -type Int32 = Bit[32] | oob -type Int64 = Bit[64] | oob -type Pointer = Bit[64] -type CodeBag = Pointer -type Void = token - -ship Adder3 (a b c -> d e f) - input e : ! - ... - - (x->a) => 3->b - -module latch32 - input data_in : Int32 - input transparent : Boolean! - output data_out : Int32 - private - state keeper : Int32 - data_out = keeper - transparent(true) => keeper = data_in - transparent(false) => keeper = keeper - -module flipflop - input dataIn : T - input clock : Void! - output dataOut : T - private - state keeper : T - data_out = keeper - clock() => keeper := - -module join - input in1 : Void! - input in2 : Void! - output out : Void! - private - -A single-clock synchronous system is therefore a system with only a single variable of event type. A synchronous sytem with mu - - -// how do you specify the initial state of keeper nodes? - -fleet - Adder3[1..3] - - -Type ::= Boolean - - - -Action = Action "," Action - | Value "->" Port+ - - -Identifier ::= Id | "(" Sym ")" - -Definition ::= Identifier "=" Body /ws - -Grammar ::= - -clock -random number generator -register -fifo -compare - -clear-read port - -// positioning of elements on the screen (psuedo-comment?) -// subcircuits -// ports (in, out) - -Parameter ::= Identifier (":" Type)? - - -andgate {a b}->{c d} = - input a, b - output c, d - - -module fifo - - -latch (input, hold) = - old = case - out = case - - - -and, xor, 2:1mux, 4:1mux - -leds, graphs, clock - -charing - -rs-latch -dq-flipflop - -parameterization (?) diff --git a/tests/script.xml b/tests/script.xml deleted file mode 100644 index f398525..0000000 --- a/tests/script.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/tests/settings.xml b/tests/settings.xml deleted file mode 100644 index 102666f..0000000 --- a/tests/settings.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/test.archscript b/tests/test.archscript deleted file mode 100644 index b5eaeab..0000000 --- a/tests/test.archscript +++ /dev/null @@ -1,38 +0,0 @@ -import com.sunlabs.archsim.assignJan18.Source as PayloadSource -import com.sunlabs.archsim.assignJan18.Sink as PayloadSink -import com.sunlabs.archsim.assignJan18.FifoElement as FifoElement - -component Source:PayloadSource -component Sink:PayloadSink -component FifoOne:FifoElement - In <- Source.Out - Out -> Sink.In - -operations - print_parameters - build_GASP_model - self_check - print_model_description - reset - print_model - run 1000 - -settings - sourceDelay="50" - sourceDisplayGenerated="false" - sourceMaxGenerated="100" - sinkDelay="10" - sinkDisplayReceived="false" - sinkMaxStored="100" - fifo_forward_delay="10" - fifo_ack_delay="10" - state_to_action_delay="10" - action_to_state_delay="10" - action_fired_delay="0" - global_log="true" - log_level="0" - journal_state="true" - journal_action="false" - journal_terminal="false" - journalConnectionDataState="false" - journalConnectionAckState="false" diff --git a/tests/test.fleet b/tests/test.fleet deleted file mode 100644 index 20de475..0000000 --- a/tests/test.fleet +++ /dev/null @@ -1,17 +0,0 @@ - -#import edu.berkeley.fleet - -#ship adder : AdderShip -#ship memread : MemReadShip -#ship memwrite : MemWriteShip -#ship one : OneProducerShip -#ship halt : HaltShip - -#memory { 000, 100, 200, 300, 400, 500 } - -one.out -> adder.in1 -one.out -> adder.in2 -adder.out -> memread.addr -memread.data -> adder.in1 -one.out -> adder.in2 -adder.out -> halt.in diff --git a/tests/tib.in b/tests/tib.in deleted file mode 100644 index 1e052f0..0000000 --- a/tests/tib.in +++ /dev/null @@ -1,42 +0,0 @@ -\header - author = Adam Megacz - title = my cool document - comment = my homepage is at http://www.megacz.com you should it out - -== Introduction == - - this is the body adam@megacz.com text \today You can visit {my - website}->http://www.slashdot.org/foo%30bar/ with -- a !!hyperlink - to it!! - - The following 100\forall cool\cent demonstrates stuff [[Knu68]], as - well \br as \br a \br footnote ((like)) because - \doubleLeftRightArrow are ... coool in an O(n^^3) way. - - even moreso, [verbatim] - this is the body adam@megacz.com text \today You can - visit->http://www.slashdot.org/foo%30bar/ with -- a !!hyperlink to - it!! The following 100\forall cool\cent demonstrates stuff - [[Knu68]], as well \br as \br a \br footnote ((like)) because - \doubleLeftRightArrow are ... coool in an O(n^^3) way. - - yep. - -== Conclusion == - - Furthermore we can try things like - - * trhis is fun - * this - * this - * that - * that - * these - * that - 1. them - 45) dorks - * this - * this - - this stuff - diff --git a/tests/tibdoc.g b/tests/tibdoc.g deleted file mode 100644 index b3b107e..0000000 --- a/tests/tibdoc.g +++ /dev/null @@ -1,200 +0,0 @@ -// interactions between !=> and &~ mean that I need to rethink the chartage -// indentation styling... -// literal blocks [[need to ignore bracing]] double-colon style? -// definition -- by prior line indentation, like headings in the original structured text -// tables -// dropcap -// output formats: latex, contex, ps, pdf, html, man, txt, rfc - -// escapification -// comment -// math -// image -// figures - -// "reference-style" links -// -// this[1] is fun -// -// [1] http://... -// - -// nonbreaking text? -// degree: 15^o -// Arrows: <- -> => <= <-> - -// textblocks: -// - attention, caution, danger, error, hint, important, note, tip, warning -// definition -// sidebar -// figure-with-caption -// epigraph (end-of-chapter note) -// compound paragraph (??) -// csv-table? -// table of contents -// header, footer -// #include - -// simple macros (#define) (\define) - -// table representation -// -// \table -// a bbb c -// ddd e -// -// [a] ... -// [b] ... -// [c] ... - -// FIXME: these have to go at the top so they have their dropAll bit set before PreSequence.build... -w = " " | "\n" | "\r" -ws = "()":: w** -// | "()":: w** "#" (~[\n])* "\n" ws -nw = ~[\r\n\ ] - -////////////////////////////////////////////////////////////////////////////// - -s = Doc - -Doc = head:Header ws! body:Body -Header = { "\\header" { KeyVal */ ws } /ws } -Body = { Section } */ws -Section = SectionHeader ws! Paragraph* -SectionHeader = "==" SectionHeaderBody "==" -SectionHeaderBody = "=" SectionHeaderBody "=" - > ws! text ws! - -sp = " "** -blank = sp! "\n" sp! "\n" ws! - -KeyVal = key:bareword "=" val:text /ws -wp = w++ -num = [0-9]++ - -Paragraph = { Blockquote:: "\"\" " text } - > HR:: { "---" "-"* } - > { OL:: (text &~ (text! ws! {oli}+)) ws! {oli}+ } - > P:: { text } - -onums = nums (". "|") ")! -any = ~[]* - -uli = "* " (ws! text &~ any (oli|uli)!) -oli = onums! (ws! text &~ any (oli|uli)!) - -text = Item - -Item*/ws = - blockquote -// > ^"#" ws! { ~[]* } - > Verbatim - > InlineGrammar - > link - > structured - > styled - > (Chars:: alphanum++) - > Quotes:: "\"" text "\"" - > (Symbol:: sym++) - > { Block:: text } - -word = Chars:: bareword - -blockquote = "adsfafewag" -//blockquote = Blockquote:: "\"\"" (block | text "\"\"") - -Verbatim = "[verbatim]" ws! { (~[])++ } - -#import meta.g as meta -InlineGrammar = "\grammar" ws! { meta.Grammar } - -styled = Underline:: "__" text "__" - | Footnote:: "((" text "))" - | TT:: "[[" text "]]" - | Citation:: "[" word "]" - | Strikethrough:: "!!" text "!!" - | Superscript:: "^^" (word|block) - | Subscript:: ",," (word|block) - | Smallcap:: "\\sc" block - | Bold:: "++" text "++" - | Keyword:: "!" (word|block) - | Italic:: "**" text "**" - -block = { text } - -link = text:({ text }|word) "->" ws! href:href -href = url | email | {href} - -structured = command & "\\" ([a-zA-Z0-9]++)! block? - > glyph - > email - > url - -glyph = euro:: "(e)" - | r:: "(r)" - | c:: "(c)" - | tm:: "(tm)" - | emdash:: "--" - | ellipses:: "..." - | cent:: "\\cent" - -command = "\\" [a-z]++ - - -// URLs ////////////////////////////////////////////////////////////////////////////// - -// interesting opportunity to show off boolean grammars here: define other -// subtypes of url (ftp, etc) as conjunctions, but the "master pattern" -// only gets parsed once - -urlpath = urlchar* -> ~urlv // this ~urlv should be handled by url! bug! -username = [a-zA-Z0-9;/?:&=$\-_.+]++ -password = [a-zA-Z0-9;/?:&=$\-_.+]++ -urlc = [a-zA-Z0-9;/?:&=$\-_.+@] -urlv = urlc | [%] -urlchar = urlc - | urlescape:: "%" [0-9] [0-9] -url = Mailto:: "mailto" ":" email -> ~urlv - > URL:: - method:method - "://" - login:url_login? - host:host - port:(":" nums)? - path:("/" urlpath)? - ref:("#" urlpath)? - -> ~(urlv|[\#]) -url_login = Login:: username:username password:(":" password) "@" -method = [+\-.a-z0-9]+ -domain = (part +/ ".") -> ~"." -part = [a-zA-Z0-9\-]++ -// interesting use of boolean grammars -// &~ ([\-0-9] ~[]* | ~[]* [\-0-9]) - -email = user:username "@" host:host -> ~[.] -nums = [0-9]++ -host = IP:: nums "." nums "." nums "." nums - | DNS:: domain - - - -// Tokens /////////////////////////////////////////////////////////////////// - -bareword = alphanum++ - | quoted - -quoted = "\"" ((~[\"\\] | escaped)+) "\"" - | "\"\"":: "\"\"" -escaped = lf:: "\\n" - | cr:: "\\r" - | "\\" ~[nr] - - -// Chars /////////////////////////////////////////////////////////////// - -alpha = [a-zA-Z] -alphanum = [a-zA-Z0-9] -sym = ~[a-zA-Z0-9\ \r\n=\">] -//sym = [,()] - -