+1  A: 
n3Directive0!:
                d=AT_PREFIX ns=nsprefix u=uriref
                {directive($d, $ns, $u);}
                ;
  • You have to use '=' for assignments.
  • Tokens can then be used as '$tokenname.getText()', ...
  • Rule results can then be used in your code as 'rulename.result'
  • If you have rules having declared result names, you have to use these names iso.
    'result'.
Bruno Ranschaert