@ Override public void enterVertex ( GDLParser . VertexContext vertexContext ) { String variable = getVariable ( vertexContext . header ( ) ) ; Vertex v ; if ( variable != null && userVertexCache . containsKey ( variable ) ) { v = userVertexCache . get ( variable ) ; } else { v = initNewVertex ( vertexContext ) ; if ( variable != null ) { userVertexCache . put ( variable , v ) ; } else { variable = String . format ( ANONYMOUS_VERTEX_VARIABLE , v . getId ( ) ) ; autoVertexCache . put ( variable , v ) ; } v . setVariable ( variable ) ; vertices . add ( v ) ; } updateGraphElement ( v ) ; setLastSeenVertex ( v ) ; updateLastSeenEdge ( v ) ; }
Called when parser enters a vertex context .