+++ /dev/null
-<?xml version='1.0' encoding='us-ascii'?>
-
-<!--
- DTD for an archsim model
--->
-
-<!ELEMENT model ((component | connection?)+)>
-<!ATTLIST model
- name CDATA #REQUIRED
->
-
-<!ELEMENT component ( parameter | comment )* >
-<!ATTLIST component
- name CDATA #REQUIRED
- type CDATA #REQUIRED
- parameter CDATA #IMPLIED
->
-
-<!ELEMENT connection (comment*, from+, to+, parameter*)>
-<!ATTLIST connection
- name CDATA #REQUIRED
->
-
-<!ELEMENT from (comment*) >
-<!ATTLIST from
- component CDATA #REQUIRED
- terminal CDATA #REQUIRED
->
-
-<!ELEMENT to ( comment* ) >
-<!ATTLIST to
- component CDATA #REQUIRED
- terminal CDATA #REQUIRED
->
-
-<!ELEMENT parameter (comment*) >
-<!ATTLIST parameter
- name CDATA #REQUIRED
- value CDATA #REQUIRED
->
-
-<!ELEMENT comment (#PCDATA) >
\ No newline at end of file
+++ /dev/null
-<?xml version='1.0' encoding='us-ascii'?>
-
-<!--
- DTD for a list of components used in archsim models
--->
-
-<!ELEMENT comment (#PCDATA) >
-
-<!ELEMENT component_list (component*)>
-<!ELEMENT component (type, class, info?)>
-<!ELEMENT type (#PCDATA)>
-<!ELEMENT class (#PCDATA)>
-<!ELEMENT info ((tag | input | output | parameter | global)*) >
-
-<!ELEMENT tag (comment*) >
-<!ATTLIST tag
- value CDATA #REQUIRED
->
-
-<!ELEMENT input (comment*) >
-<!ATTLIST input
- name CDATA #REQUIRED
->
-
-<!ELEMENT output (comment*) >
-<!ATTLIST output
- name CDATA #REQUIRED
->
-
-<!ELEMENT parameter (comment*) >
-<!ATTLIST parameter
- name CDATA #REQUIRED
- type CDATA #IMPLIED
->
-
-<!ELEMENT global (comment*) >
-<!ATTLIST global
- name CDATA #REQUIRED
- type CDATA #IMPLIED
->
+++ /dev/null
-<?xml version='1.0' encoding='us-ascii'?>
-
-<!--
- DTD for operations list
--->
-
-<!ELEMENT operation_list (
- ( load_parameters
- | print_parameters
- | load_components
- | load_model
- | load_aliases
- | load_program
- | build_GASP_model
- | output
- | journal
- | error
- | info
- | run
- | step
- | reset
- | self_check
- | print_components
- | print_model
- | print_model_description
- | print_status )* ) >
-
-<!ELEMENT load_parameters (comment* ) >
-<!ATTLIST load_parameters
- file CDATA #REQUIRED
->
-
-<!ELEMENT print_parameters (comment* ) >
-
-<!ELEMENT load_components (comment* ) >
-<!ATTLIST load_components
- file CDATA #REQUIRED
->
-
-<!ELEMENT load_model ( comment* ) >
-<!ATTLIST load_model
- file CDATA #REQUIRED
->
-
-<!ELEMENT load_aliases ( comment* ) >
-<!ATTLIST load_aliases
- file CDATA #REQUIRED
->
-
-<!ELEMENT load_program ( comment* ) >
-<!ATTLIST load_program
- file CDATA #REQUIRED
->
-
-
-<!ELEMENT build_GASP_model (comment*) >
-
-<!ELEMENT output ( comment* ) >
-<!ATTLIST output
- file CDATA #REQUIRED
->
-
-<!ELEMENT journal ( comment* ) >
-<!ATTLIST journal
- file CDATA #REQUIRED
->
-
-<!ELEMENT error ( comment* ) >
-<!ATTLIST error
- file CDATA #REQUIRED
->
-
-<!ELEMENT info ( comment* ) >
-<!ATTLIST info
- file CDATA #REQUIRED
->
-
-<!ELEMENT run ( comment* ) >
-<!ATTLIST run
- time CDATA #REQUIRED
->
-
-<!ELEMENT step ( comment* ) >
-<!ATTLIST step
- number CDATA #IMPLIED
->
-
-<!ELEMENT self_check ( comment* ) >
-
-<!ELEMENT reset ( comment* ) >
-
-<!ELEMENT print_components ( comment* ) >
-
-<!ELEMENT print_model ( comment* ) >
-
-<!ELEMENT print_model_description ( comment* ) >
-
-<!ELEMENT print_status ( comment* ) >
-
-<!ELEMENT comment (#PCDATA) >
\ No newline at end of file
+++ /dev/null
-<?xml version='1.0' encoding='utf-8'?>
-
-<!DOCTYPE model SYSTEM "ArchSimModel.dtd">
-
-<model name= "SimpleFleet">
-
-
-<component name= "SourceFunnel" type= "SourceFunnel4" />
-<component name= "InstructionHorn" type= "InstructionHorn4" />
-
-<component name= "Trunk" type= "Trunk" >
- <parameter name="trunkArbiterDelay" value="5" />
-</component>
-
-<component name= "DestinationHorn" type= "DestinationHorn4" />
-
-<component name= "FetchAndIssue" type= "FetchAndIssue" >
-</component>
-
-<component name= "Fifo5" type= "FifoShip" >
- <parameter name="fifoCapacity" value="5" />
- <parameter name="backwardDelay" value="500" />
-</component>
-
-<component name= "Fifo2" type= "FifoShip" parameter="2" >
- <parameter name="fifoCapacity" value="2" />
- <parameter name="forwardDelay" value="100" />
-</component>
-
-<component name= "BitBucket" type= "BitBucket" />
-<component name= "ConstantOne" type= "Constant">
- <parameter name="constantValue" value= "ONE" />
-</component>
-<component name= "ConstantTwo" type= "Constant" >
- <parameter name= "constantValue" value="TWO" />
-</component>
-<!-- fetch and issue connections -->
-
-<connection name= "InstructionEntry">
- <from component= "FetchAndIssue" terminal="InstructionOut" />
- <to component= "InstructionHorn" terminal="In" />
-</connection>
-
-<connection name= "LiteralBypass">
- <from component= "FetchAndIssue" terminal="LiteralOut" />
- <to component= "Trunk" terminal="BypassIn" />
-</connection>
-
-<connection name= "BagNameIn">
- <from component= "DestinationHorn" terminal="Out0" />
- <to component= "FetchAndIssue" terminal="In" />
-</connection>
-
-<!-- trunk connections -->
-
-<connection name= "TrunkIn">
- <from component= "SourceFunnel" terminal="Out" />
- <to component= "Trunk" terminal="FabricIn" />
-</connection>
-
-<connection name= "TrunkOut">
- <from component= "Trunk" terminal="Out" />
- <to component= "DestinationHorn" terminal="In" />
-</connection>
-
-<!-- ship connections -->
-
-<connection name= "ConstOneOut">
- <from component= "ConstantOne" terminal="Out" />
- <to component= "SourceFunnel" terminal="SrcIn0" />
-</connection>
-
-<connection name= "Fifo5In">
- <from component= "DestinationHorn" terminal="Out1" />
- <to component= "Fifo5" terminal="In" />
-</connection>
-
-<connection name= "Fifo5Out">
- <from component= "Fifo5" terminal="Out" />
- <to component= "SourceFunnel" terminal="SrcIn1" />
-</connection>
-
-<connection name= "Fifo2In">
- <from component= "DestinationHorn" terminal="Out2" />
- <to component= "Fifo2" terminal="In" />
-</connection>
-
-<connection name= "Fifo2Out">
- <from component= "Fifo2" terminal="Out" />
- <to component= "SourceFunnel" terminal="SrcIn2" />
-</connection>
-
-<connection name= "BitBucketIn">
- <from component= "DestinationHorn" terminal="Out3" />
- <to component= "BitBucket" terminal="In" />
-</connection>
-
-<connection name= "ConstTwoOut">
- <from component= "ConstantTwo" terminal="Out" />
- <to component= "SourceFunnel" terminal="SrcIn3" />
-</connection>
-
-
-<!-- instruction tokens: instr horn to source funnel -->
-
-<connection name= "InstrToken0">
- <from component= "InstructionHorn" terminal="Out0" />
- <to component= "SourceFunnel" terminal="In0" />
-</connection>
-
-<connection name= "InstrToken1">
- <from component= "InstructionHorn" terminal="Out1" />
- <to component= "SourceFunnel" terminal="In1" />
-</connection>
-
-<connection name= "InstrToken2">
- <from component= "InstructionHorn" terminal="Out2" />
- <to component= "SourceFunnel" terminal="In2" />
-</connection>
-
-<connection name= "InstrToken3">
- <from component= "InstructionHorn" terminal="Out3" />
- <to component= "SourceFunnel" terminal="In3" />
-</connection>
-
-</model>
\ No newline at end of file
+++ /dev/null
-// 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"
+++ /dev/null
-<?xml version='1.0' encoding='utf-8'?>
-<!DOCTYPE component_list SYSTEM 'ComponentList.dtd'>
-<component_list>
-<component><type>PayloadSource</type><class>com.sunlabs.archsim.assignJan18.Source</class></component>
-<component><type>PayloadSink</type><class>com.sunlabs.archsim.assignJan18.Sink</class></component>
-<component><type>FifoElement</type><class>com.sunlabs.archsim.assignJan18.FifoElement</class></component>
-</component_list>
+++ /dev/null
-<?xml version='1.0' encoding='utf-8'?>
-<!DOCTYPE model SYSTEM 'ArchSimModel.dtd'>
- <model name='Assignment 1'>
- <component name="Source" type="PayloadSource"/>
- <component name="Sink" type="PayloadSink"/>
- <component name="FifoOne" type="FifoElement"/>
- <connection name='FifoOne.In'>
- <from component="Source" terminal="Out"/>
- <to component="FifoOne" terminal="In"/>
- </connection>
- <connection name='FifoOne.Out'>
- <from component="FifoOne" terminal="Out"/>
- <to component="Sink" terminal="In"/>
- </connection>
- </model>
-
+++ /dev/null
-// 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]++
-
+++ /dev/null
-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 ]**
-
-}
+++ /dev/null
-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
+++ /dev/null
-javacase {
- input "1+1";
- s = Expr
- Expr = left:Expr ^"+" right:Expr
- | num:: num:[0-9]+
-}
\ No newline at end of file
+++ /dev/null
-
-
-
-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)
-
+++ /dev/null
-<?xml version='1.0' encoding='utf-8'?>
-
-<!-- Component library -->
-
-<!DOCTYPE component_list SYSTEM "ComponentList.dtd">
-
-<component_list>
-
-<!--
-THE FOLLOWING GROUP OF COMPONENTS IS USED FOR BUILDING SWITCH FABRICS.
--->
-
-<component>
-<type>SourceFunnel</type>
-<class> com.sunlabs.archsim.fleet.HornAndFunnel.SourceFunnel </class>
-<info>
- <tag value="FABRIC"/>
- <!--
- Inputs: In0, In1, ..., InK
- SrcIn0, SrcIn1, ..., SrcInK
- -->
- <output name="Out" />
- <parameter name= "depth" type="int"/>
- <global name="mergeArbiterDelay" type="int" />
- <global name="mergePassDelay" type="int" />
- <global name="mergeAckDelay" type="int" />
-</info>
-<!--
-Behavior:
- Takes Payload (instruction) inputs on InX, and Data inputs on
- SrcInX. When both inputs are received, the data is inserted
- into the payload and funneled to Out.
-Global parameters:
- mergeArbiterDelay
- mergePassDelay
- mergeAckDelay
-Individual parameter:
- depth = Depth of the tree. The number of input pairs is 2 ^ (depth).
--->
-</component>
-
-<component>
-<type>InstructionHorn</type>
-<class> com.sunlabs.archsim.fleet.HornAndFunnel.InstructionHorn </class>
-<info>
- <tag value="FABRIC"/>
- <input name="In" />
- <!--
- Outputs: Out0, Out1, ... , OutK
- -->
- <parameter name= "depth" type="int"/>
-</info>
-<!--
-Behavior:
- Instruction horn - takes Payloads (Instructions) on In,
- steers them to the output determined by the source
- attribute from Payload.
-Global parameters:
-Individual parameters:
- depth = depth of the tree. The number of outputs is 2 ^ (depth).
--->
-</component>
-
-<component>
-<type>DestinationHorn</type>
-<class> com.sunlabs.archsim.fleet.HornAndFunnel.DestinationHorn </class>
-<info>
- <tag value="FABRIC"/>
- <input name="In" />
- <!--
- Outputs: Out0, Out1, ... , OutK
- -->
- <parameter name= "depth" type="int"/>
-</info>
-<!--
-Behavior:
- Horn, - takes Payloads (Instructions) on In,
- steers them to the output determined by the destination
- attribute from Payload.
-Individual parameter:
- depth = d of the tree. The number of outputs is 2 ^ (depth).
--->
-</component>
-
-<component>
-<type>DataMaskBranch</type>
-<class> com.sunlabs.archsim.fleet.components.switchFabric.DataMaskBranch </class>
-<info>
- <tag value="FABRIC"/>
- <input name="In" />
- <output name="Out0" />
- <output name="Out1" />
- <parameter name="branchMask" type="int" />
- <parameter name= "branchMaskBit" type="int" />
-</info>
-<!--
-Behavior:
- Input received on In is steered either to Out0 or Out1, depending on the
- specified bit in Integer data carried by Payload.
-Individual parameters:
- branchMask (default = 1)
- branchMaskBit (default = 0)
--->
-</component>
-
-<component>
-<type>DestinationMaskBranch</type>
-<class> com.sunlabs.archsim.fleet.components.switchFabric.DestinationMaskBranch </class>
-<info>
- <tag value="FABRIC"/>
- <input name="In" />
- <output name="Out0" />
- <output name="Out1" />
- <parameter name="branchMask" type="int" />
- <parameter name= "branchMaskBit" type="int" />
-</info>
-<!--
-Behavior:
- Input received on In is steered either to Out0 or Out1, depending on the
- specified bit in the Payload's destination
-Individual parameters:
- branchMask (default = 1)
- branchMaskBit (default = 0)
--->
-</component>
-
-<component>
-<type>SourceMaskBranch</type>
-<class> com.sunlabs.archsim.fleet.components.switchFabric.SourceMaskBranch </class>
-<info>
- <tag value="FABRIC"/>
- <input name="In" />
- <output name="Out0" />
- <output name="Out1" />
- <parameter name="branchMask" type="int"/>
- <parameter name= "branchMaskBit" type="int"/>
-</info>
-<!--
-Behavior:
- Input received on In is steered either to Out0 or Out1, depending on the
- specified bit in the Payload's source
-Individual parameters:
- branchMask (default = 1)
- branchMaskBit (default = 0)
--->
-</component>
-
-<component>
-<type>ToggleBranch</type>
-<class> com.sunlabs.archsim.fleet.components.switchFabric.ToggleBranch </class>
-<info>
- <tag value="FABRIC"/>
- <input name="In" />
- <output name="Out0" />
- <output name="Out1" />
- <parameter name="branchFanout" type="int"/>
-</info>
-<!--
-Inputs: In
-Outputs: Out0, Out1, ... , OutK
-Behavior:
- Input received on In is steered to Out0, Out1, ... , OutK
- in a round robin fashion
-Individual parameters:
- branchFanout (default = 2)
--->
-</component>
-
-<component>
-<type>Merge</type>
-<class> com.sunlabs.archsim.fleet.components.switchFabric.Merge </class>
-<info>
- <tag value="FABRIC"/>
- <input name="In0" />
- <input name="In1" />
- <output name="Out" />
- <parameter name="mergeFanIn" type="int"/>
- <parameter name= "mergeArbiterDelay" type="int"/>
- <parameter name= "mergePassDelay" type="int"/>
- <parameter name= "mergeAckDelay" type="int"/>
- <parameter name= "mergeArbiterActionPassDelay" type="int"/>
- <parameter name= "mergeIntouActionPassDelay" type="int"/>
- <parameter name= "mergeInpuAckDelay" type="int"/>
- <parameter name= "mergeOutputAckDelay" type="int"/>
- <global name="mergeArbiterDelay" type="int" />
- <global name="mergePassDelay" type="int" />
- <global name="mergeAckDelay" type="int" />
- <global name="mergeArbiterActionPassDelay" type="int" />
- <global name="mergeIntouActionPassDelay" type="int" />
- <global name="mergeInpuAckDelay" type="int" />
- <global name="mergeOutputAckDelay" type="int" />
-</info>
-<!--
-Inputs: In0, in2, ..., InK
-Outputs: Out
-Behavior: Demand merge - all inputs are steered to one output
--->
-</component>
-
-<component>
-<type>DataPayloadMerge</type>
-<class> com.sunlabs.archsim.fleet.HornAndFunnel.SourceSync </class>
-<info>
- <tag value="FABRIC"/>
- <input name="In" />
- <input name="SrcIn" />
- <output name="Out" />
-</info>
-<!--
-Behavior:
- Inserts Data arrraiving at SrcIn into Payload arriving at In. After both
- inputs had arrived, it produces a Payload with inserted Data on Out.
--->
-</component>
-
-
-<component>
-<type>Trunk</type>
-<class> com.sunlabs.archsim.fleet.components.trunk.Trunk </class>
-<info>
- <tag value="FABRIC"/>
-
- <input name="FabricIn" />
- <input name="BypassIn" />
-
- <output name="Out" />
-
- <parameter name="trunkArbiterDelay" type="int"/>
- <parameter name="trunkCopyDelay" type="int"/>
- <parameter name="trunkAckDelay" type="int"/>
-
- <global name="trunkArbiterDelay" type="int" />
- <global name="trunkCopyDelay" type="int" />
- <global name="trunkAckDelay" type="int" />
-</info>
-<!--
-Behavior:
- Essentially a demand merge - merges inputs on BypassIn (literals) and on
- FabricIn ("regular" instructions) in one output Out. The two sources of inputs are
- arbitrated.
--->
-</component>
-
-<component>
-<type>FifoElement</type>
-<class> com.sunlabs.archsim.fleet.ships.fifo.FifoElement </class>
-<info>
- <tag value="FABRIC"/>
- <input name="In" />
- <output name="Out" />
- <parameter name="forwardDelay" type="int"/>
- <parameter name="backwardDelay" type="int"/>
- <global name="fifoForwardDelay" type="int" />
- <global name="fifoBackwardDelay" type="int" />
-</info>
-<!--
-Inputs: In
-Outputs: Out
-Behavior:
- A fifo element. Elements strung together form a Fifo
- Can only be used in a switch fabric not as a ship.
--->
-</component>
-
-
-<component>
-<type>Fifo</type>
-<class> com.sunlabs.archsim.fleet.ships.fifo.Fifo </class>
-<info>
- <tag value="FABRIC"/>
- <input name="In" />
- <output name="Out" />
- <parameter name="fifoCapacity" type="int"/>
- <parameter name="forwardDelay" type="int"/>
- <parameter name="backwardDelay" type="int"/>
- <global name="fifoForwardDelay" type="int" /> <!-- applies to one element -->
- <global name="fifoBackwardDelay" type="int" /> <!-- applies to one element -->
-</info>
-<!--
-Behavior:
- A fifo.
- Can only be used in a switch fabric not as a ship.
--->
-</component>
-
-<!--
-
-THE FOLLOWING IS IS A LIST OF SHIPS.
-
--->
-
-<component>
-<type>FetchAndIssue</type>
-<class> com.sunlabs.archsim.fleet.ships.fetchAndIssue.FetchAndIssue </class>
-<info>
- <tag value="SHIP"/> <input name="In" />
- <output name="InstructionOut" />
- <output name="LiteralOut" />
- <global name="instructionIssueDelay" type="int" />
- <global name="literalIssueDelay" type="int" />
- <global name="fetchDelay" type="int" />
-</info>
-<!--
-Behavior:
- Takes a ship name in, fetches the code, issues literals and instructions
- on corresponding output.
--->
-</component>
-
-<component>
-<type>Accumulator</type>
-<class> com.sunlabs.archsim.fleet.ships.accumulator.Accumulator </class>
-<info>
- <tag value="SHIP"/>
- <input name="In" />
- <output name="Out" />
- <global name="accumulatorOutDelay" type="int" />
- <global name="accumulatorAckDelay" type="int" />
-</info>
-<!--
-Behavior:
- Take numbers on In, accumulate values.
- When OOB data is received, the sum is produced on Out,
- and the accumulator is reset.
--->
-</component>
-
-<component>
-<type>TokenAccumulator</type>
-<class> com.sunlabs.archsim.fleet.ships.tokenaccumulator.TokenAccumulator </class>
-<info>
- <tag value="SHIP"/>
- <input name="DataIn" />
- <input name="TokenOut" />
- <output name="DataOut" />
- <output name="TokenIn" />
-</info>
-<!--
-Behavior:
- Take numbers on In, accumulate values.
- When OOB data is received, the sum is produced on Out,
- and the accumulator is reset.
- TokenIn (output) and DataIn (input) form a request acknowledge
- interface for receiving data.
- Token Out (input)and DataOut (output) form a request-acknowledge
- interface for the sum.
--->
-</component>
-
-<component>
-<type>Adder</type>
-<class> com.sunlabs.archsim.fleet.ships.adder.Adder </class>
-<info>
- <tag value="SHIP"/>
- <input name="In1" />
- <input name="In2" />
- <output name="Out" />
- <global name="adderDelay" type="int" />
- <global name="adderAckDelay" type="int" />
-</info>
-<!--
-Behavior:
- Receive two numbers on In1 and In2, then produce the sum on Out.
--->
-</component>
-
-<component>
-<type>TokenAdder</type>
-<class> com.sunlabs.archsim.fleet.ships.tokenadder.TokenAdder </class>
-<info>
- <tag value="SHIP"/>
- <input name="In1" />
- <input name="In2" />
- <input name="TokenOut"/>
- <output name="Out" />
- <output name="TokenIn1" />
- <output name="TokenIn1" />
- <global name="tokenAdderDelay" type="int" />
- <global name="tokenAdderAckDelay" type="int" />
-</info>
-<!--
-Behavior:
- Receive two numbers on In1 and In2, then produce the sum on Out.
- Request-acknowledge pairs forming the token interface
- are: < In1, TokenIn1 >, < In2, TokenIn2 >, < TokenOut, Out >
--->
-</component>
-
-<component>
-<type>AdderOOB</type>
-<class> com.sunlabs.archsim.fleet.ships.adder_oob.Adder_oob </class>
-<info>
- <tag value="SHIP"/>
- <input name="In1" />
- <input name="In2" />
- <output name="Out" />
- <global name="adderOOBDelay" type="int" />
- <global name="adderOOBAckDelay" type="int" />
-</info>
-<!--
-Behavior:
- Receive two numbers on In1 and In2, then produce the sum on Out.
- The difference between Adder and Adder_oob is that when A
- dder_oob receives a OOB data on both inputs, it will produce
- an null Data, which will be propagated to other ships on the
- computation path and disassemble any standing MOVEs on it's
- way. This is used in the Fibonacci Fleet for terminating the
- computation.
--->
-</component>
-
-<component>
-<type>BitBucket</type>
-<class> com.sunlabs.archsim.fleet.ships.bitbucket.BitBucket </class>
-<info>
- <tag value="SHIP"/>
- <input name="In" />
- <parameter name="bitBucketdelay" type="int" />
- <parameter name="bitBucketKeepData" type="int" />
- <global name="bitBucketdelay" type="int" />
- <global name="bitBucketKeepData" type="int" />
-</info>
-<!--
-Behavior:
- Takes any input and "throws it away".
- Will keep all data if asked to - useful for testing.
--->
-</component>
-
-<component>
-<type>Constant</type>
-<class> com.sunlabs.archsim.fleet.ships.constant.Constant </class>
-<info>
- <tag value="SHIP"/>
- <output name="Out" />
- <parameter name="constantValue" type="any" />
- <parameter name="constantDelay" type="int" />
- <global name="constantValue" type="any" />
- <global name="constantDelay" type="int" />
-</info>
-<!--
-Behavior:
- Always produces the same constrant (integer, boolean, or string)
--->
-</component>
-
-<component>
-<type>Duplicator</type>
-<class> com.sunlabs.archsim.fleet.ships.duplicator.Duplicator </class>
-<info>
- <tag value="SHIP"/>
- <input name="In" />
- <output name="Out1" />
- <output name="Out2" />
- <global name="duplicatorDelay" type="int" />
- <global name="duplicatorAckDelay" type="int" />
-</info>
-<!--
-Behavior:
- Duplicates data. For each input it receives,
- it produces a copy of it on both outputs.
--->
-</component>
-
-
-<component>
-<type>FifoShipElement</type>
-<class> com.sunlabs.archsim.fleet.ships.fifo.FifoShipElement </class>
-<info>
- <tag value="SHIP"/>
- <input name="In" />
- <output name="Out" />
- <parameter name="forwardDelay" type="int" />
- <parameter name="fifoBackwardDelay" type="int" />
- <global name="fifoShipForwardDelay" type="int" />
- <global name="fifoShipBackwardDelay" type="int" />
-</info>
-<!--
-Behavior:
- A fifo element. Elements strung together form a Fifo
- Can only be used as a ship, or a part of a ship,
- not as a fifo in a switch fabric.
--->
-</component>
-
-
-<component>
-<type>FifoShip</type>
-<class> com.sunlabs.archsim.fleet.ships.fifo.FifoShip </class>
-<info>
- <tag value="SHIP"/>
- <input name="In" />
- <output name="Out" />
- <parameter name="fifoCapacity" type="int" />
- <parameter name="forwardDelay" type="int" /> <!-- applies to one element -->
- <parameter name="fifoBackwardDelay" type="int" /> <!-- applies to one element -->
- <global name="fifoShipForwardDelay" type="int" />
- <global name="fifoShipBackwardDelay" type="int" />
-</info>
-<!--
-Behavior:
- A fifo. Can only be used as a ship, not as a fifo in a switch fabric.
--->
-</component>
-
-<component>
-<type>TokenFifoShipElement</type>
-<class> com.sunlabs.archsim.fleet.ships.tokenFifo.TokenFifoShipElement </class>
-<info>
- <tag value="SHIP"/>
- <input name="In" />
- <input name="TokenIn" />
- <output name="Out" />
- <output name="TokenOut" />
- <parameter name="forwardDelay" type="int" />
- <parameter name="backwardDelay" type="int" />
- <parameter name="tokenDelay" type="int" />
- <parameter name="ackTokenDelay" type="int" />
- <global name="fifoShipForwardDelay" type="int" />
- <global name="fifoShipBackwardDelay" type="int" />
-</info>
-<!--
-Behavior:
- A token fifo ship element. Elements strung together form a TokenFifo
- Can only be used as a ship, not as a fifo in a switch fabric.
- <In, TokenOut>, <TokenIn, Out>
--->
-</component>
-
-<component>
-<type>TokenFifoShip</type>
-<class> com.sunlabs.archsim.fleet.ships.tokenFifo.TokenFifoShip </class>
-<info>
- <tag value="SHIP"/>
- <input name="In" />
- <input name="TokenIn" />
- <output name="Out" />
- <output name="TokenOut" />
- <parameter name="fifoCapacity" type="int" />
- <parameter name="forwardDelay" type="int" />
- <parameter name="backwardDelay" type="int" />
- <parameter name="tokenDelay" type="int" />
- <parameter name="ackTokenDelay" type="int" />
- <global name="fifoShipForwardDelay" type="int" />
- <global name="fifoShipBackwardDelay" type="int" />
-</info>
-<!--
-Behavior:
- FifoShip with token interface.
- Request acknowledge pairs are: <In, TokenOut>, <TokenIn, Out>
--->
-</component>
-
-<component>
-<type>SimpleMemory</type>
-<class> com.sunlabs.archsim.fleet.ships.memory.SimpleMemory </class>
-<info>
- <tag value="SHIP"/>
- <input name="ReadAddress" />
- <input name="WriteAddress" />
- <input name="WriteData" />
- <output name="ReadData" />
- <output name="WriteNext" />
- <parameter name="readDelay" type="int" />
- <parameter name="writeDelay" type="int" />
- <parameter name="ackDelay" type="int" />
- <parameter name="ackReadDelay" type="int" />
- <parameter name="ackWriteDelay" type="int" />
- <global name="simpleMemoryReadDelay" type="int" />
- <global name="simpleMemoryWriteDelay" type="int" />
- <global name="simpleMemoryAckDelay" type="int" />
-</info>
-<!--
-Behavior:
- Memory. Read and write interface operat concurrently.
- No pipelining - one piece of data is operated on at a time (on
- each read and write side).
--->
-</component>
-
-<component>
-<type>Selector</type>
-<class> com.sunlabs.archsim.fleet.ships.selector.Selector </class>
-<info>
- <tag value="SHIP"/>
- <input name="In1" />
- <input name="In2" />
- <input name="InSelect" />
- <output name="Out" />
- <global name="selectorDelay" type="int" />
- <global name="selectorAckDelay" type="int" />
-</info>
-<!--
-Behavior:
- Selector selects between data on In1 and In2, depending on
- the value it receives on InSelect: 1 selects In1, 2 selects In2.
- The selcted value is produced on Out.
- Upon receiving a LAST on its Select input, it will wait for
- a LAST to arrive on In1 and In2, consuming and ignoring all
- non LAST data.
--->
-</component>
-
-<component>
-<type>Stride</type>
-<class> com.sunlabs.archsim.fleet.ships.stride.Stride </class>
-<info>
- <tag value="SHIP"/>
- <input name="StartValue" />
- <input name="Step" />
- <input name="StepCount" />
- <input name="Next" />
- <output name="Counter" />
- <output name="Done" />
- <parameter name="ackDelay" type="int" />
- <parameter name="counterDelay" type="int" />
- <global name="strideCounterDelay" type="int" />
- <global name="strideAckDelay" type="int" />
-</info>
-<!--
-Behavior:
- This is a counter. Setup by providing start value, step size,
- and step count. Ask for the next value by providing an
- input on Next. The response is a value on Counter.
- When the counting is complete, an otput is produced on
- Done - this is a token that indicates that the stride
- is ready for the next setup.
--->
-</component>
-
-<!--
-
-THESE ARE THE COMPONENTS MADE FOR SPECIALLY FOR COURSE ASSIGNMENTS.
-WHICH SHOULD MAKE IT INTO OUR GENERAL REPERTOAIRE?
-
--->
-
-<component>
-<type>TwoMerge</type>
-<class> com.sunlabs.archsim.assignJan25.TwoMerge </class>
-</component>
-
-<component>
-<type>Toggle</type>
-<class> com.sunlabs.archsim.assignJan25.Toggle </class>
-</component>
-
-<component>
-<type>RandomBranch</type>
-<class> com.sunlabs.archsim.assignJan25.RandomBranch </class>
-</component>
-
-<component>
-<type>MaskBranch</type>
-<class> com.sunlabs.archsim.assignJan25.MaskBranch </class>
-</component>
-
-<component>
-<type>PayloadSource</type>
-<class> com.sunlabs.archsim.assignJan18.Source </class>
-</component>
-
-<component>
-<type>PayloadSink</type>
-<class> com.sunlabs.archsim.assignJan18.Sink </class>
-</component>
-
-<!--
-
-THESE COMPONENTS ARE INTENDED FOR USE IN AUTOMATED TESTING.
-THEY HAVE ADDITIONAL APIs THAT ACCOMODATE TEST REQUIREMENTS.
-THEY MAY OR MAY NOT CONFORM TO THE CONVENTION THAT A SHIP
-PRODUCES A Data OBJECT AND RECEIVES A Payload OBJECT,
-WHILE SWITCH FABRIC COMPONENTS RECEIVE AND PRODUCE
-Payload OBJECTS.
-
--->
-
-
-<component>
-<type>TestDataSink</type>
-<class> com.sunlabs.archsim.fleet.ships.testing.DataSink </class>
-<!--
-Used in automated testing. See code.
--->
-</component>
-
-<component>
-<type>TestDataSource</type>
-<class> com.sunlabs.archsim.fleet.ships.testing.DataSource </class>
-<!--
-Used in automated testing. See code.
--->
-</component>
-
-<component>
-<type>TestIntegerSequenceSource</type>
-<class> com.sunlabs.archsim.fleet.ships.testing.IntegerSequenceSource </class>
-<!--
-Used in automated testing. See code.
--->
-</component>
-
-<component>
-<type>TestPayloadSink</type>
-<class> com.sunlabs.archsim.fleet.ships.testing.PayloadSink </class>
-<!--
-Used in automated testing. See code.
--->
-</component>
-
-<component>
-<type>TestPayloadSource</type>
-<class> com.sunlabs.archsim.fleet.ships.testing.PayloadSource </class>
-<!--
-Used in automated testing. See code.
--->
-</component>
-
-<component>
-<type>TestTokenSource</type>
-<class> com.sunlabs.archsim.fleet.ships.testing.TokenSource </class>
-<!--
-Used in automated testing. See code.
--->
-</component>
-
-<component>
-<type>InstructionHorn4</type>
-<class> com.sunlabs.archsim.fleet.components.hornAndFunnelFabric.InstructionHorn4 </class>
-<!--
-Used in automated testing. See code.
--->
-</component>
-
-<!--
-
-THESE COMPONENTS MAY DISAPPEAR OR MAY NEED FIXING.
-THEY WERE USED IN VERY EARLY TESTS.
-WE LIST THEM HERE FOR OLD TESTS TO STILL RUN.
-
--->
-
-<component>
-<type>InstructionHorn8</type>
-<class> com.sunlabs.archsim.fleet.components.hornAndFunnelFabric.InstructionHorn8 </class>
-</component>
-
-<component>
-<type>InstructionHorn16</type>
-<class> com.sunlabs.archsim.fleet.components.hornAndFunnelFabric.InstructionHorn16 </class>
-</component>
-
-<component>
-<type>SourceFunnel4</type>
-<class> com.sunlabs.archsim.fleet.components.hornAndFunnelFabric.SourceFunnel4 </class>
-</component>
-
-<component>
-<type>SourceFunnel8</type>
-<class> com.sunlabs.archsim.fleet.components.hornAndFunnelFabric.SourceFunnel8 </class>
-</component>
-
-<component>
-<type>SourceFunnel16</type>
-<class> com.sunlabs.archsim.fleet.components.hornAndFunnelFabric.SourceFunnel16 </class>
-</component>
-
-<component>
-<type>DestinationHorn4</type>
-<class> com.sunlabs.archsim.fleet.components.hornAndFunnelFabric.DestinationHorn4 </class>
-</component>
-
-<component>
-<type>DestinationHorn8</type>
-<class> com.sunlabs.archsim.fleet.components.hornAndFunnelFabric.DestinationHorn8 </class>
-</component>
-
-<component>
-<type>DestinationHorn16</type>
-<class> com.sunlabs.archsim.fleet.components.hornAndFunnelFabric.DestinationHorn16 </class>
-</component>
-
-<component>
-<type>InstructionGenerator</type>
-<class> com.sunlabs.archsim.fleet.components.hornAndFunnelFabric.TestInstrGen </class>
-</component>
-
-<component>
-<type>InstrGen4</type>
-<class> com.sunlabs.archsim.fleet.components.hornAndFunnelFabric.TestInstrGen4 </class>
-</component>
-
-<component>
-<type>TestShip</type>
-<class> com.sunlabs.archsim.fleet.components.hornAndFunnelFabric.TestShip </class>
-</component>
-
-<component>
-<type>TestShipRnd</type>
-<class> com.sunlabs.archsim.fleet.components.hornAndFunnelFabric.TestShipRnd </class>
-</component>
-
-</component_list>
+++ /dev/null
-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
+++ /dev/null
-<?xml version='1.0' encoding='us-ascii'?>
-
-<settings>
-
-<global_log value="true" />
-
-<log_level value= "0" />
-<journal_state value="false" />
-<journal_action value="false" />
-<journal_terminal value="false" />
-
-<journalConnectionDataState value="false" />
-<journalConnectionAckState value="false" />
-
-
-<state_to_action_delay value="10" />
-<action_to_state_delay value="20" />
-<action_fired_delay value="0" />
-
-<arbiter_delay value="20" />
-<merge_arbiter_delay value="20" />
-<merge_pass_delay value="0" />
-<source_sync_pass_data_dela value= "0" />
-<source_sync_ack_delay value= "0" />
-
-<test_ship_source_delay value= "10" />
-<test_ship_sink_delay value= "10" />
-
-<fifo_ship_forward_delay value="10" />
-<fifo_ship_backward_delay value="10" />
-
-</settings>
\ No newline at end of file
+++ /dev/null
-//////////////////////////////////////////////////////////////////////////////
-// 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
-//}
+++ /dev/null
-
-
-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<T>
- 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 <in>
-
-
-latch (input, hold) =
- old = case
- out = case
-
-
-
-and, xor, 2:1mux, 4:1mux
-
-leds, graphs, clock
-
-charing
-
-rs-latch
-dq-flipflop
-
-parameterization (?)
+++ /dev/null
-<?xml version='1.0' encoding='utf-8'?>
-<!DOCTYPE operation_list SYSTEM 'OperationList.dtd'>
-<operation_list>
- <load_parameters file='settings.xml'/>
- <print_parameters/>
- <load_components file='components.xml'/>
- <print_components/>
- <load_model file='connections.xml'/>
- <print_parameters/>
- <build_GASP_model/>
- <self_check/>
- <print_model_description/>
- <reset/>
- <print_model/>
- <run time="1000"/>
-</operation_list>
-
+++ /dev/null
-<?xml version='1.0' encoding='utf-8'?>
-<settings>
- <sourceDelay value="50"/>
- <sourceDisplayGenerated value="false"/>
- <sourceMaxGenerated value="100"/>
- <sinkDelay value="10"/>
- <sinkDisplayReceived value="false"/>
- <sinkMaxStored value="100"/>
- <fifo_forward_delay value="10"/>
- <fifo_ack_delay value="10"/>
- <state_to_action_delay value="10"/>
- <action_to_state_delay value="10"/>
- <action_fired_delay value="0"/>
- <global_log value="true"/>
- <log_level value="0"/>
- <journal_state value="true"/>
- <journal_action value="false"/>
- <journal_terminal value="false"/>
- <journalConnectionDataState value="false"/>
- <journalConnectionAckState value="false"/>
-</settings>
+++ /dev/null
-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"
+++ /dev/null
-
-#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
+++ /dev/null
-\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
-
+++ /dev/null
-// 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 = [,()]
-
-