export class Writer { private tokens : string [ ] = [ ] ; public toJsonPath ( ) { return this . tokens . join ( '' ) ; } public head ( ) { return this . tokens . slice ( - 1 ) [ 0 ] ; } public pop ( ) { return this . tokens . pop ( ) ; } public writeToken ( token ) { this . tokens . push ( token ) ; } }