added ast functions

nullable, firstpos, lastpos, followpos