let me include my ***matlab*** version

MATLAB <del>266</del> (265 b)
----

	function d=p(V,a),j=(a==1|a==numel(V)-1);if (a==0),d=0;return; end,d=(V(a)-48+10*p(V,a-1))*(V(a)<64);fprintf('%c%.*s%c%.*s',j*10,j*eval(strcat(regexprep(V,'[NP]','+'),48)),ones(99)*'_',(j|a==2)*10,(V(a+1)>64)*d,repmat((V(a+1)==78)*'=='+(V(a+1)==80)*'- ',[1 99]));end

-----

input
----

An ascii-formatted string tailed by a space (since there is no end of chain '\0' in matlab

**example** V='12N13P '

------
output
----

pattern representation of the road


	_________________________

	============- - - - - - -
	_________________________

function 
-----

the function must be called from its tail-1 (the empty character is removed)

**example** : p(V,numel(V)-1) 

Simulation
-----

try it online [here](http://www.tutorialspoint.com/codingground/index.htm?port=9197&sessionid=sup8e17e757ccean6qdbiahe91&home=http://codingground.tutorialspoint.com)