changes in grammar, add write dot file and num in Vertex