code_junkie

Can anyone help me convert this ANTLR 2.0 grammar file to ANTLR 3.0 syntax?

Nov 11th, 2011
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. n3Directive0!:
  2. d:AT_PREFIX ns:nsprefix u:uriref
  3. {directive(#d, #ns, #u);}
  4. ;
  5.  
  6. propertyList![AST subj]
  7. : NAME_OP! anonnode[subj] propertyList[subj]
  8. | propValue[subj] (SEMI propertyList[subj])?
  9. | // void : allows for [ :a :b ] and empty list "; .".
  10. ;
  11.  
  12. propValue [AST subj]
  13. : v1:verb objectList[subj, #v1]
  14. // Reverse the subject and object
  15. | v2:verbReverse subjectList[subj, #v2]
  16. ;
  17.  
  18. subjectList![AST oldSub, AST prop]
  19. : obj:item { emitQuad(#obj, prop, oldSub) ; }
  20. (COMMA subjectList[oldSub, prop])? ;
  21.  
  22. objectList! [AST subj, AST prop]
  23. : obj:item { emitQuad(subj,prop,#obj) ; }
  24. (COMMA objectList[subj, prop])?
  25. | // Allows for empty list ", ."
  26. ;
  27.  
  28. n3Directive0!:
  29. d=AT_PREFIX ns=nsprefix u=uriref
  30. {directive($d, $ns, $u);}
  31. ;
Add Comment
Please, Sign In to add comment