Advertisement
Guest User

Untitled

a guest
Jun 17th, 2017
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
BNF 0.59 KB | None | 0 0
  1. #implicitCopy
  2.  
  3. #ignore["wnl"] ::= ' ' | '\t';
  4.  
  5. defines ::= #ignore("wnl") [directives]+ #continue #empty
  6. ;
  7.  
  8. directives ::=
  9.     #explicitCopy
  10.     [
  11.     '#' [#readIdentifier:{"define"}] [#readIdentifier: def] [#readIdentifier : rep]
  12.     => insert this.defines[def] = rep;
  13.     => traceLine("def = " + def + " rep = " + rep);
  14.     ]
  15.     '\n' => traceLine("newline at macro's end:");
  16.     | #explicitCopy
  17.     [
  18.       #readIdentifier : word ['\n']?
  19.       [#check(findElement(word, this.defines))
  20.         => {%>@this.defines[word]@<%}
  21. |=> {%>@word@<%}
  22.       ]
  23.     ]
  24.     | '\n' => traceLine("newline");
  25. ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement