Azure

EBNF notation for dice roller

Jul 11th, 2012
625
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. attack roll = [multiply roll result], [digits], 'd', numeral ;
  2. roll notation = attack roll, {[operator, ( attack roll | digits )]}, [negate high or low roll], [white space, all characters] ;
  3.  
  4. digits = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' ;
  5. (* Note: By using regular expressions, digits can be expressed by / \d+ /. *) ;
  6. multiply roll result = digits, '#' ;
  7. negate high or low roll = '-H' | '-L';
  8. operator = ':+'
  9.          | ':-'
  10.          | ':/'
  11.          | ':*' ;
  12. white space = ? white space characters ? ;
  13. all characters = ? all visible characters ? ;
  14.  
  15. (* Syntax example: 2#3d6+d6/2+3*4-L Attack this! *) ;
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×