Skip to content

Instantly share code, notes, and snippets.

@lovasoa
Last active August 29, 2015 14:14
Show Gist options
  • Save lovasoa/aa679f6c37575b507bfb to your computer and use it in GitHub Desktop.
Save lovasoa/aa679f6c37575b507bfb to your computer and use it in GitHub Desktop.
LBNF Grammar for process hitting models http://loicpauleve.name/pint/doc/syntax.html
comment "(*" "*)" ;
Prog. Program ::= [HeaderElem] [BodyElem] [FooterElem] ;
DefaultRate. HeaderElem ::= "directive" "default_rate" Number;
Stochasticity. HeaderElem ::= "directive" "stochasticity_absorption" Integer;
Sample. HeaderElem ::= "directive" "sample" Number;
separator HeaderElem "";
InitState. FooterElem ::= "initial_state" [Process];
separator FooterElem "";
SortDef. BodyElem ::= "process" ProcessName Integer ;
GenDyn. BodyElem ::= "GRN" "(" "[" [GRNAction] "]" ")" ;
Coop. BodyElem ::= "COOPERATIVITY" "("
NameList "->" Transition "," CoopCondMatrix ")" ;
ComplexCoop. BodyElem ::= "COOPERATIVITY" "(" CoopCond ","
ProcessName ","
Integer ","
Integer ")" ;
ActionElem. BodyElem ::= Action Rate ;
KnockDown. BodyElem ::= "KNOCKDOWN" "(" Process ")" ;
Remove. BodyElem ::= "RM" "(" "{" [Action] "}" ")" ;
Names. NameList ::= "[" [CoopName] "]" ;
CoopNameDef. CoopName ::= ProcessName ;
separator CoopName ";" ;
Matrix. CoopCondMatrix ::= "[" [CoopCondStates] "]" ;
CoopCondMatrixDef. CoopCondStates ::= "[" [CoopCondState] "]";
separator CoopCondStates ";" ;
CoopCondStateDef. CoopCondState ::= Integer;
separator CoopCondState ";" ;
OrState. CoopCond ::= CoopCond "or" CoopCond1 ;
AndState. CoopCond1 ::= CoopCond1 "and" CoopCond2 ;
NegState. CoopCond2 ::= "not" CoopCond2 ;
RawState. CoopCond2 ::= NameList "in" CoopCondMatrix;
coercions CoopCond 2 ;
terminator BodyElem "" ;
ProcessDef. Process ::= ProcessName Integer ;
ActionDef. Action ::= Process "->" Transition ;
ProcessTransition. Transition ::= ProcessName Integer Integer ;
separator Action "," ;
separator Process "," ;
GRNActionDef.GRNAction ::= Process "->" Sign ProcessName ;
separator GRNAction ";" ;
NoRate. Rate ::= ;
InfRate. Rate ::= "@" "Inf" ;
FiniteRate. Rate ::= "@" Number ;
StochasticRate. Rate ::= "@" Number "~" Integer ;
SimpleInt. Number ::= Integer ;
FloatNum. Number ::= Float ;
Inf. Number ::= "Inf" ;
token ProcessName ((letter | '_') (letter | '_' | '\'' | digit)*) ;
token Float (digit+ '.' digit*) ;
token Sign ('+' | '-') ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment