From 9c82870ba5385dd5cbabc06def1d91a73f73b585 Mon Sep 17 00:00:00 2001 From: Lie-Quan Lee Date: Tue, 15 Jan 2002 03:43:22 +0000 Subject: [PATCH] replace tabs by proper number of spaces [SVN r12323] --- doc/eg1-iso.cpp | 4 +- example/adjacency_list_io.cpp | 84 +- example/bfs.cpp | 8 +- example/bfs_neighbor.cpp | 4 +- example/boost_web_graph.cpp | 4 +- example/cc-internet.cpp | 2 +- example/cuthill_mckee_ordering.cpp | 14 +- example/dijkstra-example.cpp | 6 +- example/edge_connectivity.cpp | 2 +- example/edge_iterator_constructor.cpp | 6 +- example/edge_property.cpp | 68 +- example/file_dependencies.cpp | 12 +- example/girth.cpp | 16 +- example/graphviz.cpp | 20 +- example/loops_dfs.cpp | 18 +- example/minimum_degree_ordering.cpp | 24 +- example/modify_graph.cpp | 4 +- example/ospf-example.cpp | 22 +- example/prim-telephone.cpp | 2 +- example/push-relabel-eg.cpp | 2 +- example/quick_tour.cpp | 2 +- example/reachable-loop-head.cpp | 14 +- example/regrtest.py | 6 +- example/remove_edge_if_bidir.cpp | 6 +- example/remove_edge_if_dir.cpp | 6 +- example/remove_edge_if_undir.cpp | 6 +- example/roget_components.cpp | 20 +- example/strong_components.cpp | 8 +- example/subgraph.cpp | 6 +- example/visitor.cpp | 6 +- src/graphviz_digraph_lex.cpp | 1416 ++++++++++++------------- src/graphviz_digraph_parser.cpp | 414 ++++---- src/graphviz_graph_lex.cpp | 1416 ++++++++++++------------- src/graphviz_graph_parser.cpp | 414 ++++---- test/adj_list_test.cpp | 4 +- test/bfs.cpp | 4 +- test/dfs.cpp | 2 +- test/dijkstra_cc.cpp | 26 +- test/graph.cpp | 106 +- test/subgraph.cpp | 12 +- test/transitive_closure_test.cpp | 2 +- 41 files changed, 2109 insertions(+), 2109 deletions(-) diff --git a/doc/eg1-iso.cpp b/doc/eg1-iso.cpp index bb261c4e..ad429b77 100644 --- a/doc/eg1-iso.cpp +++ b/doc/eg1-iso.cpp @@ -94,8 +94,8 @@ void test_isomorphism() std::vector::vertex_descriptor> f(num_vertices(Ga)); bool ret = isomorphism(Ga, Gb, &f[0], invariantA, invariantB, - invariantB.max(), - get(vertex_index, Ga), get(vertex_index, Gb)); + invariantB.max(), + get(vertex_index, Ga), get(vertex_index, Gb)); assert(ret == true); for (std::size_t i = 0; i < num_vertices(Ga); ++i) diff --git a/example/adjacency_list_io.cpp b/example/adjacency_list_io.cpp index 27f53894..f6b33c54 100644 --- a/example/adjacency_list_io.cpp +++ b/example/adjacency_list_io.cpp @@ -15,13 +15,13 @@ using namespace boost; struct MyStruct { double value; }; std::ostream& operator << ( std::ostream& out, const MyStruct& s ) { - out << s.value << " "; - return out; + out << s.value << " "; + return out; } std::istream& operator >> ( std::istream& in, MyStruct& s ) { - in >> s.value; - return in; + in >> s.value; + return in; } //======== vertex properties @@ -30,7 +30,7 @@ struct n2_t { enum { num = 23062}; typedef vertex_property_tag kind; }; struct n3_t { enum { num = 23061}; typedef vertex_property_tag kind; }; typedef property< n1_t, int, property< n2_t, double, - property< n3_t, MyStruct > > > VertexProperty; + property< n3_t, MyStruct > > > VertexProperty; //====== edge properties @@ -42,53 +42,53 @@ typedef property EdgeProperty; //===== graph types typedef - adjacency_list - Graph1; + adjacency_list + Graph1; typedef - adjacency_list - Graph2; + adjacency_list + Graph2; int main() { - // read Graph1 - Graph1 g1; - std::ifstream readFile1("data1.txt"); - readFile1 >> read( g1 ); - std::cout << "graph g1 from file data1.txt:\n" - << write( g1 ) - << std::endl; + // read Graph1 + Graph1 g1; + std::ifstream readFile1("data1.txt"); + readFile1 >> read( g1 ); + std::cout << "graph g1 from file data1.txt:\n" + << write( g1 ) + << std::endl; - // read Graph2 and all internal properties - Graph2 g2; - std::ifstream readFile2("data2.txt"); - readFile2 >> read( g2 ); - std::cout << "graph g2 from file data2.txt:\n" - << write( g2 ) - << std::endl; - - // read Graph2, no property given. Write no property. - Graph2 g21; - std::ifstream readFile21("data1.txt"); - readFile21 >> read( g21, no_property(), no_property() ); - std::cout << "graph g21 from file data1.txt:\n" - << write(g21, no_property(), no_property()) - << std::endl; - - // read Graph2, incomplete data in a different order. Write it diffently. - Graph2 g31; - std::ifstream readFile31("data3.txt"); - typedef property< n3_t, MyStruct, property< n1_t, int > > readNodeProp; - readFile31 >> read( g31, readNodeProp() , EdgeProperty() ); - std::cout << "graph g31 from file data3.txt:\n" - << write( g31, property(), EdgeProperty() ) - << std::endl; - + // read Graph2 and all internal properties + Graph2 g2; + std::ifstream readFile2("data2.txt"); + readFile2 >> read( g2 ); + std::cout << "graph g2 from file data2.txt:\n" + << write( g2 ) + << std::endl; + + // read Graph2, no property given. Write no property. + Graph2 g21; + std::ifstream readFile21("data1.txt"); + readFile21 >> read( g21, no_property(), no_property() ); + std::cout << "graph g21 from file data1.txt:\n" + << write(g21, no_property(), no_property()) + << std::endl; + + // read Graph2, incomplete data in a different order. Write it diffently. + Graph2 g31; + std::ifstream readFile31("data3.txt"); + typedef property< n3_t, MyStruct, property< n1_t, int > > readNodeProp; + readFile31 >> read( g31, readNodeProp() , EdgeProperty() ); + std::cout << "graph g31 from file data3.txt:\n" + << write( g31, property(), EdgeProperty() ) + << std::endl; + - return 0; + return 0; } diff --git a/example/bfs.cpp b/example/bfs.cpp index 50a77997..cc3d3bf9 100644 --- a/example/bfs.cpp +++ b/example/bfs.cpp @@ -150,10 +150,10 @@ int main(int , char* []) (G, s, boost::visitor(boost::make_bfs_visitor (std::make_pair(boost::record_distances(d, boost::on_tree_edge()), - std::make_pair - (boost::record_predecessors(&p[0], - boost::on_tree_edge()), - copy_graph(G_copy, boost::on_examine_edge())))) )); + std::make_pair + (boost::record_predecessors(&p[0], + boost::on_tree_edge()), + copy_graph(G_copy, boost::on_examine_edge())))) )); boost::print_graph(G); boost::print_graph(G_copy); diff --git a/example/bfs_neighbor.cpp b/example/bfs_neighbor.cpp index e90ab902..c0b9fd89 100644 --- a/example/bfs_neighbor.cpp +++ b/example/bfs_neighbor.cpp @@ -144,8 +144,8 @@ int main(int , char* []) (G, s, boost::visitor(boost::make_neighbor_bfs_visitor (std::make_pair(boost::record_distances(d, boost::on_tree_edge()), - boost::record_predecessors(&p[0], - boost::on_tree_edge()))))); + boost::record_predecessors(&p[0], + boost::on_tree_edge()))))); boost::print_graph(G); diff --git a/example/boost_web_graph.cpp b/example/boost_web_graph.cpp index e29af78a..2b85a5b8 100644 --- a/example/boost_web_graph.cpp +++ b/example/boost_web_graph.cpp @@ -64,7 +64,7 @@ public: template void discover_vertex(typename boost::graph_traits::vertex_descriptor v, - Graph&) + Graph&) { typedef typename boost::property_traits::value_type Dist; // indentation based on depth @@ -203,7 +203,7 @@ main() breadth_first_search (g, src, boost::visitor(make_bfs_visitor(record_predecessors(&parent[0], - on_tree_edge())))); + on_tree_edge())))); // Add all the search tree edges into a new graph Graph search_tree(num_vertices(g)); diff --git a/example/cc-internet.cpp b/example/cc-internet.cpp index 13e92491..ed27a24a 100644 --- a/example/cc-internet.cpp +++ b/example/cc-internet.cpp @@ -39,7 +39,7 @@ main() int num_comp = connected_components (g, make_iterator_property_map(component.begin(), - get(vertex_index, g), component[0])); + get(vertex_index, g), component[0])); property_map < GraphvizGraph, vertex_attribute_t >::type vertex_attr_map = get(vertex_attribute, g); diff --git a/example/cuthill_mckee_ordering.cpp b/example/cuthill_mckee_ordering.cpp index e2adf6a7..de8a9e16 100644 --- a/example/cuthill_mckee_ordering.cpp +++ b/example/cuthill_mckee_ordering.cpp @@ -102,8 +102,8 @@ int main(int , char* []) for (size_type c = 0; c != inv_perm.size(); ++c) perm[index_map[inv_perm[c]]] = c; std::cout << " bandwidth: " - << bandwidth(G, make_iterator_property_map(&perm[0], index_map, perm[0])) - << std::endl; + << bandwidth(G, make_iterator_property_map(&perm[0], index_map, perm[0])) + << std::endl; } { Vertex s = vertex(0, G); @@ -120,14 +120,14 @@ int main(int , char* []) for (size_type c = 0; c != inv_perm.size(); ++c) perm[index_map[inv_perm[c]]] = c; std::cout << " bandwidth: " - << bandwidth(G, make_iterator_property_map(&perm[0], index_map, perm[0])) - << std::endl; + << bandwidth(G, make_iterator_property_map(&perm[0], index_map, perm[0])) + << std::endl; } { //reverse cuthill_mckee_ordering cuthill_mckee_ordering(G, inv_perm.rbegin(), get(vertex_color, G), - make_degree_map(G)); + make_degree_map(G)); cout << "Reverse Cuthill-McKee ordering:" << endl; cout << " "; @@ -139,8 +139,8 @@ int main(int , char* []) for (size_type c = 0; c != inv_perm.size(); ++c) perm[index_map[inv_perm[c]]] = c; std::cout << " bandwidth: " - << bandwidth(G, make_iterator_property_map(&perm[0], index_map, perm[0])) - << std::endl; + << bandwidth(G, make_iterator_property_map(&perm[0], index_map, perm[0])) + << std::endl; } return 0; } diff --git a/example/dijkstra-example.cpp b/example/dijkstra-example.cpp index e14278cb..403d06eb 100644 --- a/example/dijkstra-example.cpp +++ b/example/dijkstra-example.cpp @@ -68,9 +68,9 @@ main(int, char *[]) // VC++ has trouble with the named parameters mechanism property_map::type indexmap = get(vertex_index, g); dijkstra_shortest_paths(g, s, &p[0], &d[0], weightmap, indexmap, - std::less(), closed_plus(), - std::numeric_limits::max(), 0, - default_dijkstra_visitor()); + std::less(), closed_plus(), + std::numeric_limits::max(), 0, + default_dijkstra_visitor()); #else dijkstra_shortest_paths(g, s, predecessor_map(&p[0]).distance_map(&d[0])); #endif diff --git a/example/edge_connectivity.cpp b/example/edge_connectivity.cpp index 31fcbd84..eaafa028 100644 --- a/example/edge_connectivity.cpp +++ b/example/edge_connectivity.cpp @@ -66,7 +66,7 @@ main() std::cout << "The disconnecting set is {"; std::copy(disconnecting_set.begin(), disconnecting_set.end(), - std::ostream_iterator(std::cout, " ")); + std::ostream_iterator(std::cout, " ")); std::cout << "}." << std::endl; return 0; diff --git a/example/edge_iterator_constructor.cpp b/example/edge_iterator_constructor.cpp index 70b7755a..c98ca3d6 100644 --- a/example/edge_iterator_constructor.cpp +++ b/example/edge_iterator_constructor.cpp @@ -88,17 +88,17 @@ protected: m_end_marker = (*m_stream) ? true : false; } friend bool operator==(const edge_stream_iterator& x, - const edge_stream_iterator& y); + const edge_stream_iterator& y); }; bool operator==(const edge_stream_iterator& x, - const edge_stream_iterator& y) + const edge_stream_iterator& y) { return (x.m_stream == y.m_stream && x.m_end_marker == y.m_end_marker) || x.m_end_marker == false && y.m_end_marker == false; } bool operator!=(const edge_stream_iterator& x, - const edge_stream_iterator& y) + const edge_stream_iterator& y) { return !(x == y); } diff --git a/example/edge_property.cpp b/example/edge_property.cpp index 8f5f9da9..3f15866c 100644 --- a/example/edge_property.cpp +++ b/example/edge_property.cpp @@ -25,45 +25,45 @@ // // Sample output: // -// 0 --(8, 10)--> 1 +// 0 --(8, 10)--> 1 // -// 1 --(12, 20)--> 4 --(12, 40)--> 3 -// <--(8,10)-- 0 <--(16,20)-- 2 -// 2 --(16, 20)--> 1 -// <--(16,20)-- 5 -// 3 --(12, 40)--> 6 -// <--(12,40)-- 1 -// 4 --(12, 20)--> 7 -// <--(12,20)-- 1 -// 5 --(16, 20)--> 2 -// <--(16,20)-- 6 -// 6 --(16, 20)--> 5 --(8, 10)--> 8 -// <--(12,20)-- 7 <--(12,40)-- 3 -// 7 --(12, 20)--> 6 -// <--(12,20)-- 4 -// 8 -// <--(8,10)-- 6 +// 1 --(12, 20)--> 4 --(12, 40)--> 3 +// <--(8,10)-- 0 <--(16,20)-- 2 +// 2 --(16, 20)--> 1 +// <--(16,20)-- 5 +// 3 --(12, 40)--> 6 +// <--(12,40)-- 1 +// 4 --(12, 20)--> 7 +// <--(12,20)-- 1 +// 5 --(16, 20)--> 2 +// <--(16,20)-- 6 +// 6 --(16, 20)--> 5 --(8, 10)--> 8 +// <--(12,20)-- 7 <--(12,40)-- 3 +// 7 --(12, 20)--> 6 +// <--(12,20)-- 4 +// 8 +// <--(8,10)-- 6 // // -// 0 --(8, 1)--> 1 +// 0 --(8, 1)--> 1 // -// 1 --(12, 2)--> 4 --(12, 3)--> 3 -// <--(8,1)-- 0 <--(16,4)-- 2 -// 2 --(16, 4)--> 1 -// <--(16,7)-- 5 -// 3 --(12, 5)--> 6 -// <--(12,3)-- 1 -// 4 --(12, 6)--> 7 -// <--(12,2)-- 1 -// 5 --(16, 7)--> 2 -// <--(16,8)-- 6 -// 6 --(16, 8)--> 5 -// <--(12,10)-- 7 <--(12,5)-- 3 -// 7 --(12, 10)--> 6 -// <--(12,6)-- 4 -// 8 +// 1 --(12, 2)--> 4 --(12, 3)--> 3 +// <--(8,1)-- 0 <--(16,4)-- 2 +// 2 --(16, 4)--> 1 +// <--(16,7)-- 5 +// 3 --(12, 5)--> 6 +// <--(12,3)-- 1 +// 4 --(12, 6)--> 7 +// <--(12,2)-- 1 +// 5 --(16, 7)--> 2 +// <--(16,8)-- 6 +// 6 --(16, 8)--> 5 +// <--(12,10)-- 7 <--(12,5)-- 3 +// 7 --(12, 10)--> 6 +// <--(12,6)-- 4 +// 8 // - + #include #include diff --git a/example/file_dependencies.cpp b/example/file_dependencies.cpp index dfb10ed9..632d8ab3 100644 --- a/example/file_dependencies.cpp +++ b/example/file_dependencies.cpp @@ -169,13 +169,13 @@ int main(int,char*[]) // Run best-first-search from each vertex with zero in-degree. for (tie(i, iend) = vertices(g); i != iend; ++i) { if (in_degree[*i] == 0) { - std::vector::vertex_descriptor> - pred(num_vertices(g)); - property_map::type - indexmap = get(vertex_index, g); + std::vector::vertex_descriptor> + pred(num_vertices(g)); + property_map::type + indexmap = get(vertex_index, g); dijkstra_shortest_paths_no_init - (g, *i, &pred[0], &time[0], weight, indexmap, - compare, combine, 0, 0, default_dijkstra_visitor()); + (g, *i, &pred[0], &time[0], weight, indexmap, + compare, combine, 0, 0, default_dijkstra_visitor()); } } diff --git a/example/girth.cpp b/example/girth.cpp index 97b44ff2..c702a154 100644 --- a/example/girth.cpp +++ b/example/girth.cpp @@ -87,20 +87,20 @@ main() { std::cout << "This program explores the girth and diameter of Ramanujan graphs." - << std::endl; + << std::endl; std::cout << "The bipartite graphs have q^3-q vertices, and the non-bipartite" - << std::endl; + << std::endl; std::cout << "graphs have half that number. Each vertex has degree p+1." - << std::endl; + << std::endl; std::cout << "Both p and q should be odd prime numbers;" << std::endl; std::cout << " or you can try p = 2 with q = 17 or 43." << std::endl; while (1) { std::cout << std::endl - << "Choose a branching factor, p: "; + << "Choose a branching factor, p: "; long p = 0, q = 0; std::cin >> p; if (p == 0) @@ -114,7 +114,7 @@ main() g = raman(p, q, 0L, 0L); if (g == 0) { std::cerr << " Sorry, I couldn't make that graph (error code " - << panic_code << ")" << std::endl; + << panic_code << ")" << std::endl; continue; } distance_list.clear(); @@ -141,11 +141,11 @@ main() for (long d = 1; distance_list[d] != 0; ++d) std::cout << distance_list[d] << " vertices at distance " << d - << (distance_list[d+1] != 0 ? "," : ".") << std::endl; + << (distance_list[d+1] != 0 ? "," : ".") << std::endl; std::cout << "So the diameter is " << k - 1 - << ", and the girth is " << girth - << "." << std::endl; + << ", and the girth is " << girth + << "." << std::endl; } // end while return 0; diff --git a/example/graphviz.cpp b/example/graphviz.cpp index 05956713..a7023141 100644 --- a/example/graphviz.cpp +++ b/example/graphviz.cpp @@ -49,7 +49,7 @@ void print(GraphvizDigraph& g) { for(boost::tie(i,end) = boost::vertices(g); i != end; ++i) { std::cout << vertex_label(*i, g) << " --> "; for (boost::tie(ei,edge_end) = boost::out_edges(*i, g); - ei != edge_end; ++ei) + ei != edge_end; ++ei) std::cout << vertex_label(boost::target(*ei, g), g) << " "; std::cout << std::endl; } @@ -63,18 +63,18 @@ void print(GraphvizDigraph& g) { int main(int argc, char* argv[]) { std::cout << "This is an example to demonstrate how to read graphviz file" - << std::endl - << "and how to write graph to graphviz format." - << std::endl - << std::endl - << std::endl; + << std::endl + << "and how to write graph to graphviz format." + << std::endl + << std::endl + << std::endl; std::cout << "Usage: " << argv[0] << " .dot .dot " - << std::endl; + << std::endl; std::cout << "If only have one xxx.dot in command line," << std::endl - << "the second dot is graphviz_test_new.dot by default." << std::endl - << "If there is no input and output dot file in command line, " - << "input is graphviz_test.dot and output graphviz_test_new.dot." << std::endl; + << "the second dot is graphviz_test_new.dot by default." << std::endl + << "If there is no input and output dot file in command line, " + << "input is graphviz_test.dot and output graphviz_test_new.dot." << std::endl; std::string filename = "graphviz_test.dot"; diff --git a/example/loops_dfs.cpp b/example/loops_dfs.cpp index 1bfbedcd..eefb2c2d 100644 --- a/example/loops_dfs.cpp +++ b/example/loops_dfs.cpp @@ -60,8 +60,8 @@ make_back_edge_recorder(OutputIterator out) template < typename Graph, typename Loops > void find_loops(typename graph_traits < Graph >::vertex_descriptor entry, - const Graph & g, - Loops & loops) // A container of sets of vertices + const Graph & g, + Loops & loops) // A container of sets of vertices { function_requires < BidirectionalGraphConcept < Graph > >(); typedef typename graph_traits < Graph >::edge_descriptor Edge; @@ -163,17 +163,17 @@ main(int argc, char *argv[]) #ifdef BOOST_MSVC // VC++ has trouble with the get_property() functions loops_out << "digraph loops {\n" - << "size=\"3,3\"\n" - << "ratio=\"fill\"\n" - << "shape=\"box\"\n"; + << "size=\"3,3\"\n" + << "ratio=\"fill\"\n" + << "shape=\"box\"\n"; graph_traits::vertex_iterator vi, vi_end; for (tie(vi, vi_end) = vertices(g); vi != vi_end; ++vi) { loops_out << *vi << "["; for (std::map::iterator ai = vattr_map[*vi].begin(); - ai != vattr_map[*vi].end(); ++ai) { + ai != vattr_map[*vi].end(); ++ai) { loops_out << ai->first << "=" << ai->second; if (next(ai) != vattr_map[*vi].end()) - loops_out << ", "; + loops_out << ", "; } loops_out<< "]"; } @@ -182,10 +182,10 @@ main(int argc, char *argv[]) loops_out << source(*ei, g) << " -> " << target(*ei, g) << "["; std::map& attr_map = eattr_map[*ei]; for (std::map::iterator eai = attr_map.begin(); - eai != attr_map.end(); ++eai) { + eai != attr_map.end(); ++eai) { loops_out << eai->first << "=" << eai->second; if (next(eai) != attr_map.end()) - loops_out << ", "; + loops_out << ", "; } loops_out<< "]"; } diff --git a/example/minimum_degree_ordering.cpp b/example/minimum_degree_ordering.cpp index 92ae30c5..f5dfe9b9 100644 --- a/example/minimum_degree_ordering.cpp +++ b/example/minimum_degree_ordering.cpp @@ -69,8 +69,8 @@ struct harwell_boeing } else { if ( Type[0] != 'P' ) { - val = (double *)malloc(nonzeros*sizeof(double)); - if ( val == NULL ) IOHBTerminate("Insufficient memory for val.\n"); + val = (double *)malloc(nonzeros*sizeof(double)); + if ( val == NULL ) IOHBTerminate("Insufficient memory for val.\n"); } } @@ -134,9 +134,9 @@ int main(int argc, char* argv[]) for (int i = 0; i < n; ++i) for (int j = hbs.colptr[i]; j < hbs.colptr[i+1]; ++j) if ( (hbs.rowind[j - 1] - 1 ) > i ) { - add_edge(hbs.rowind[j - 1] - 1, i, G); - add_edge(i, hbs.rowind[j - 1] - 1, G); - num_edge++; + add_edge(hbs.rowind[j - 1] - 1, i, G); + add_edge(i, hbs.rowind[j - 1] - 1, G); + num_edge++; } cout << "number of off-diagnal elements: " << num_edge << endl; @@ -173,24 +173,24 @@ int main(int argc, char* argv[]) for ( i=0; i> comp; if ( comp != inverse_perm[i]+1 ) { - cout << "at i= " << i << ": " << comp - << " ***is NOT EQUAL to*** " << inverse_perm[i]+1 << endl; - is_correct = false; + cout << "at i= " << i << ": " << comp + << " ***is NOT EQUAL to*** " << inverse_perm[i]+1 << endl; + is_correct = false; } } for ( i=0; i> comp; if ( comp != perm[i]+1 ) { - cout << "at i= " << i << ": " << comp - << " ***is NOT EQUAL to*** " << perm[i]+1 << endl; - is_correct = false; + cout << "at i= " << i << ": " << comp + << " ***is NOT EQUAL to*** " << perm[i]+1 << endl; + is_correct = false; } } if ( is_correct ) cout << "Permutation and inverse permutation are correct. "<< endl; else cout << "WARNING -- Permutation or inverse permutation is not the " - << "same ones generated by Liu's " << endl; + << "same ones generated by Liu's " << endl; } return 0; diff --git a/example/modify_graph.cpp b/example/modify_graph.cpp index a359f36b..b2b12587 100644 --- a/example/modify_graph.cpp +++ b/example/modify_graph.cpp @@ -202,8 +202,8 @@ void modify_demo(MutableGraph& g) for (tie(vi, vi_end) = vertices(g); vi != vi_end; ++vi) { typename GraphTraits::adjacency_iterator ai, ai_end; for (tie(ai, ai_end) = adjacent_vertices(*vi, g); - ai != ai_end; ++ai) - assert(*ai != u); + ai != ai_end; ++ai) + assert(*ai != u); } } } diff --git a/example/ospf-example.cpp b/example/ospf-example.cpp index 90157d4f..ce950181 100644 --- a/example/ospf-example.cpp +++ b/example/ospf-example.cpp @@ -85,17 +85,17 @@ main() { std::ofstream out("figs/ospf-sptree.dot"); out << "digraph loops {\n" - << "size=\"3,3\"\n" - << "ratio=\"fill\"\n" - << "shape=\"box\"\n"; + << "size=\"3,3\"\n" + << "ratio=\"fill\"\n" + << "shape=\"box\"\n"; graph_traits::vertex_iterator vi, vi_end; for (tie(vi, vi_end) = vertices(g); vi != vi_end; ++vi) { out << *vi << "["; for (std::map::iterator ai = vattr_map[*vi].begin(); - ai != vattr_map[*vi].end(); ++ai) { - out << ai->first << "=" << ai->second; - if (next(ai) != vattr_map[*vi].end()) - out << ", "; + ai != vattr_map[*vi].end(); ++ai) { + out << ai->first << "=" << ai->second; + if (next(ai) != vattr_map[*vi].end()) + out << ", "; } out<< "]"; } @@ -104,10 +104,10 @@ main() out << source(*ei, g) << " -> " << target(*ei, g) << "["; std::map& attr_map = eattr_map[*ei]; for (std::map::iterator eai = attr_map.begin(); - eai != attr_map.end(); ++eai) { - out << eai->first << "=" << eai->second; - if (next(eai) != attr_map.end()) - out << ", "; + eai != attr_map.end(); ++eai) { + out << eai->first << "=" << eai->second; + if (next(eai) != attr_map.end()) + out << ", "; } out<< "]"; } diff --git a/example/prim-telephone.cpp b/example/prim-telephone.cpp index 5a177158..df5b15ab 100644 --- a/example/prim-telephone.cpp +++ b/example/prim-telephone.cpp @@ -54,7 +54,7 @@ main() property_map::type indexmap = get(vertex_index, g); std::vector distance(num_vertices(g)); prim_minimum_spanning_tree(g, *vertices(g).first, &parent[0], &distance[0], - weight, indexmap, default_dijkstra_visitor()); + weight, indexmap, default_dijkstra_visitor()); #else prim_minimum_spanning_tree(g, &parent[0]); #endif diff --git a/example/push-relabel-eg.cpp b/example/push-relabel-eg.cpp index c0dedfeb..e88e40d7 100644 --- a/example/push-relabel-eg.cpp +++ b/example/push-relabel-eg.cpp @@ -81,7 +81,7 @@ main() #ifdef BOOST_MSVC property_map::type indexmap = get(vertex_index, g); long flow = push_relabel_max_flow(g, s, t, capacity, residual_capacity, rev, - indexmap); + indexmap); #else long flow = push_relabel_max_flow(g, s, t); #endif diff --git a/example/quick_tour.cpp b/example/quick_tour.cpp index 00e3dc7f..50733849 100644 --- a/example/quick_tour.cpp +++ b/example/quick_tour.cpp @@ -149,7 +149,7 @@ int main(int,char*[]) make_label_writer(name), make_label_writer(trans_delay), make_graph_attributes_writer(graph_attr, vertex_attr, - edge_attr)); + edge_attr)); return 0; } diff --git a/example/reachable-loop-head.cpp b/example/reachable-loop-head.cpp index 129c7101..bf3ded75 100644 --- a/example/reachable-loop-head.cpp +++ b/example/reachable-loop-head.cpp @@ -64,17 +64,17 @@ main(int argc, char *argv[]) #ifdef BOOST_MSVC // VC++ has trouble with the get_property() functions loops_out << "digraph G {\n" - << "size=\"3,3\"\n" - << "ratio=\"fill\"\n" - << "shape=\"box\"\n"; + << "size=\"3,3\"\n" + << "ratio=\"fill\"\n" + << "shape=\"box\"\n"; graph_traits::vertex_iterator vi, vi_end; for (tie(vi, vi_end) = vertices(g); vi != vi_end; ++vi) { loops_out << *vi << "["; for (std::map::iterator ai = vattr_map[*vi].begin(); - ai != vattr_map[*vi].end(); ++ai) { + ai != vattr_map[*vi].end(); ++ai) { loops_out << ai->first << "=" << ai->second; if (next(ai) != vattr_map[*vi].end()) - loops_out << ", "; + loops_out << ", "; } loops_out<< "]"; } @@ -85,10 +85,10 @@ main(int argc, char *argv[]) loops_out << source(*ei, g) << " -> " << target(*ei, g) << "["; std::map& attr_map = eattr_map[*ei]; for (std::map::iterator eai = attr_map.begin(); - eai != attr_map.end(); ++eai) { + eai != attr_map.end(); ++eai) { loops_out << eai->first << "=" << eai->second; if (next(eai) != attr_map.end()) - loops_out << ", "; + loops_out << ", "; } loops_out<< "]"; } diff --git a/example/regrtest.py b/example/regrtest.py index d507258d..47459fac 100644 --- a/example/regrtest.py +++ b/example/regrtest.py @@ -85,7 +85,7 @@ def compile( program ): elif sys.platform == "sunos5": if compiler_arg == "*" or compiler_arg =="suncc": - invoke("Sun WorkShop 6 2000/04/07 C++ 5.1", 'CC -c -I' + path + ' ' + fullpath ) + invoke("Sun WorkShop 6 2000/04/07 C++ 5.1", 'CC -c -I' + path + ' ' + fullpath ) if compiler_arg == "*" or compiler_arg == "gcc": invoke( "GCC 2.95.2", 'g++ -Wall -pedantic -ftemplate-depth-30 -Wno-long-long -c -I' + path + ' ' + fullpath ) if compiler_arg == "*" or compiler_arg == "kcc": @@ -151,9 +151,9 @@ def library(): #if compiler_arg=="*" or compiler_arg=="vc": # command='cl /nologo /MDd /W3 /GR /GX /Zi /Od /GZ /I "' + path + '" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB /c"' - # command=command + " " + path + "/libs/" + ... + # command=command + " " + path + "/libs/" + ... # invoke( "VC++ with MS library", command ) - + # invoke( "MS Lib with MS library", 'lib /nologo /out:"boost_vc.lib" boost_timer_vc.obj boost_prg_timer_vc.obj boost_prg_display_vc.obj' ) #if compiler_arg=="*" or compiler_arg=="vcstlport": diff --git a/example/remove_edge_if_bidir.cpp b/example/remove_edge_if_bidir.cpp index 2764f45b..7e1b7a8e 100644 --- a/example/remove_edge_if_bidir.cpp +++ b/example/remove_edge_if_bidir.cpp @@ -79,9 +79,9 @@ main() { typedef std::pair Edge; Edge edge_array[6] = { Edge(0,3), Edge(0,2), Edge(0, 3), - Edge(1,3), - Edge(2, 0), - Edge(3, 2) }; + Edge(1,3), + Edge(2, 0), + Edge(3, 2) }; #ifdef BOOST_MSVC Graph g(4); diff --git a/example/remove_edge_if_dir.cpp b/example/remove_edge_if_dir.cpp index 21b0b16c..bb711f66 100644 --- a/example/remove_edge_if_dir.cpp +++ b/example/remove_edge_if_dir.cpp @@ -60,9 +60,9 @@ main() { typedef std::pair Edge; Edge edges[6] = { Edge(0,3), Edge(0,2), Edge(0, 3), - Edge(1,3), - Edge(2, 0), - Edge(3, 2) }; + Edge(1,3), + Edge(2, 0), + Edge(3, 2) }; #ifdef BOOST_MSVC // VC++ can't handle iterator constructor diff --git a/example/remove_edge_if_undir.cpp b/example/remove_edge_if_undir.cpp index 050ae123..34428f35 100644 --- a/example/remove_edge_if_undir.cpp +++ b/example/remove_edge_if_undir.cpp @@ -78,9 +78,9 @@ main() { typedef std::pair Edge; Edge edge_array[5] = { Edge(0, 3), Edge(0, 3), - Edge(1, 3), - Edge(2, 0), - Edge(3, 2) }; + Edge(1, 3), + Edge(2, 0), + Edge(3, 2) }; #ifdef BOOST_MSVC Graph g(4); diff --git a/example/roget_components.cpp b/example/roget_components.cpp index 7281afd3..28745900 100644 --- a/example/roget_components.cpp +++ b/example/roget_components.cpp @@ -59,7 +59,7 @@ int main(int argc, char* argv[]) g = (filename ? restore_graph(filename) : roget(n, d, p, s)); if (g == NULL) { fprintf(stderr, "Sorry, can't create the graph! (error code %ld)\n", - panic_code); + panic_code); return -1; } printf("Reachability analysis of %s\n\n", g->id); @@ -107,7 +107,7 @@ int main(int argc, char* argv[]) if (strong_comp[c].size() > 1) { std::cout << " also includes:\n"; for (i = 1; i < strong_comp[c].size(); ++i) - std::cout << " " << specs(strong_comp[c][i]) << std::endl; + std::cout << " " << specs(strong_comp[c][i]) << std::endl; } else std::cout << std::endl; } @@ -134,14 +134,14 @@ int main(int argc, char* argv[]) vertex_t v = strong_comp[c][i]; graph_traits::out_edge_iterator ei, ei_end; for (tie(ei, ei_end) = out_edges(v, g); ei != ei_end; ++ei) { - vertex_t x = target(*ei, g); - int comp_x = comp[index_map[x]]; - if (comp_x != c && mark[comp_x] != c) { - mark[comp_x] = c; - vertex_t w = strong_comp[comp_x][0]; - std::cout << specs(u) << " -> " << specs(w) - << " (e.g., " << specs(v) << " -> " << specs(x) << ")\n"; - } // if + vertex_t x = target(*ei, g); + int comp_x = comp[index_map[x]]; + if (comp_x != c && mark[comp_x] != c) { + mark[comp_x] = c; + vertex_t w = strong_comp[comp_x][0]; + std::cout << specs(u) << " -> " << specs(w) + << " (e.g., " << specs(v) << " -> " << specs(x) << ")\n"; + } // if } // for } // for } // for diff --git a/example/strong_components.cpp b/example/strong_components.cpp index 526efa28..a9c06e42 100644 --- a/example/strong_components.cpp +++ b/example/strong_components.cpp @@ -75,15 +75,15 @@ int main(int, char*[]) std::vector color(num_vertices(G)); std::vector root(num_vertices(G)); int num = strong_components(G, &component[0], - root_map(&root[0]). - color_map(&color[0]). - discover_time_map(&discover_time[0])); + root_map(&root[0]). + color_map(&color[0]). + discover_time_map(&discover_time[0])); std::cout << "Total number of components: " << num << std::endl; std::vector::size_type i; for (i = 0; i != component.size(); ++i) std::cout << "Vertex " << name[i] - <<" is in component " << component[i] << std::endl; + <<" is in component " << component[i] << std::endl; return 0; } diff --git a/example/subgraph.cpp b/example/subgraph.cpp index e8607a94..7ee366ac 100644 --- a/example/subgraph.cpp +++ b/example/subgraph.cpp @@ -63,12 +63,12 @@ int main(int,char*[]) const int N = 6; Graph G0(N); - enum { A, B, C, D, E, F}; // for conveniently refering to vertices in G0 + enum { A, B, C, D, E, F}; // for conveniently refering to vertices in G0 Graph& G1 = G0.create_subgraph(); Graph& G2 = G0.create_subgraph(); - enum { A1, B1, C1 }; // for conveniently refering to vertices in G1 - enum { A2, B2 }; // for conveniently refering to vertices in G2 + enum { A1, B1, C1 }; // for conveniently refering to vertices in G1 + enum { A2, B2 }; // for conveniently refering to vertices in G2 add_vertex(C, G1); // global vertex C becomes local A1 for G1 add_vertex(E, G1); // global vertex E becomes local B1 for G1 diff --git a/example/visitor.cpp b/example/visitor.cpp index 7f968f2b..6da7bb82 100644 --- a/example/visitor.cpp +++ b/example/visitor.cpp @@ -108,9 +108,9 @@ main(int, char*[]) cout << "DFS categorized directed graph" << endl; depth_first_search(G, visitor(make_dfs_visitor( make_list(print_edge("tree", on_tree_edge()), - print_edge("back", on_back_edge()), - print_edge("forward or cross", on_forward_or_cross_edge()) - )))); + print_edge("back", on_back_edge()), + print_edge("forward or cross", on_forward_or_cross_edge()) + )))); cout << endl << "BFS categorized directed graph" << endl; boost::breadth_first_search diff --git a/src/graphviz_digraph_lex.cpp b/src/graphviz_digraph_lex.cpp index 7518a7a9..180fa15d 100644 --- a/src/graphviz_digraph_lex.cpp +++ b/src/graphviz_digraph_lex.cpp @@ -34,15 +34,15 @@ /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST -#else /* ! __cplusplus */ +#else /* ! __cplusplus */ #if __STDC__ #define YY_USE_PROTOS #define YY_USE_CONST -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ +#endif /* __STDC__ */ +#endif /* ! __cplusplus */ #ifdef __TURBOC__ #pragma warn -rch @@ -113,10 +113,10 @@ extern FILE *bgl_dir_in, *bgl_dir_out; * int a single C statement (which needs a semi-colon terminator). This * avoids problems with code like: * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); + * if ( condition_holds ) + * yyless( 5 ); + * else + * do_something_else(); * * Prior to using the do-while the compiler would get upset at the * "else" because it interpreted the "if" statement as being all @@ -126,15 +126,15 @@ extern FILE *bgl_dir_in, *bgl_dir_out; /* Return all but the first 'n' matched characters back to the input stream. */ #define yyless(n) \ - do \ - { \ - /* Undo effects of setting up bgl_dir_text. */ \ - *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up bgl_dir_text again */ \ - } \ - while ( 0 ) + do \ + { \ + /* Undo effects of setting up bgl_dir_text. */ \ + *yy_cp = yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up bgl_dir_text again */ \ + } \ + while ( 0 ) #define unput(c) yyunput( c, bgl_dir_text_ptr ) @@ -146,61 +146,61 @@ typedef unsigned int yy_size_t; struct yy_buffer_state - { - FILE *yy_input_file; + { + FILE *yy_input_file; - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; - int yy_buffer_status; + int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via bgl_dir_restart()), so that the user can continue scanning by - * just pointing bgl_dir_in at a new input file. - */ + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via bgl_dir_restart()), so that the user can continue scanning by + * just pointing bgl_dir_in at a new input file. + */ #define YY_BUFFER_EOF_PENDING 2 - }; + }; static YY_BUFFER_STATE yy_current_buffer = 0; @@ -214,15 +214,15 @@ static YY_BUFFER_STATE yy_current_buffer = 0; /* yy_hold_char holds the character lost when bgl_dir_text is formed. */ static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ +static int yy_n_chars; /* number of characters read into yy_ch_buf */ int bgl_dir_leng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ +static int yy_init = 1; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh bgl_dir_in. A bit of a hack ... @@ -250,18 +250,18 @@ static void yy_flex_free YY_PROTO(( void * )); #define yy_new_buffer bgl_dir_create_buffer #define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = bgl_dir_create_buffer( bgl_dir_in, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = bgl_dir_create_buffer( bgl_dir_in, YY_BUF_SIZE ); \ + yy_current_buffer->yy_is_interactive = is_interactive; \ + } #define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = bgl_dir_create_buffer( bgl_dir_in, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = bgl_dir_create_buffer( bgl_dir_in, YY_BUF_SIZE ); \ + yy_current_buffer->yy_at_bol = at_bol; \ + } #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) @@ -283,11 +283,11 @@ static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); * corresponding action - sets up bgl_dir_text. */ #define YY_DO_BEFORE_ACTION \ - bgl_dir_text_ptr = yy_bp; \ - bgl_dir_leng = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; + bgl_dir_text_ptr = yy_bp; \ + bgl_dir_leng = (int) (yy_cp - yy_bp); \ + yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yy_c_buf_p = yy_cp; #define YY_NUM_RULES 21 #define YY_END_OF_BUFFER 22 @@ -563,21 +563,21 @@ YY_MALLOC_DECL */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( bgl_dir_in )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( bgl_dir_in ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else if ( ((result = fread( buf, 1, max_size, bgl_dir_in )) == 0) \ - && ferror( bgl_dir_in ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); + if ( yy_current_buffer->yy_is_interactive ) \ + { \ + int c = '*', n; \ + for ( n = 0; n < max_size && \ + (c = getc( bgl_dir_in )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( bgl_dir_in ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else if ( ((result = fread( buf, 1, max_size, bgl_dir_in )) == 0) \ + && ferror( bgl_dir_in ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - @@ -618,115 +618,115 @@ YY_MALLOC_DECL #endif #define YY_RULE_SETUP \ - YY_USER_ACTION + YY_USER_ACTION YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp = NULL, *yy_bp = NULL; - register int yy_act; + { + register yy_state_type yy_current_state; + register char *yy_cp = NULL, *yy_bp = NULL; + register int yy_act; #line 51 "graphviz_lex.l" #line 629 "lex.yy.c" - if ( yy_init ) - { - yy_init = 0; + if ( yy_init ) + { + yy_init = 0; #ifdef YY_USER_INIT - YY_USER_INIT; + YY_USER_INIT; #endif - if ( ! yy_start ) - yy_start = 1; /* first start state */ + if ( ! yy_start ) + yy_start = 1; /* first start state */ - if ( ! bgl_dir_in ) - bgl_dir_in = stdin; + if ( ! bgl_dir_in ) + bgl_dir_in = stdin; - if ( ! bgl_dir_out ) - bgl_dir_out = stdout; + if ( ! bgl_dir_out ) + bgl_dir_out = stdout; - if ( ! yy_current_buffer ) - yy_current_buffer = - bgl_dir_create_buffer( bgl_dir_in, YY_BUF_SIZE ); + if ( ! yy_current_buffer ) + yy_current_buffer = + bgl_dir_create_buffer( bgl_dir_in, YY_BUF_SIZE ); - bgl_dir_load_buffer_state(); - } + bgl_dir_load_buffer_state(); + } - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = yy_c_buf_p; + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = yy_c_buf_p; - /* Support of bgl_dir_text. */ - *yy_cp = yy_hold_char; + /* Support of bgl_dir_text. */ + *yy_cp = yy_hold_char; - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; - yy_current_state = yy_start; + yy_current_state = yy_start; yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 81 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 169 ); + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 81 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 169 ); yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - yy_act = yy_accept[yy_current_state]; - } + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = yy_last_accepting_cpos; + yy_current_state = yy_last_accepting_state; + yy_act = yy_accept[yy_current_state]; + } - YY_DO_BEFORE_ACTION; + YY_DO_BEFORE_ACTION; -do_action: /* This label is used only to access EOF actions. */ +do_action: /* This label is used only to access EOF actions. */ - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yy_hold_char; - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - goto yy_find_action; + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yy_hold_char; + yy_cp = yy_last_accepting_cpos; + yy_current_state = yy_last_accepting_state; + goto yy_find_action; case 1: YY_RULE_SETUP #line 53 "graphviz_lex.l" { BEGIN Comment; } - YY_BREAK + YY_BREAK case 2: YY_RULE_SETUP #line 54 "graphviz_lex.l" { BEGIN INITIAL; } - YY_BREAK + YY_BREAK case 3: YY_RULE_SETUP #line 55 "graphviz_lex.l" ; - YY_BREAK + YY_BREAK case 4: *yy_cp = yy_hold_char; /* undo effects of setting up bgl_dir_text */ yy_c_buf_p = yy_cp -= 1; @@ -734,7 +734,7 @@ YY_DO_BEFORE_ACTION; /* set up bgl_dir_text again */ YY_RULE_SETUP #line 56 "graphviz_lex.l" ; - YY_BREAK + YY_BREAK case 5: *yy_cp = yy_hold_char; /* undo effects of setting up bgl_dir_text */ yy_c_buf_p = yy_cp -= 1; @@ -742,395 +742,395 @@ YY_DO_BEFORE_ACTION; /* set up bgl_dir_text again */ YY_RULE_SETUP #line 57 "graphviz_lex.l" ; - YY_BREAK + YY_BREAK case 6: YY_RULE_SETUP #line 58 "graphviz_lex.l" { return DIGRAPH_T; } - YY_BREAK + YY_BREAK case 7: YY_RULE_SETUP #line 59 "graphviz_lex.l" { return GRAPH_T; } - YY_BREAK + YY_BREAK case 8: YY_RULE_SETUP #line 60 "graphviz_lex.l" { return NODE_T; } - YY_BREAK + YY_BREAK case 9: YY_RULE_SETUP #line 61 "graphviz_lex.l" { return EDGE_T; } - YY_BREAK + YY_BREAK case 10: YY_RULE_SETUP #line 62 "graphviz_lex.l" ; - YY_BREAK + YY_BREAK case 11: YY_RULE_SETUP #line 63 "graphviz_lex.l" { return SUBGRAPH_T; } - YY_BREAK + YY_BREAK case 12: YY_RULE_SETUP #line 64 "graphviz_lex.l" { return EDGEOP_T; } - YY_BREAK + YY_BREAK case 13: YY_RULE_SETUP #line 65 "graphviz_lex.l" { lvalp->ptr = (void*)(new std::string(bgl_dir_text)); return ID_T; } - YY_BREAK + YY_BREAK case 14: YY_RULE_SETUP #line 66 "graphviz_lex.l" { BEGIN Literal; begin_literal(); } - YY_BREAK + YY_BREAK case 15: YY_RULE_SETUP #line 67 "graphviz_lex.l" { BEGIN INITIAL; end_literal(); lvalp->ptr = (void*)(new std::string(literal)); return ID_T; } - YY_BREAK + YY_BREAK case 16: YY_RULE_SETUP #line 68 "graphviz_lex.l" ; - YY_BREAK + YY_BREAK case 17: YY_RULE_SETUP #line 69 "graphviz_lex.l" { add_string(bgl_dir_text); } - YY_BREAK + YY_BREAK case 18: YY_RULE_SETUP #line 70 "graphviz_lex.l" ; - YY_BREAK + YY_BREAK case 19: YY_RULE_SETUP #line 71 "graphviz_lex.l" ; - YY_BREAK + YY_BREAK case 20: YY_RULE_SETUP #line 72 "graphviz_lex.l" { return bgl_dir_text[0]; } - YY_BREAK + YY_BREAK case 21: YY_RULE_SETUP #line 73 "graphviz_lex.l" ECHO; - YY_BREAK + YY_BREAK #line 823 "lex.yy.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(Comment): case YY_STATE_EOF(Literal): - yyterminate(); + yyterminate(); - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - bgl_dir_text_ptr) - 1; + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - bgl_dir_text_ptr) - 1; - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed bgl_dir_in at a new source and called - * bgl_dir_lex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = bgl_dir_in; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed bgl_dir_in at a new source and called + * bgl_dir_lex(). If so, then we have to assure + * consistency between yy_current_buffer and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yy_n_chars = yy_current_buffer->yy_n_chars; + yy_current_buffer->yy_input_file = bgl_dir_in; + yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; + } - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; - yy_c_buf_p = bgl_dir_text_ptr + yy_amount_of_matched_text; + yy_c_buf_p = bgl_dir_text_ptr + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state(); + yy_current_state = yy_get_previous_state(); - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ - yy_next_state = yy_try_NUL_trans( yy_current_state ); + yy_next_state = yy_try_NUL_trans( yy_current_state ); - yy_bp = bgl_dir_text_ptr + YY_MORE_ADJ; + yy_bp = bgl_dir_text_ptr + YY_MORE_ADJ; - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } + else + { + yy_cp = yy_c_buf_p; + goto yy_find_action; + } + } - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; + else switch ( yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + yy_did_buffer_switch_on_eof = 0; - if ( yywrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * bgl_dir_text, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = bgl_dir_text_ptr + YY_MORE_ADJ; + if ( yywrap() ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * bgl_dir_text, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yy_c_buf_p = bgl_dir_text_ptr + YY_MORE_ADJ; - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } + else + { + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - bgl_dir_text_ptr + yy_amount_of_matched_text; + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = + bgl_dir_text_ptr + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state(); + yy_current_state = yy_get_previous_state(); - yy_cp = yy_c_buf_p; - yy_bp = bgl_dir_text_ptr + YY_MORE_ADJ; - goto yy_match; + yy_cp = yy_c_buf_p; + yy_bp = bgl_dir_text_ptr + YY_MORE_ADJ; + goto yy_match; - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; + case EOB_ACT_LAST_MATCH: + yy_c_buf_p = + &yy_current_buffer->yy_ch_buf[yy_n_chars]; - yy_current_state = yy_get_previous_state(); + yy_current_state = yy_get_previous_state(); - yy_cp = yy_c_buf_p; - yy_bp = bgl_dir_text_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } + yy_cp = yy_c_buf_p; + yy_bp = bgl_dir_text_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of bgl_dir_lex */ + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of bgl_dir_lex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = bgl_dir_text_ptr; - register int number_to_move, i; - int ret_val; + { + register char *dest = yy_current_buffer->yy_ch_buf; + register char *source = bgl_dir_text_ptr; + register int number_to_move, i; + int ret_val; - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - bgl_dir_text_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } + if ( yy_current_buffer->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yy_c_buf_p - bgl_dir_text_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } - /* Try to read more data. */ + /* Try to read more data. */ - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - bgl_dir_text_ptr) - 1; + /* First move last chars to start of buffer. */ + number_to_move = (int) (yy_c_buf_p - bgl_dir_text_ptr) - 1; - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + yy_current_buffer->yy_n_chars = yy_n_chars = 0; - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; + else + { + int num_to_read = + yy_current_buffer->yy_buf_size - number_to_move - 1; - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ #ifdef YY_USES_REJECT - YY_FATAL_ERROR( + YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); #else - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = yy_current_buffer; - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); + int yy_c_buf_p_offset = + (int) (yy_c_buf_p - b->yy_ch_buf); - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; + num_to_read = yy_current_buffer->yy_buf_size - + number_to_move - 1; #endif - } + } - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); + /* Read in more data. */ + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); - yy_current_buffer->yy_n_chars = yy_n_chars; - } + yy_current_buffer->yy_n_chars = yy_n_chars; + } - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - bgl_dir_restart( bgl_dir_in ); - } + if ( yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + bgl_dir_restart( bgl_dir_in ); + } - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } + else + { + ret_val = EOB_ACT_LAST_MATCH; + yy_current_buffer->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } - else - ret_val = EOB_ACT_CONTINUE_SCAN; + else + ret_val = EOB_ACT_CONTINUE_SCAN; - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + yy_n_chars += number_to_move; + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - bgl_dir_text_ptr = &yy_current_buffer->yy_ch_buf[0]; + bgl_dir_text_ptr = &yy_current_buffer->yy_ch_buf[0]; - return ret_val; - } + return ret_val; + } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state() - { - register yy_state_type yy_current_state; - register char *yy_cp; + { + register yy_state_type yy_current_state; + register char *yy_cp; - yy_current_state = yy_start; + yy_current_state = yy_start; - for ( yy_cp = bgl_dir_text_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 81 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } + for ( yy_cp = bgl_dir_text_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 81 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } - return yy_current_state; - } + return yy_current_state; + } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis - * next_state = yy_try_NUL_trans( current_state ); + * next_state = yy_try_NUL_trans( current_state ); */ #ifdef YY_USE_PROTOS @@ -1139,27 +1139,27 @@ static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) static yy_state_type yy_try_NUL_trans( yy_current_state ) yy_state_type yy_current_state; #endif - { - register int yy_is_jam; - register char *yy_cp = yy_c_buf_p; + { + register int yy_is_jam; + register char *yy_cp = yy_c_buf_p; - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 81 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 80); + register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 81 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 80); - return yy_is_jam ? 0 : yy_current_state; - } + return yy_is_jam ? 0 : yy_current_state; + } #ifndef YY_NO_UNPUT @@ -1170,41 +1170,41 @@ static void yyunput( c, yy_bp ) int c; register char *yy_bp; #endif - { - register char *yy_cp = yy_c_buf_p; + { + register char *yy_cp = yy_c_buf_p; - /* undo effects of setting up bgl_dir_text */ - *yy_cp = yy_hold_char; + /* undo effects of setting up bgl_dir_text */ + *yy_cp = yy_hold_char; - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = yy_n_chars + 2; + register char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; + register char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; + while ( source > yy_current_buffer->yy_ch_buf ) + *--dest = *--source; - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + yy_current_buffer->yy_n_chars = + yy_n_chars = yy_current_buffer->yy_buf_size; - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } - *--yy_cp = (char) c; + *--yy_cp = (char) c; - bgl_dir_text_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ + bgl_dir_text_ptr = yy_bp; + yy_hold_char = *yy_cp; + yy_c_buf_p = yy_cp; + } +#endif /* ifndef YY_NO_UNPUT */ #ifdef __cplusplus @@ -1212,72 +1212,72 @@ static int bgl_dir_input() #else static int input() #endif - { - int c; + { + int c; - *yy_c_buf_p = yy_hold_char; + *yy_c_buf_p = yy_hold_char; - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; + if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + /* This was really a NUL. */ + *yy_c_buf_p = '\0'; - else - { /* need more input */ - int offset = yy_c_buf_p - bgl_dir_text_ptr; - ++yy_c_buf_p; + else + { /* need more input */ + int offset = yy_c_buf_p - bgl_dir_text_ptr; + ++yy_c_buf_p; - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ + switch ( yy_get_next_buffer() ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ - /* Reset buffer status. */ - bgl_dir_restart( bgl_dir_in ); + /* Reset buffer status. */ + bgl_dir_restart( bgl_dir_in ); - /* fall through */ + /* fall through */ - case EOB_ACT_END_OF_FILE: - { - if ( yywrap() ) - return EOF; + case EOB_ACT_END_OF_FILE: + { + if ( yywrap() ) + return EOF; - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; #ifdef __cplusplus - return bgl_dir_input(); + return bgl_dir_input(); #else - return input(); + return input(); #endif - } + } - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = bgl_dir_text_ptr + offset; - break; - } - } - } + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = bgl_dir_text_ptr + offset; + break; + } + } + } - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve bgl_dir_text */ - yy_hold_char = *++yy_c_buf_p; + c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ + *yy_c_buf_p = '\0'; /* preserve bgl_dir_text */ + yy_hold_char = *++yy_c_buf_p; - return c; - } + return c; + } #ifdef YY_USE_PROTOS @@ -1286,13 +1286,13 @@ void bgl_dir_restart( FILE *input_file ) void bgl_dir_restart( input_file ) FILE *input_file; #endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = bgl_dir_create_buffer( bgl_dir_in, YY_BUF_SIZE ); + { + if ( ! yy_current_buffer ) + yy_current_buffer = bgl_dir_create_buffer( bgl_dir_in, YY_BUF_SIZE ); - bgl_dir_init_buffer( yy_current_buffer, input_file ); - bgl_dir_load_buffer_state(); - } + bgl_dir_init_buffer( yy_current_buffer, input_file ); + bgl_dir_load_buffer_state(); + } #ifdef YY_USE_PROTOS @@ -1301,28 +1301,28 @@ void bgl_dir_switch_to_buffer( YY_BUFFER_STATE new_buffer ) void bgl_dir_switch_to_buffer( new_buffer ) YY_BUFFER_STATE new_buffer; #endif - { - if ( yy_current_buffer == new_buffer ) - return; + { + if ( yy_current_buffer == new_buffer ) + return; - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } + if ( yy_current_buffer ) + { + /* Flush out information for old buffer. */ + *yy_c_buf_p = yy_hold_char; + yy_current_buffer->yy_buf_pos = yy_c_buf_p; + yy_current_buffer->yy_n_chars = yy_n_chars; + } - yy_current_buffer = new_buffer; - bgl_dir_load_buffer_state(); + yy_current_buffer = new_buffer; + bgl_dir_load_buffer_state(); - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yy_did_buffer_switch_on_eof = 1; + } #ifdef YY_USE_PROTOS @@ -1330,12 +1330,12 @@ void bgl_dir_load_buffer_state( void ) #else void bgl_dir_load_buffer_state() #endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - bgl_dir_text_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - bgl_dir_in = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } + { + yy_n_chars = yy_current_buffer->yy_n_chars; + bgl_dir_text_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; + bgl_dir_in = yy_current_buffer->yy_input_file; + yy_hold_char = *yy_c_buf_p; + } #ifdef YY_USE_PROTOS @@ -1345,28 +1345,28 @@ YY_BUFFER_STATE bgl_dir_create_buffer( file, size ) FILE *file; int size; #endif - { - YY_BUFFER_STATE b; + { + YY_BUFFER_STATE b; - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in bgl_dir_create_buffer()" ); + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in bgl_dir_create_buffer()" ); - b->yy_buf_size = size; + b->yy_buf_size = size; - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in bgl_dir_create_buffer()" ); + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in bgl_dir_create_buffer()" ); - b->yy_is_our_buffer = 1; + b->yy_is_our_buffer = 1; - bgl_dir_init_buffer( b, file ); + bgl_dir_init_buffer( b, file ); - return b; - } + return b; + } #ifdef YY_USE_PROTOS @@ -1375,18 +1375,18 @@ void bgl_dir_delete_buffer( YY_BUFFER_STATE b ) void bgl_dir_delete_buffer( b ) YY_BUFFER_STATE b; #endif - { - if ( ! b ) - return; + { + if ( ! b ) + return; - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; + if ( b == yy_current_buffer ) + yy_current_buffer = (YY_BUFFER_STATE) 0; - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); + if ( b->yy_is_our_buffer ) + yy_flex_free( (void *) b->yy_ch_buf ); - yy_flex_free( (void *) b ); - } + yy_flex_free( (void *) b ); + } @@ -1399,22 +1399,22 @@ FILE *file; #endif - { - bgl_dir_flush_buffer( b ); + { + bgl_dir_flush_buffer( b ); - b->yy_input_file = file; - b->yy_fill_buffer = 1; + b->yy_input_file = file; + b->yy_fill_buffer = 1; #if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; + b->yy_is_interactive = 1; #else #if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; + b->yy_is_interactive = 0; #else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; #endif #endif - } + } #ifdef YY_USE_PROTOS @@ -1424,27 +1424,27 @@ void bgl_dir_flush_buffer( b ) YY_BUFFER_STATE b; #endif - { - if ( ! b ) - return; + { + if ( ! b ) + return; - b->yy_n_chars = 0; + b->yy_n_chars = 0; - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - b->yy_buf_pos = &b->yy_ch_buf[0]; + b->yy_buf_pos = &b->yy_ch_buf[0]; - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; - if ( b == yy_current_buffer ) - bgl_dir_load_buffer_state(); - } + if ( b == yy_current_buffer ) + bgl_dir_load_buffer_state(); + } #ifndef YY_NO_SCAN_BUFFER @@ -1455,33 +1455,33 @@ YY_BUFFER_STATE bgl_dir_scan_buffer( base, size ) char *base; yy_size_t size; #endif - { - YY_BUFFER_STATE b; + { + YY_BUFFER_STATE b; - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in bgl_dir_scan_buffer()" ); + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in bgl_dir_scan_buffer()" ); - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; - bgl_dir_switch_to_buffer( b ); + bgl_dir_switch_to_buffer( b ); - return b; - } + return b; + } #endif @@ -1492,13 +1492,13 @@ YY_BUFFER_STATE bgl_dir_scan_string( yyconst char *yy_str ) YY_BUFFER_STATE bgl_dir_scan_string( yy_str ) yyconst char *yy_str; #endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; + { + int len; + for ( len = 0; yy_str[len]; ++len ) + ; - return bgl_dir_scan_bytes( yy_str, len ); - } + return bgl_dir_scan_bytes( yy_str, len ); + } #endif @@ -1510,34 +1510,34 @@ YY_BUFFER_STATE bgl_dir_scan_bytes( bytes, len ) yyconst char *bytes; int len; #endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; + { + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in bgl_dir_scan_bytes()" ); + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) yy_flex_alloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in bgl_dir_scan_bytes()" ); - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - b = bgl_dir_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in bgl_dir_scan_bytes()" ); + b = bgl_dir_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in bgl_dir_scan_bytes()" ); - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; - return b; - } + return b; + } #endif @@ -1548,49 +1548,49 @@ static void yy_push_state( int new_state ) static void yy_push_state( new_state ) int new_state; #endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; + { + if ( yy_start_stack_ptr >= yy_start_stack_depth ) + { + yy_size_t new_size; - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } - yy_start_stack[yy_start_stack_ptr++] = YY_START; + yy_start_stack[yy_start_stack_ptr++] = YY_START; - BEGIN(new_state); - } + BEGIN(new_state); + } #endif #ifndef YY_NO_POP_STATE static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } #endif #ifndef YY_NO_TOP_STATE static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } #endif #ifndef YY_EXIT_FAILURE @@ -1603,10 +1603,10 @@ static void yy_fatal_error( yyconst char msg[] ) static void yy_fatal_error( msg ) char msg[]; #endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } + { + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); + } @@ -1614,16 +1614,16 @@ char msg[]; #undef yyless #define yyless(n) \ - do \ - { \ - /* Undo effects of setting up bgl_dir_text. */ \ - bgl_dir_text[bgl_dir_leng] = yy_hold_char; \ - yy_c_buf_p = bgl_dir_text + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - bgl_dir_leng = n; \ - } \ - while ( 0 ) + do \ + { \ + /* Undo effects of setting up bgl_dir_text. */ \ + bgl_dir_text[bgl_dir_leng] = yy_hold_char; \ + yy_c_buf_p = bgl_dir_text + n; \ + yy_hold_char = *yy_c_buf_p; \ + *yy_c_buf_p = '\0'; \ + bgl_dir_leng = n; \ + } \ + while ( 0 ) /* Internal utility routines. */ @@ -1637,11 +1637,11 @@ char *s1; yyconst char *s2; int n; #endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } + { + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } #endif #ifdef YY_NEED_STRLEN @@ -1651,13 +1651,13 @@ static int yy_flex_strlen( yyconst char *s ) static int yy_flex_strlen( s ) yyconst char *s; #endif - { - register int n; - for ( n = 0; s[n]; ++n ) - ; + { + register int n; + for ( n = 0; s[n]; ++n ) + ; - return n; - } + return n; + } #endif @@ -1667,9 +1667,9 @@ static void *yy_flex_alloc( yy_size_t size ) static void *yy_flex_alloc( size ) yy_size_t size; #endif - { - return (void *) malloc( size ); - } + { + return (void *) malloc( size ); + } #ifdef YY_USE_PROTOS static void *yy_flex_realloc( void *ptr, yy_size_t size ) @@ -1678,16 +1678,16 @@ static void *yy_flex_realloc( ptr, size ) void *ptr; yy_size_t size; #endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } + { + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); + } #ifdef YY_USE_PROTOS static void yy_flex_free( void *ptr ) @@ -1695,16 +1695,16 @@ static void yy_flex_free( void *ptr ) static void yy_flex_free( ptr ) void *ptr; #endif - { - free( ptr ); - } + { + free( ptr ); + } #if YY_MAIN int main() - { - bgl_dir_lex(); - return 0; - } + { + bgl_dir_lex(); + return 0; + } #endif #line 73 "graphviz_lex.l" diff --git a/src/graphviz_digraph_parser.cpp b/src/graphviz_digraph_parser.cpp index 213ab1fe..615724ef 100644 --- a/src/graphviz_digraph_parser.cpp +++ b/src/graphviz_digraph_parser.cpp @@ -11,13 +11,13 @@ #define bgl_dir_char bgl_dir_char #define bgl_dir_debug bgl_dir_debug #define bgl_dir_nerrs bgl_dir_nerrs -#define GRAPH_T 257 -#define NODE_T 258 -#define EDGE_T 259 -#define DIGRAPH_T 260 -#define EDGEOP_T 261 -#define SUBGRAPH_T 262 -#define ID_T 263 +#define GRAPH_T 257 +#define NODE_T 258 +#define EDGE_T 259 +#define DIGRAPH_T 260 +#define EDGEOP_T 261 +#define SUBGRAPH_T 262 +#define ID_T 263 #line 1 "graphviz_parser.y" @@ -100,7 +100,7 @@ static const std::string& get_graph_name(const Subgraph& g) { const boost::graph_property::type& - name = boost::get_property(g, boost::graph_name); + name = boost::get_property(g, boost::graph_name); return name; } @@ -117,7 +117,7 @@ //set the label of vertex, it could be overwritten later. boost::property_map::type - va = boost::get(boost::vertex_attribute, g); + va = boost::get(boost::vertex_attribute, g); va[v]["label"] = name; //add v into the map so next time we will find it. @@ -141,85 +141,85 @@ static void set_attribute(GraphvizAttrList& p, - const GraphvizAttrList& attr) { + const GraphvizAttrList& attr) { GraphvizAttrList::const_iterator i, end; for ( i=attr.begin(), end=attr.end(); i!=end; ++i) - p[i->first]=i->second; + p[i->first]=i->second; } static void set_attribute(Subgraph& g, - AttrState s, bool clear_attribute = true) { + AttrState s, bool clear_attribute = true) { typedef Subgraph Graph; switch ( s ) { case GRAPH_GRAPH_A: - { - boost::graph_property::type& - gga = boost::get_property(g, boost::graph_graph_attribute); - set_attribute(gga, attributes); - } - break; + { + boost::graph_property::type& + gga = boost::get_property(g, boost::graph_graph_attribute); + set_attribute(gga, attributes); + } + break; case GRAPH_NODE_A: - { - boost::graph_property::type& - gna = boost::get_property(g, boost::graph_vertex_attribute); - set_attribute(gna, attributes); - } - break; + { + boost::graph_property::type& + gna = boost::get_property(g, boost::graph_vertex_attribute); + set_attribute(gna, attributes); + } + break; case GRAPH_EDGE_A: - { - boost::graph_property::type& - gea = boost::get_property(g, boost::graph_edge_attribute); - set_attribute(gea, attributes); - } - break; + { + boost::graph_property::type& + gea = boost::get_property(g, boost::graph_edge_attribute); + set_attribute(gea, attributes); + } + break; case NODE_A: - { - boost::property_map::type - va = boost::get(boost::vertex_attribute, g); //va[v] - set_attribute(va[current_vertex], attributes); - } - break; + { + boost::property_map::type + va = boost::get(boost::vertex_attribute, g); //va[v] + set_attribute(va[current_vertex], attributes); + } + break; case EDGE_A: - { - boost::property_map::type - ea = boost::get(boost::edge_attribute, g); //ea[e] - set_attribute(ea[current_edge], attributes); - } - break; + { + boost::property_map::type + ea = boost::get(boost::edge_attribute, g); //ea[e] + set_attribute(ea[current_edge], attributes); + } + break; } if ( clear_attribute ) - attributes.clear(); + attributes.clear(); } static void add_edges(const Vertex& u, - const Vertex& v, GRAPHVIZ_GRAPH& g) { + const Vertex& v, GRAPHVIZ_GRAPH& g) { graphviz::current_edge = boost::add_edge(u, v, g).first; graphviz::set_attribute(g, EDGE_A, false); } static void add_edges(Subgraph* G1, Subgraph* G2, - GRAPHVIZ_GRAPH& g) { + GRAPHVIZ_GRAPH& g) { boost::graph_traits::vertex_iterator i, j, m, n; for ( boost::tie(i, j) = boost::vertices(*G1); i != j; ++i) { - for ( boost::tie(m, n) = boost::vertices(*G2); m != n; ++m) { - graphviz::add_edges(G1->local_to_global(*i), - G2->local_to_global(*m), g); - } + for ( boost::tie(m, n) = boost::vertices(*G2); m != n; ++m) { + graphviz::add_edges(G1->local_to_global(*i), + G2->local_to_global(*m), g); + } } } static void add_edges(Subgraph* G, const Vertex& v, GRAPHVIZ_GRAPH& g) { boost::graph_traits::vertex_iterator i, j; for ( boost::tie(i, j) = boost::vertices(*G); i != j; ++i) { - graphviz::add_edges(G->local_to_global(*i), v, g); + graphviz::add_edges(G->local_to_global(*i), v, g); } } static void add_edges(const Vertex& u, Subgraph* G, GRAPHVIZ_GRAPH& g) { boost::graph_traits::vertex_iterator i, j; for ( boost::tie(i, j) = boost::vertices(*G); i != j; ++i) { - graphviz::add_edges(u, G->local_to_global(*i), g); + graphviz::add_edges(u, G->local_to_global(*i), g); } } @@ -242,7 +242,7 @@ static void set_graph_name(const std::string& name) { boost::graph_property::type& - gea = boost::get_property(*current_graph, boost::graph_name); + gea = boost::get_property(*current_graph, boost::graph_name); gea = name; } @@ -258,9 +258,9 @@ -#define YYFINAL 66 -#define YYFLAG -32768 -#define YYNTBASE 18 +#define YYFINAL 66 +#define YYFLAG -32768 +#define YYNTBASE 18 #define YYTRANSLATE(x) ((unsigned)(x) <= 263 ? yytranslate[x] : 45) @@ -392,7 +392,7 @@ static const short yypgoto[] = {-32768, }; -#define YYLAST 56 +#define YYLAST 56 static const short yytable[] = { 50, @@ -463,7 +463,7 @@ static const short yycheck[] = { 36, since that symbol is in the user namespace. */ #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) #if 0 /* No need for malloc.h, which pollutes the namespace; - instead, just don't use alloca. */ + instead, just don't use alloca. */ #include #endif #else /* not MSDOS, or __TURBOC__ */ @@ -476,7 +476,7 @@ static const short yycheck[] = { 36, #else /* not MSDOS, or __TURBOC__, or _AIX */ #if 0 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, - and on HPUX 10. Eventually we can turn this on. */ + and on HPUX 10. Eventually we can turn this on. */ #define YYSTACK_USE_ALLOCA #define alloca __builtin_alloca #endif /* __hpux */ @@ -498,50 +498,50 @@ static const short yycheck[] = { 36, It is replaced by the list of actions, each action as one case of the switch. */ -#define yyerrok (yyerrstatus = 0) -#define yyclearin (bgl_dir_char = YYEMPTY) -#define YYEMPTY -2 -#define YYEOF 0 -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrlab1 +#define yyerrok (yyerrstatus = 0) +#define yyclearin (bgl_dir_char = YYEMPTY) +#define YYEMPTY -2 +#define YYEOF 0 +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrlab1 /* Like YYERROR except do call bgl_dir_error. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ -#define YYFAIL goto yyerrlab +#define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(token, value) \ -do \ - if (bgl_dir_char == YYEMPTY && yylen == 1) \ - { bgl_dir_char = (token), bgl_dir_lval = (value); \ - bgl_dir_char1 = YYTRANSLATE (bgl_dir_char); \ - YYPOPSTACK; \ - goto yybackup; \ - } \ - else \ - { bgl_dir_error ("syntax error: cannot back up"); YYERROR; } \ +do \ + if (bgl_dir_char == YYEMPTY && yylen == 1) \ + { bgl_dir_char = (token), bgl_dir_lval = (value); \ + bgl_dir_char1 = YYTRANSLATE (bgl_dir_char); \ + YYPOPSTACK; \ + goto yybackup; \ + } \ + else \ + { bgl_dir_error ("syntax error: cannot back up"); YYERROR; } \ while (0) -#define YYTERROR 1 -#define YYERRCODE 256 +#define YYTERROR 1 +#define YYERRCODE 256 #ifndef YYPURE -#define YYLEX bgl_dir_lex() +#define YYLEX bgl_dir_lex() #endif #ifdef YYPURE #ifdef YYLSP_NEEDED #ifdef YYLEX_PARAM -#define YYLEX bgl_dir_lex(&bgl_dir_lval, &yylloc, YYLEX_PARAM) +#define YYLEX bgl_dir_lex(&bgl_dir_lval, &yylloc, YYLEX_PARAM) #else -#define YYLEX bgl_dir_lex(&bgl_dir_lval, &yylloc) +#define YYLEX bgl_dir_lex(&bgl_dir_lval, &yylloc) #endif #else /* not YYLSP_NEEDED */ #ifdef YYLEX_PARAM -#define YYLEX bgl_dir_lex(&bgl_dir_lval, YYLEX_PARAM) +#define YYLEX bgl_dir_lex(&bgl_dir_lval, YYLEX_PARAM) #else -#define YYLEX bgl_dir_lex(&bgl_dir_lval) +#define YYLEX bgl_dir_lex(&bgl_dir_lval) #endif #endif /* not YYLSP_NEEDED */ #endif @@ -550,27 +550,27 @@ while (0) #ifndef YYPURE -int bgl_dir_char; /* the lookahead symbol */ -YYSTYPE bgl_dir_lval; /* the semantic value of the */ - /* lookahead symbol */ +int bgl_dir_char; /* the lookahead symbol */ +YYSTYPE bgl_dir_lval; /* the semantic value of the */ + /* lookahead symbol */ #ifdef YYLSP_NEEDED -YYLTYPE yylloc; /* location data for the lookahead */ - /* symbol */ +YYLTYPE yylloc; /* location data for the lookahead */ + /* symbol */ #endif -int bgl_dir_nerrs; /* number of parse errors so far */ +int bgl_dir_nerrs; /* number of parse errors so far */ #endif /* not YYPURE */ #if YYDEBUG != 0 -int bgl_dir_debug; /* nonzero means print parse trace */ +int bgl_dir_debug; /* nonzero means print parse trace */ /* Since this is uninitialized, it does not stop multiple parsers from coexisting. */ #endif -/* YYINITDEPTH indicates the initial size of the parser's stacks */ +/* YYINITDEPTH indicates the initial size of the parser's stacks */ -#ifndef YYINITDEPTH +#ifndef YYINITDEPTH #define YYINITDEPTH 200 #endif @@ -590,9 +590,9 @@ int bgl_dir_debug; /* nonzero means print parse trace */ definitions require. With GCC, __builtin_memcpy takes an arg of type size_t, but it can handle unsigned int. */ -#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ -#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) -#else /* not GNU C or C++ */ +#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ +#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) +#else /* not GNU C or C++ */ #ifndef __cplusplus /* This is the most reliable way to avoid incompatibilities @@ -667,17 +667,17 @@ yyparse(YYPARSE_PARAM_ARG) register int yyn; register short *yyssp; register YYSTYPE *yyvsp; - int yyerrstatus; /* number of tokens to shift before error messages enabled */ - int bgl_dir_char1 = 0; /* lookahead token as an internal (translated) token number */ + int yyerrstatus; /* number of tokens to shift before error messages enabled */ + int bgl_dir_char1 = 0; /* lookahead token as an internal (translated) token number */ - short yyssa[YYINITDEPTH]; /* the state stack */ - YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ + short yyssa[YYINITDEPTH]; /* the state stack */ + YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ - short *yyss = yyssa; /* refer to the stacks thru separate pointers */ - YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ + short *yyss = yyssa; /* refer to the stacks thru separate pointers */ + YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ #ifdef YYLSP_NEEDED - YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ + YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ YYLTYPE *yyls = yylsa; YYLTYPE *yylsp; @@ -698,9 +698,9 @@ yyparse(YYPARSE_PARAM_ARG) #endif #endif - YYSTYPE yyval; /* the variable used to return */ - /* semantic values from the action */ - /* routines */ + YYSTYPE yyval; /* the variable used to return */ + /* semantic values from the action */ + /* routines */ int yylen; @@ -712,7 +712,7 @@ yyparse(YYPARSE_PARAM_ARG) yystate = 0; yyerrstatus = 0; bgl_dir_nerrs = 0; - bgl_dir_char = YYEMPTY; /* Cause a token to be read. */ + bgl_dir_char = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack @@ -747,20 +747,20 @@ yynewstate: #ifdef yyoverflow /* Each stack pointer address is followed by the size of - the data in use in that stack, in bytes. */ + the data in use in that stack, in bytes. */ #ifdef YYLSP_NEEDED /* This used to be a conditional around just the two extra args, - but that might be undefined if yyoverflow is a macro. */ + but that might be undefined if yyoverflow is a macro. */ yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yyls1, size * sizeof (*yylsp), - &yystacksize); + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yyls1, size * sizeof (*yylsp), + &yystacksize); #else yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yystacksize); + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yystacksize); #endif yyss = yyss1; yyvs = yyvs1; @@ -770,34 +770,34 @@ yynewstate: #else /* no yyoverflow */ /* Extend the stack our own way. */ if (yystacksize >= YYMAXDEPTH) - { - bgl_dir_error("parser stack overflow"); - if (yyfree_stacks) - { - free (yyss); - free (yyvs); + { + bgl_dir_error("parser stack overflow"); + if (yyfree_stacks) + { + free (yyss); + free (yyvs); #ifdef YYLSP_NEEDED - free (yyls); + free (yyls); #endif - } - return 2; - } + } + return 2; + } yystacksize *= 2; if (yystacksize > YYMAXDEPTH) - yystacksize = YYMAXDEPTH; + yystacksize = YYMAXDEPTH; #ifndef YYSTACK_USE_ALLOCA yyfree_stacks = 1; #endif yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); __yy_memcpy ((char *)yyss, (char *)yyss1, - size * (unsigned int) sizeof (*yyssp)); + size * (unsigned int) sizeof (*yyssp)); yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); __yy_memcpy ((char *)yyvs, (char *)yyvs1, - size * (unsigned int) sizeof (*yyvsp)); + size * (unsigned int) sizeof (*yyvsp)); #ifdef YYLSP_NEEDED yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); __yy_memcpy ((char *)yyls, (char *)yyls1, - size * (unsigned int) sizeof (*yylsp)); + size * (unsigned int) sizeof (*yylsp)); #endif #endif /* no yyoverflow */ @@ -809,11 +809,11 @@ yynewstate: #if YYDEBUG != 0 if (bgl_dir_debug) - fprintf(stderr, "Stack size increased to %d\n", yystacksize); + fprintf(stderr, "Stack size increased to %d\n", yystacksize); #endif if (yyssp >= yyss + yystacksize - 1) - YYABORT; + YYABORT; } #if YYDEBUG != 0 @@ -843,21 +843,21 @@ yynewstate: { #if YYDEBUG != 0 if (bgl_dir_debug) - fprintf(stderr, "Reading a token: "); + fprintf(stderr, "Reading a token: "); #endif bgl_dir_char = YYLEX; } /* Convert token to internal form (in bgl_dir_char1) for indexing tables with */ - if (bgl_dir_char <= 0) /* This means end of input. */ + if (bgl_dir_char <= 0) /* This means end of input. */ { bgl_dir_char1 = 0; - bgl_dir_char = YYEOF; /* Don't call YYLEX any more */ + bgl_dir_char = YYEOF; /* Don't call YYLEX any more */ #if YYDEBUG != 0 if (bgl_dir_debug) - fprintf(stderr, "Now at end of input.\n"); + fprintf(stderr, "Now at end of input.\n"); #endif } else @@ -866,15 +866,15 @@ yynewstate: #if YYDEBUG != 0 if (bgl_dir_debug) - { - fprintf (stderr, "Next token is %d (%s", bgl_dir_char, yytname[bgl_dir_char1]); - /* Give the individual parser a way to print the precise meaning - of a token, for further debugging info. */ + { + fprintf (stderr, "Next token is %d (%s", bgl_dir_char, yytname[bgl_dir_char1]); + /* Give the individual parser a way to print the precise meaning + of a token, for further debugging info. */ #ifdef YYPRINT - YYPRINT (stderr, bgl_dir_char, bgl_dir_lval); + YYPRINT (stderr, bgl_dir_char, bgl_dir_lval); #endif - fprintf (stderr, ")\n"); - } + fprintf (stderr, ")\n"); + } #endif } @@ -894,7 +894,7 @@ yynewstate: if (yyn < 0) { if (yyn == YYFLAG) - goto yyerrlab; + goto yyerrlab; yyn = -yyn; goto yyreduce; } @@ -945,11 +945,11 @@ yyreduce: int i; fprintf (stderr, "Reducing via rule %d (line %d), ", - yyn, yyrline[yyn]); + yyn, yyrline[yyn]); /* Print the symbols being reduced, and their result. */ for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) - fprintf (stderr, "%s ", yytname[yyrhs[i]]); + fprintf (stderr, "%s ", yytname[yyrhs[i]]); fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); } #endif @@ -983,7 +983,7 @@ case 14: #line 279 "graphviz_parser.y" { graphviz::set_attribute(*graphviz::current_graph, - graphviz::attribute_state); + graphviz::attribute_state); ; break;} case 15: @@ -1017,7 +1017,7 @@ case 28: { graphviz::set_attribute( *static_cast(graphviz::current_graph), - GRAPH_GRAPH_A); + GRAPH_GRAPH_A); ; break;} case 29: @@ -1026,7 +1026,7 @@ case 29: graphviz::Vertex* temp = static_cast(yyvsp[-1].ptr); graphviz::current_vertex = *temp; graphviz::set_attribute(*static_cast(YYPARSE_PARAM), - NODE_A); + NODE_A); delete temp; yyval.i = 0; ; @@ -1047,7 +1047,7 @@ case 32: if (result.second) { graphviz::current_vertex = result.first->second; if (! graphviz::current_graph->is_root()) - boost::add_vertex(graphviz::current_vertex, *graphviz::current_graph); + boost::add_vertex(graphviz::current_vertex, *graphviz::current_graph); } else graphviz::current_vertex = graphviz::add_name(*name, *static_cast(YYPARSE_PARAM)) ; graphviz::Vertex* temp = new graphviz::Vertex(graphviz::current_vertex); @@ -1087,27 +1087,27 @@ case 35: Ptr source = static_cast(yyvsp[-2].ptr); for (std::vector::iterator it=graphviz::vlist.begin(); - it !=graphviz::vlist.end(); ++it) { + it !=graphviz::vlist.end(); ++it) { if ( source->second ) { - if ( (*it)->second ) - graphviz::add_edges(static_cast(source->first), - static_cast((*it)->first), - *static_cast(YYPARSE_PARAM)); - else - graphviz::add_edges(static_cast(source->first), - *static_cast((*it)->first), - *static_cast(YYPARSE_PARAM)); + if ( (*it)->second ) + graphviz::add_edges(static_cast(source->first), + static_cast((*it)->first), + *static_cast(YYPARSE_PARAM)); + else + graphviz::add_edges(static_cast(source->first), + *static_cast((*it)->first), + *static_cast(YYPARSE_PARAM)); } else { - graphviz::Vertex* temp = static_cast(source->first); - if ( (*it)->second ) - graphviz::add_edges(*temp, - static_cast((*it)->first), - *static_cast(YYPARSE_PARAM)); - else - graphviz::add_edges(*temp, - *static_cast((*it)->first), - *static_cast(YYPARSE_PARAM)); - delete temp; + graphviz::Vertex* temp = static_cast(source->first); + if ( (*it)->second ) + graphviz::add_edges(*temp, + static_cast((*it)->first), + *static_cast(YYPARSE_PARAM)); + else + graphviz::add_edges(*temp, + *static_cast((*it)->first), + *static_cast(YYPARSE_PARAM)); + delete temp; } delete source; @@ -1222,7 +1222,7 @@ case 46: short *ssp1 = yyss - 1; fprintf (stderr, "state stack now"); while (ssp1 != yyssp) - fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, " %d", *++ssp1); fprintf (stderr, "\n"); } #endif @@ -1272,44 +1272,44 @@ yyerrlab: /* here on detecting error */ yyn = yypact[yystate]; if (yyn > YYFLAG && yyn < YYLAST) - { - int size = 0; - char *msg; - int x, count; + { + int size = 0; + char *msg; + int x, count; - count = 0; - /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - size += strlen(yytname[x]) + 15, count++; - msg = (char *) malloc(size + 15); - if (msg != 0) - { - strcpy(msg, "parse error"); + count = 0; + /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + size += strlen(yytname[x]) + 15, count++; + msg = (char *) malloc(size + 15); + if (msg != 0) + { + strcpy(msg, "parse error"); - if (count < 5) - { - count = 0; - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - { - strcat(msg, count == 0 ? ", expecting `" : " or `"); - strcat(msg, yytname[x]); - strcat(msg, "'"); - count++; - } - } - bgl_dir_error(msg); - free(msg); - } - else - bgl_dir_error ("parse error; also virtual memory exceeded"); - } + if (count < 5) + { + count = 0; + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + { + strcat(msg, count == 0 ? ", expecting `" : " or `"); + strcat(msg, yytname[x]); + strcat(msg, "'"); + count++; + } + } + bgl_dir_error(msg); + free(msg); + } + else + bgl_dir_error ("parse error; also virtual memory exceeded"); + } else #endif /* YYERROR_VERBOSE */ - bgl_dir_error("parse error"); + bgl_dir_error("parse error"); } goto yyerrlab1; @@ -1321,11 +1321,11 @@ yyerrlab1: /* here on error raised explicitly by an action */ /* return failure if at end of input */ if (bgl_dir_char == YYEOF) - YYABORT; + YYABORT; #if YYDEBUG != 0 if (bgl_dir_debug) - fprintf(stderr, "Discarding token %d (%s).\n", bgl_dir_char, yytname[bgl_dir_char1]); + fprintf(stderr, "Discarding token %d (%s).\n", bgl_dir_char, yytname[bgl_dir_char1]); #endif bgl_dir_char = YYEMPTY; @@ -1334,7 +1334,7 @@ yyerrlab1: /* here on error raised explicitly by an action */ /* Else will try to reuse lookahead token after shifting the error token. */ - yyerrstatus = 3; /* Each real token shifted decrements this */ + yyerrstatus = 3; /* Each real token shifted decrements this */ goto yyerrhandle; @@ -1362,7 +1362,7 @@ yyerrpop: /* pop the current state because it cannot handle the error token */ short *ssp1 = yyss - 1; fprintf (stderr, "Error: state stack now"); while (ssp1 != yyssp) - fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, " %d", *++ssp1); fprintf (stderr, "\n"); } #endif @@ -1381,7 +1381,7 @@ yyerrhandle: if (yyn < 0) { if (yyn == YYFLAG) - goto yyerrpop; + goto yyerrpop; yyn = -yyn; goto yyreduce; } diff --git a/src/graphviz_graph_lex.cpp b/src/graphviz_graph_lex.cpp index d382adbf..ee3f9e55 100644 --- a/src/graphviz_graph_lex.cpp +++ b/src/graphviz_graph_lex.cpp @@ -34,15 +34,15 @@ /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST -#else /* ! __cplusplus */ +#else /* ! __cplusplus */ #if __STDC__ #define YY_USE_PROTOS #define YY_USE_CONST -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ +#endif /* __STDC__ */ +#endif /* ! __cplusplus */ #ifdef __TURBOC__ #pragma warn -rch @@ -113,10 +113,10 @@ extern FILE *bgl_undir_in, *bgl_undir_out; * int a single C statement (which needs a semi-colon terminator). This * avoids problems with code like: * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); + * if ( condition_holds ) + * yyless( 5 ); + * else + * do_something_else(); * * Prior to using the do-while the compiler would get upset at the * "else" because it interpreted the "if" statement as being all @@ -126,15 +126,15 @@ extern FILE *bgl_undir_in, *bgl_undir_out; /* Return all but the first 'n' matched characters back to the input stream. */ #define yyless(n) \ - do \ - { \ - /* Undo effects of setting up bgl_undir_text. */ \ - *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up bgl_undir_text again */ \ - } \ - while ( 0 ) + do \ + { \ + /* Undo effects of setting up bgl_undir_text. */ \ + *yy_cp = yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up bgl_undir_text again */ \ + } \ + while ( 0 ) #define unput(c) yyunput( c, bgl_undir_text_ptr ) @@ -146,61 +146,61 @@ typedef unsigned int yy_size_t; struct yy_buffer_state - { - FILE *yy_input_file; + { + FILE *yy_input_file; - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; - int yy_buffer_status; + int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via bgl_undir_restart()), so that the user can continue scanning by - * just pointing bgl_undir_in at a new input file. - */ + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via bgl_undir_restart()), so that the user can continue scanning by + * just pointing bgl_undir_in at a new input file. + */ #define YY_BUFFER_EOF_PENDING 2 - }; + }; static YY_BUFFER_STATE yy_current_buffer = 0; @@ -214,15 +214,15 @@ static YY_BUFFER_STATE yy_current_buffer = 0; /* yy_hold_char holds the character lost when bgl_undir_text is formed. */ static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ +static int yy_n_chars; /* number of characters read into yy_ch_buf */ int bgl_undir_leng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ +static int yy_init = 1; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh bgl_undir_in. A bit of a hack ... @@ -250,18 +250,18 @@ static void yy_flex_free YY_PROTO(( void * )); #define yy_new_buffer bgl_undir_create_buffer #define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = bgl_undir_create_buffer( bgl_undir_in, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = bgl_undir_create_buffer( bgl_undir_in, YY_BUF_SIZE ); \ + yy_current_buffer->yy_is_interactive = is_interactive; \ + } #define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = bgl_undir_create_buffer( bgl_undir_in, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = bgl_undir_create_buffer( bgl_undir_in, YY_BUF_SIZE ); \ + yy_current_buffer->yy_at_bol = at_bol; \ + } #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) @@ -283,11 +283,11 @@ static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); * corresponding action - sets up bgl_undir_text. */ #define YY_DO_BEFORE_ACTION \ - bgl_undir_text_ptr = yy_bp; \ - bgl_undir_leng = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; + bgl_undir_text_ptr = yy_bp; \ + bgl_undir_leng = (int) (yy_cp - yy_bp); \ + yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yy_c_buf_p = yy_cp; #define YY_NUM_RULES 21 #define YY_END_OF_BUFFER 22 @@ -563,21 +563,21 @@ YY_MALLOC_DECL */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( bgl_undir_in )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( bgl_undir_in ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else if ( ((result = fread( buf, 1, max_size, bgl_undir_in )) == 0) \ - && ferror( bgl_undir_in ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); + if ( yy_current_buffer->yy_is_interactive ) \ + { \ + int c = '*', n; \ + for ( n = 0; n < max_size && \ + (c = getc( bgl_undir_in )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( bgl_undir_in ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else if ( ((result = fread( buf, 1, max_size, bgl_undir_in )) == 0) \ + && ferror( bgl_undir_in ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - @@ -618,115 +618,115 @@ YY_MALLOC_DECL #endif #define YY_RULE_SETUP \ - YY_USER_ACTION + YY_USER_ACTION YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp = NULL, *yy_bp = NULL; - register int yy_act; + { + register yy_state_type yy_current_state; + register char *yy_cp = NULL, *yy_bp = NULL; + register int yy_act; #line 51 "graphviz_lex.l" #line 629 "lex.yy.c" - if ( yy_init ) - { - yy_init = 0; + if ( yy_init ) + { + yy_init = 0; #ifdef YY_USER_INIT - YY_USER_INIT; + YY_USER_INIT; #endif - if ( ! yy_start ) - yy_start = 1; /* first start state */ + if ( ! yy_start ) + yy_start = 1; /* first start state */ - if ( ! bgl_undir_in ) - bgl_undir_in = stdin; + if ( ! bgl_undir_in ) + bgl_undir_in = stdin; - if ( ! bgl_undir_out ) - bgl_undir_out = stdout; + if ( ! bgl_undir_out ) + bgl_undir_out = stdout; - if ( ! yy_current_buffer ) - yy_current_buffer = - bgl_undir_create_buffer( bgl_undir_in, YY_BUF_SIZE ); + if ( ! yy_current_buffer ) + yy_current_buffer = + bgl_undir_create_buffer( bgl_undir_in, YY_BUF_SIZE ); - bgl_undir_load_buffer_state(); - } + bgl_undir_load_buffer_state(); + } - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = yy_c_buf_p; + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = yy_c_buf_p; - /* Support of bgl_undir_text. */ - *yy_cp = yy_hold_char; + /* Support of bgl_undir_text. */ + *yy_cp = yy_hold_char; - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; - yy_current_state = yy_start; + yy_current_state = yy_start; yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 81 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 169 ); + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 81 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 169 ); yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - yy_act = yy_accept[yy_current_state]; - } + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = yy_last_accepting_cpos; + yy_current_state = yy_last_accepting_state; + yy_act = yy_accept[yy_current_state]; + } - YY_DO_BEFORE_ACTION; + YY_DO_BEFORE_ACTION; -do_action: /* This label is used only to access EOF actions. */ +do_action: /* This label is used only to access EOF actions. */ - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yy_hold_char; - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - goto yy_find_action; + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yy_hold_char; + yy_cp = yy_last_accepting_cpos; + yy_current_state = yy_last_accepting_state; + goto yy_find_action; case 1: YY_RULE_SETUP #line 53 "graphviz_lex.l" { BEGIN Comment; } - YY_BREAK + YY_BREAK case 2: YY_RULE_SETUP #line 54 "graphviz_lex.l" { BEGIN INITIAL; } - YY_BREAK + YY_BREAK case 3: YY_RULE_SETUP #line 55 "graphviz_lex.l" ; - YY_BREAK + YY_BREAK case 4: *yy_cp = yy_hold_char; /* undo effects of setting up bgl_undir_text */ yy_c_buf_p = yy_cp -= 1; @@ -734,7 +734,7 @@ YY_DO_BEFORE_ACTION; /* set up bgl_undir_text again */ YY_RULE_SETUP #line 56 "graphviz_lex.l" ; - YY_BREAK + YY_BREAK case 5: *yy_cp = yy_hold_char; /* undo effects of setting up bgl_undir_text */ yy_c_buf_p = yy_cp -= 1; @@ -742,395 +742,395 @@ YY_DO_BEFORE_ACTION; /* set up bgl_undir_text again */ YY_RULE_SETUP #line 57 "graphviz_lex.l" ; - YY_BREAK + YY_BREAK case 6: YY_RULE_SETUP #line 58 "graphviz_lex.l" { return DIGRAPH_T; } - YY_BREAK + YY_BREAK case 7: YY_RULE_SETUP #line 59 "graphviz_lex.l" { return GRAPH_T; } - YY_BREAK + YY_BREAK case 8: YY_RULE_SETUP #line 60 "graphviz_lex.l" { return NODE_T; } - YY_BREAK + YY_BREAK case 9: YY_RULE_SETUP #line 61 "graphviz_lex.l" { return EDGE_T; } - YY_BREAK + YY_BREAK case 10: YY_RULE_SETUP #line 62 "graphviz_lex.l" ; - YY_BREAK + YY_BREAK case 11: YY_RULE_SETUP #line 63 "graphviz_lex.l" { return SUBGRAPH_T; } - YY_BREAK + YY_BREAK case 12: YY_RULE_SETUP #line 64 "graphviz_lex.l" { return EDGEOP_T; } - YY_BREAK + YY_BREAK case 13: YY_RULE_SETUP #line 65 "graphviz_lex.l" { lvalp->ptr = (void*)(new std::string(bgl_undir_text)); return ID_T; } - YY_BREAK + YY_BREAK case 14: YY_RULE_SETUP #line 66 "graphviz_lex.l" { BEGIN Literal; begin_literal(); } - YY_BREAK + YY_BREAK case 15: YY_RULE_SETUP #line 67 "graphviz_lex.l" { BEGIN INITIAL; end_literal(); lvalp->ptr = (void*)(new std::string(literal)); return ID_T; } - YY_BREAK + YY_BREAK case 16: YY_RULE_SETUP #line 68 "graphviz_lex.l" ; - YY_BREAK + YY_BREAK case 17: YY_RULE_SETUP #line 69 "graphviz_lex.l" { add_string(bgl_undir_text); } - YY_BREAK + YY_BREAK case 18: YY_RULE_SETUP #line 70 "graphviz_lex.l" ; - YY_BREAK + YY_BREAK case 19: YY_RULE_SETUP #line 71 "graphviz_lex.l" ; - YY_BREAK + YY_BREAK case 20: YY_RULE_SETUP #line 72 "graphviz_lex.l" { return bgl_undir_text[0]; } - YY_BREAK + YY_BREAK case 21: YY_RULE_SETUP #line 73 "graphviz_lex.l" ECHO; - YY_BREAK + YY_BREAK #line 823 "lex.yy.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(Comment): case YY_STATE_EOF(Literal): - yyterminate(); + yyterminate(); - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - bgl_undir_text_ptr) - 1; + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - bgl_undir_text_ptr) - 1; - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed bgl_undir_in at a new source and called - * bgl_undir_lex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = bgl_undir_in; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed bgl_undir_in at a new source and called + * bgl_undir_lex(). If so, then we have to assure + * consistency between yy_current_buffer and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yy_n_chars = yy_current_buffer->yy_n_chars; + yy_current_buffer->yy_input_file = bgl_undir_in; + yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; + } - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; - yy_c_buf_p = bgl_undir_text_ptr + yy_amount_of_matched_text; + yy_c_buf_p = bgl_undir_text_ptr + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state(); + yy_current_state = yy_get_previous_state(); - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ - yy_next_state = yy_try_NUL_trans( yy_current_state ); + yy_next_state = yy_try_NUL_trans( yy_current_state ); - yy_bp = bgl_undir_text_ptr + YY_MORE_ADJ; + yy_bp = bgl_undir_text_ptr + YY_MORE_ADJ; - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } + else + { + yy_cp = yy_c_buf_p; + goto yy_find_action; + } + } - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; + else switch ( yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + yy_did_buffer_switch_on_eof = 0; - if ( yywrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * bgl_undir_text, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = bgl_undir_text_ptr + YY_MORE_ADJ; + if ( yywrap() ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * bgl_undir_text, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yy_c_buf_p = bgl_undir_text_ptr + YY_MORE_ADJ; - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } + else + { + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - bgl_undir_text_ptr + yy_amount_of_matched_text; + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = + bgl_undir_text_ptr + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state(); + yy_current_state = yy_get_previous_state(); - yy_cp = yy_c_buf_p; - yy_bp = bgl_undir_text_ptr + YY_MORE_ADJ; - goto yy_match; + yy_cp = yy_c_buf_p; + yy_bp = bgl_undir_text_ptr + YY_MORE_ADJ; + goto yy_match; - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; + case EOB_ACT_LAST_MATCH: + yy_c_buf_p = + &yy_current_buffer->yy_ch_buf[yy_n_chars]; - yy_current_state = yy_get_previous_state(); + yy_current_state = yy_get_previous_state(); - yy_cp = yy_c_buf_p; - yy_bp = bgl_undir_text_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } + yy_cp = yy_c_buf_p; + yy_bp = bgl_undir_text_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of bgl_undir_lex */ + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of bgl_undir_lex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = bgl_undir_text_ptr; - register int number_to_move, i; - int ret_val; + { + register char *dest = yy_current_buffer->yy_ch_buf; + register char *source = bgl_undir_text_ptr; + register int number_to_move, i; + int ret_val; - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - bgl_undir_text_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } + if ( yy_current_buffer->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yy_c_buf_p - bgl_undir_text_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } - /* Try to read more data. */ + /* Try to read more data. */ - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - bgl_undir_text_ptr) - 1; + /* First move last chars to start of buffer. */ + number_to_move = (int) (yy_c_buf_p - bgl_undir_text_ptr) - 1; - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + yy_current_buffer->yy_n_chars = yy_n_chars = 0; - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; + else + { + int num_to_read = + yy_current_buffer->yy_buf_size - number_to_move - 1; - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ #ifdef YY_USES_REJECT - YY_FATAL_ERROR( + YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); #else - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = yy_current_buffer; - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); + int yy_c_buf_p_offset = + (int) (yy_c_buf_p - b->yy_ch_buf); - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; + num_to_read = yy_current_buffer->yy_buf_size - + number_to_move - 1; #endif - } + } - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); + /* Read in more data. */ + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); - yy_current_buffer->yy_n_chars = yy_n_chars; - } + yy_current_buffer->yy_n_chars = yy_n_chars; + } - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - bgl_undir_restart( bgl_undir_in ); - } + if ( yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + bgl_undir_restart( bgl_undir_in ); + } - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } + else + { + ret_val = EOB_ACT_LAST_MATCH; + yy_current_buffer->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } - else - ret_val = EOB_ACT_CONTINUE_SCAN; + else + ret_val = EOB_ACT_CONTINUE_SCAN; - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + yy_n_chars += number_to_move; + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - bgl_undir_text_ptr = &yy_current_buffer->yy_ch_buf[0]; + bgl_undir_text_ptr = &yy_current_buffer->yy_ch_buf[0]; - return ret_val; - } + return ret_val; + } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state() - { - register yy_state_type yy_current_state; - register char *yy_cp; + { + register yy_state_type yy_current_state; + register char *yy_cp; - yy_current_state = yy_start; + yy_current_state = yy_start; - for ( yy_cp = bgl_undir_text_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 81 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } + for ( yy_cp = bgl_undir_text_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 81 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } - return yy_current_state; - } + return yy_current_state; + } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis - * next_state = yy_try_NUL_trans( current_state ); + * next_state = yy_try_NUL_trans( current_state ); */ #ifdef YY_USE_PROTOS @@ -1139,27 +1139,27 @@ static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) static yy_state_type yy_try_NUL_trans( yy_current_state ) yy_state_type yy_current_state; #endif - { - register int yy_is_jam; - register char *yy_cp = yy_c_buf_p; + { + register int yy_is_jam; + register char *yy_cp = yy_c_buf_p; - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 81 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 80); + register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 81 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 80); - return yy_is_jam ? 0 : yy_current_state; - } + return yy_is_jam ? 0 : yy_current_state; + } #ifndef YY_NO_UNPUT @@ -1170,41 +1170,41 @@ static void yyunput( c, yy_bp ) int c; register char *yy_bp; #endif - { - register char *yy_cp = yy_c_buf_p; + { + register char *yy_cp = yy_c_buf_p; - /* undo effects of setting up bgl_undir_text */ - *yy_cp = yy_hold_char; + /* undo effects of setting up bgl_undir_text */ + *yy_cp = yy_hold_char; - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = yy_n_chars + 2; + register char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; + register char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; + while ( source > yy_current_buffer->yy_ch_buf ) + *--dest = *--source; - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + yy_current_buffer->yy_n_chars = + yy_n_chars = yy_current_buffer->yy_buf_size; - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } - *--yy_cp = (char) c; + *--yy_cp = (char) c; - bgl_undir_text_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ + bgl_undir_text_ptr = yy_bp; + yy_hold_char = *yy_cp; + yy_c_buf_p = yy_cp; + } +#endif /* ifndef YY_NO_UNPUT */ #ifdef __cplusplus @@ -1212,72 +1212,72 @@ static int bgl_undir_input() #else static int input() #endif - { - int c; + { + int c; - *yy_c_buf_p = yy_hold_char; + *yy_c_buf_p = yy_hold_char; - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; + if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + /* This was really a NUL. */ + *yy_c_buf_p = '\0'; - else - { /* need more input */ - int offset = yy_c_buf_p - bgl_undir_text_ptr; - ++yy_c_buf_p; + else + { /* need more input */ + int offset = yy_c_buf_p - bgl_undir_text_ptr; + ++yy_c_buf_p; - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ + switch ( yy_get_next_buffer() ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ - /* Reset buffer status. */ - bgl_undir_restart( bgl_undir_in ); + /* Reset buffer status. */ + bgl_undir_restart( bgl_undir_in ); - /* fall through */ + /* fall through */ - case EOB_ACT_END_OF_FILE: - { - if ( yywrap() ) - return EOF; + case EOB_ACT_END_OF_FILE: + { + if ( yywrap() ) + return EOF; - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; #ifdef __cplusplus - return bgl_undir_input(); + return bgl_undir_input(); #else - return input(); + return input(); #endif - } + } - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = bgl_undir_text_ptr + offset; - break; - } - } - } + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = bgl_undir_text_ptr + offset; + break; + } + } + } - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve bgl_undir_text */ - yy_hold_char = *++yy_c_buf_p; + c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ + *yy_c_buf_p = '\0'; /* preserve bgl_undir_text */ + yy_hold_char = *++yy_c_buf_p; - return c; - } + return c; + } #ifdef YY_USE_PROTOS @@ -1286,13 +1286,13 @@ void bgl_undir_restart( FILE *input_file ) void bgl_undir_restart( input_file ) FILE *input_file; #endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = bgl_undir_create_buffer( bgl_undir_in, YY_BUF_SIZE ); + { + if ( ! yy_current_buffer ) + yy_current_buffer = bgl_undir_create_buffer( bgl_undir_in, YY_BUF_SIZE ); - bgl_undir_init_buffer( yy_current_buffer, input_file ); - bgl_undir_load_buffer_state(); - } + bgl_undir_init_buffer( yy_current_buffer, input_file ); + bgl_undir_load_buffer_state(); + } #ifdef YY_USE_PROTOS @@ -1301,28 +1301,28 @@ void bgl_undir_switch_to_buffer( YY_BUFFER_STATE new_buffer ) void bgl_undir_switch_to_buffer( new_buffer ) YY_BUFFER_STATE new_buffer; #endif - { - if ( yy_current_buffer == new_buffer ) - return; + { + if ( yy_current_buffer == new_buffer ) + return; - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } + if ( yy_current_buffer ) + { + /* Flush out information for old buffer. */ + *yy_c_buf_p = yy_hold_char; + yy_current_buffer->yy_buf_pos = yy_c_buf_p; + yy_current_buffer->yy_n_chars = yy_n_chars; + } - yy_current_buffer = new_buffer; - bgl_undir_load_buffer_state(); + yy_current_buffer = new_buffer; + bgl_undir_load_buffer_state(); - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yy_did_buffer_switch_on_eof = 1; + } #ifdef YY_USE_PROTOS @@ -1330,12 +1330,12 @@ void bgl_undir_load_buffer_state( void ) #else void bgl_undir_load_buffer_state() #endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - bgl_undir_text_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - bgl_undir_in = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } + { + yy_n_chars = yy_current_buffer->yy_n_chars; + bgl_undir_text_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; + bgl_undir_in = yy_current_buffer->yy_input_file; + yy_hold_char = *yy_c_buf_p; + } #ifdef YY_USE_PROTOS @@ -1345,28 +1345,28 @@ YY_BUFFER_STATE bgl_undir_create_buffer( file, size ) FILE *file; int size; #endif - { - YY_BUFFER_STATE b; + { + YY_BUFFER_STATE b; - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in bgl_undir_create_buffer()" ); + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in bgl_undir_create_buffer()" ); - b->yy_buf_size = size; + b->yy_buf_size = size; - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in bgl_undir_create_buffer()" ); + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in bgl_undir_create_buffer()" ); - b->yy_is_our_buffer = 1; + b->yy_is_our_buffer = 1; - bgl_undir_init_buffer( b, file ); + bgl_undir_init_buffer( b, file ); - return b; - } + return b; + } #ifdef YY_USE_PROTOS @@ -1375,18 +1375,18 @@ void bgl_undir_delete_buffer( YY_BUFFER_STATE b ) void bgl_undir_delete_buffer( b ) YY_BUFFER_STATE b; #endif - { - if ( ! b ) - return; + { + if ( ! b ) + return; - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; + if ( b == yy_current_buffer ) + yy_current_buffer = (YY_BUFFER_STATE) 0; - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); + if ( b->yy_is_our_buffer ) + yy_flex_free( (void *) b->yy_ch_buf ); - yy_flex_free( (void *) b ); - } + yy_flex_free( (void *) b ); + } @@ -1399,22 +1399,22 @@ FILE *file; #endif - { - bgl_undir_flush_buffer( b ); + { + bgl_undir_flush_buffer( b ); - b->yy_input_file = file; - b->yy_fill_buffer = 1; + b->yy_input_file = file; + b->yy_fill_buffer = 1; #if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; + b->yy_is_interactive = 1; #else #if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; + b->yy_is_interactive = 0; #else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; #endif #endif - } + } #ifdef YY_USE_PROTOS @@ -1424,27 +1424,27 @@ void bgl_undir_flush_buffer( b ) YY_BUFFER_STATE b; #endif - { - if ( ! b ) - return; + { + if ( ! b ) + return; - b->yy_n_chars = 0; + b->yy_n_chars = 0; - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - b->yy_buf_pos = &b->yy_ch_buf[0]; + b->yy_buf_pos = &b->yy_ch_buf[0]; - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; - if ( b == yy_current_buffer ) - bgl_undir_load_buffer_state(); - } + if ( b == yy_current_buffer ) + bgl_undir_load_buffer_state(); + } #ifndef YY_NO_SCAN_BUFFER @@ -1455,33 +1455,33 @@ YY_BUFFER_STATE bgl_undir_scan_buffer( base, size ) char *base; yy_size_t size; #endif - { - YY_BUFFER_STATE b; + { + YY_BUFFER_STATE b; - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in bgl_undir_scan_buffer()" ); + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in bgl_undir_scan_buffer()" ); - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; - bgl_undir_switch_to_buffer( b ); + bgl_undir_switch_to_buffer( b ); - return b; - } + return b; + } #endif @@ -1492,13 +1492,13 @@ YY_BUFFER_STATE bgl_undir_scan_string( yyconst char *yy_str ) YY_BUFFER_STATE bgl_undir_scan_string( yy_str ) yyconst char *yy_str; #endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; + { + int len; + for ( len = 0; yy_str[len]; ++len ) + ; - return bgl_undir_scan_bytes( yy_str, len ); - } + return bgl_undir_scan_bytes( yy_str, len ); + } #endif @@ -1510,34 +1510,34 @@ YY_BUFFER_STATE bgl_undir_scan_bytes( bytes, len ) yyconst char *bytes; int len; #endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; + { + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in bgl_undir_scan_bytes()" ); + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) yy_flex_alloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in bgl_undir_scan_bytes()" ); - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - b = bgl_undir_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in bgl_undir_scan_bytes()" ); + b = bgl_undir_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in bgl_undir_scan_bytes()" ); - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; - return b; - } + return b; + } #endif @@ -1548,49 +1548,49 @@ static void yy_push_state( int new_state ) static void yy_push_state( new_state ) int new_state; #endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; + { + if ( yy_start_stack_ptr >= yy_start_stack_depth ) + { + yy_size_t new_size; - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } - yy_start_stack[yy_start_stack_ptr++] = YY_START; + yy_start_stack[yy_start_stack_ptr++] = YY_START; - BEGIN(new_state); - } + BEGIN(new_state); + } #endif #ifndef YY_NO_POP_STATE static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } #endif #ifndef YY_NO_TOP_STATE static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } #endif #ifndef YY_EXIT_FAILURE @@ -1603,10 +1603,10 @@ static void yy_fatal_error( yyconst char msg[] ) static void yy_fatal_error( msg ) char msg[]; #endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } + { + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); + } @@ -1614,16 +1614,16 @@ char msg[]; #undef yyless #define yyless(n) \ - do \ - { \ - /* Undo effects of setting up bgl_undir_text. */ \ - bgl_undir_text[bgl_undir_leng] = yy_hold_char; \ - yy_c_buf_p = bgl_undir_text + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - bgl_undir_leng = n; \ - } \ - while ( 0 ) + do \ + { \ + /* Undo effects of setting up bgl_undir_text. */ \ + bgl_undir_text[bgl_undir_leng] = yy_hold_char; \ + yy_c_buf_p = bgl_undir_text + n; \ + yy_hold_char = *yy_c_buf_p; \ + *yy_c_buf_p = '\0'; \ + bgl_undir_leng = n; \ + } \ + while ( 0 ) /* Internal utility routines. */ @@ -1637,11 +1637,11 @@ char *s1; yyconst char *s2; int n; #endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } + { + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } #endif #ifdef YY_NEED_STRLEN @@ -1651,13 +1651,13 @@ static int yy_flex_strlen( yyconst char *s ) static int yy_flex_strlen( s ) yyconst char *s; #endif - { - register int n; - for ( n = 0; s[n]; ++n ) - ; + { + register int n; + for ( n = 0; s[n]; ++n ) + ; - return n; - } + return n; + } #endif @@ -1667,9 +1667,9 @@ static void *yy_flex_alloc( yy_size_t size ) static void *yy_flex_alloc( size ) yy_size_t size; #endif - { - return (void *) malloc( size ); - } + { + return (void *) malloc( size ); + } #ifdef YY_USE_PROTOS static void *yy_flex_realloc( void *ptr, yy_size_t size ) @@ -1678,16 +1678,16 @@ static void *yy_flex_realloc( ptr, size ) void *ptr; yy_size_t size; #endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } + { + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); + } #ifdef YY_USE_PROTOS static void yy_flex_free( void *ptr ) @@ -1695,16 +1695,16 @@ static void yy_flex_free( void *ptr ) static void yy_flex_free( ptr ) void *ptr; #endif - { - free( ptr ); - } + { + free( ptr ); + } #if YY_MAIN int main() - { - bgl_undir_lex(); - return 0; - } + { + bgl_undir_lex(); + return 0; + } #endif #line 73 "graphviz_lex.l" diff --git a/src/graphviz_graph_parser.cpp b/src/graphviz_graph_parser.cpp index f47d7046..a4c4b3a0 100644 --- a/src/graphviz_graph_parser.cpp +++ b/src/graphviz_graph_parser.cpp @@ -11,13 +11,13 @@ #define bgl_undir_char bgl_undir_char #define bgl_undir_debug bgl_undir_debug #define bgl_undir_nerrs bgl_undir_nerrs -#define GRAPH_T 257 -#define NODE_T 258 -#define EDGE_T 259 -#define DIGRAPH_T 260 -#define EDGEOP_T 261 -#define SUBGRAPH_T 262 -#define ID_T 263 +#define GRAPH_T 257 +#define NODE_T 258 +#define EDGE_T 259 +#define DIGRAPH_T 260 +#define EDGEOP_T 261 +#define SUBGRAPH_T 262 +#define ID_T 263 #line 1 "graphviz_parser.y" @@ -100,7 +100,7 @@ static const std::string& get_graph_name(const Subgraph& g) { const boost::graph_property::type& - name = boost::get_property(g, boost::graph_name); + name = boost::get_property(g, boost::graph_name); return name; } @@ -117,7 +117,7 @@ //set the label of vertex, it could be overwritten later. boost::property_map::type - va = boost::get(boost::vertex_attribute, g); + va = boost::get(boost::vertex_attribute, g); va[v]["label"] = name; //add v into the map so next time we will find it. @@ -141,85 +141,85 @@ static void set_attribute(GraphvizAttrList& p, - const GraphvizAttrList& attr) { + const GraphvizAttrList& attr) { GraphvizAttrList::const_iterator i, end; for ( i=attr.begin(), end=attr.end(); i!=end; ++i) - p[i->first]=i->second; + p[i->first]=i->second; } static void set_attribute(Subgraph& g, - AttrState s, bool clear_attribute = true) { + AttrState s, bool clear_attribute = true) { typedef Subgraph Graph; switch ( s ) { case GRAPH_GRAPH_A: - { - boost::graph_property::type& - gga = boost::get_property(g, boost::graph_graph_attribute); - set_attribute(gga, attributes); - } - break; + { + boost::graph_property::type& + gga = boost::get_property(g, boost::graph_graph_attribute); + set_attribute(gga, attributes); + } + break; case GRAPH_NODE_A: - { - boost::graph_property::type& - gna = boost::get_property(g, boost::graph_vertex_attribute); - set_attribute(gna, attributes); - } - break; + { + boost::graph_property::type& + gna = boost::get_property(g, boost::graph_vertex_attribute); + set_attribute(gna, attributes); + } + break; case GRAPH_EDGE_A: - { - boost::graph_property::type& - gea = boost::get_property(g, boost::graph_edge_attribute); - set_attribute(gea, attributes); - } - break; + { + boost::graph_property::type& + gea = boost::get_property(g, boost::graph_edge_attribute); + set_attribute(gea, attributes); + } + break; case NODE_A: - { - boost::property_map::type - va = boost::get(boost::vertex_attribute, g); //va[v] - set_attribute(va[current_vertex], attributes); - } - break; + { + boost::property_map::type + va = boost::get(boost::vertex_attribute, g); //va[v] + set_attribute(va[current_vertex], attributes); + } + break; case EDGE_A: - { - boost::property_map::type - ea = boost::get(boost::edge_attribute, g); //ea[e] - set_attribute(ea[current_edge], attributes); - } - break; + { + boost::property_map::type + ea = boost::get(boost::edge_attribute, g); //ea[e] + set_attribute(ea[current_edge], attributes); + } + break; } if ( clear_attribute ) - attributes.clear(); + attributes.clear(); } static void add_edges(const Vertex& u, - const Vertex& v, GRAPHVIZ_GRAPH& g) { + const Vertex& v, GRAPHVIZ_GRAPH& g) { graphviz::current_edge = boost::add_edge(u, v, g).first; graphviz::set_attribute(g, EDGE_A, false); } static void add_edges(Subgraph* G1, Subgraph* G2, - GRAPHVIZ_GRAPH& g) { + GRAPHVIZ_GRAPH& g) { boost::graph_traits::vertex_iterator i, j, m, n; for ( boost::tie(i, j) = boost::vertices(*G1); i != j; ++i) { - for ( boost::tie(m, n) = boost::vertices(*G2); m != n; ++m) { - graphviz::add_edges(G1->local_to_global(*i), - G2->local_to_global(*m), g); - } + for ( boost::tie(m, n) = boost::vertices(*G2); m != n; ++m) { + graphviz::add_edges(G1->local_to_global(*i), + G2->local_to_global(*m), g); + } } } static void add_edges(Subgraph* G, const Vertex& v, GRAPHVIZ_GRAPH& g) { boost::graph_traits::vertex_iterator i, j; for ( boost::tie(i, j) = boost::vertices(*G); i != j; ++i) { - graphviz::add_edges(G->local_to_global(*i), v, g); + graphviz::add_edges(G->local_to_global(*i), v, g); } } static void add_edges(const Vertex& u, Subgraph* G, GRAPHVIZ_GRAPH& g) { boost::graph_traits::vertex_iterator i, j; for ( boost::tie(i, j) = boost::vertices(*G); i != j; ++i) { - graphviz::add_edges(u, G->local_to_global(*i), g); + graphviz::add_edges(u, G->local_to_global(*i), g); } } @@ -242,7 +242,7 @@ static void set_graph_name(const std::string& name) { boost::graph_property::type& - gea = boost::get_property(*current_graph, boost::graph_name); + gea = boost::get_property(*current_graph, boost::graph_name); gea = name; } @@ -258,9 +258,9 @@ -#define YYFINAL 66 -#define YYFLAG -32768 -#define YYNTBASE 18 +#define YYFINAL 66 +#define YYFLAG -32768 +#define YYNTBASE 18 #define YYTRANSLATE(x) ((unsigned)(x) <= 263 ? yytranslate[x] : 45) @@ -392,7 +392,7 @@ static const short yypgoto[] = {-32768, }; -#define YYLAST 56 +#define YYLAST 56 static const short yytable[] = { 50, @@ -463,7 +463,7 @@ static const short yycheck[] = { 36, since that symbol is in the user namespace. */ #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) #if 0 /* No need for malloc.h, which pollutes the namespace; - instead, just don't use alloca. */ + instead, just don't use alloca. */ #include #endif #else /* not MSDOS, or __TURBOC__ */ @@ -476,7 +476,7 @@ static const short yycheck[] = { 36, #else /* not MSDOS, or __TURBOC__, or _AIX */ #if 0 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, - and on HPUX 10. Eventually we can turn this on. */ + and on HPUX 10. Eventually we can turn this on. */ #define YYSTACK_USE_ALLOCA #define alloca __builtin_alloca #endif /* __hpux */ @@ -498,50 +498,50 @@ static const short yycheck[] = { 36, It is replaced by the list of actions, each action as one case of the switch. */ -#define yyerrok (yyerrstatus = 0) -#define yyclearin (bgl_undir_char = YYEMPTY) -#define YYEMPTY -2 -#define YYEOF 0 -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrlab1 +#define yyerrok (yyerrstatus = 0) +#define yyclearin (bgl_undir_char = YYEMPTY) +#define YYEMPTY -2 +#define YYEOF 0 +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrlab1 /* Like YYERROR except do call bgl_undir_error. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ -#define YYFAIL goto yyerrlab +#define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(token, value) \ -do \ - if (bgl_undir_char == YYEMPTY && yylen == 1) \ - { bgl_undir_char = (token), bgl_undir_lval = (value); \ - bgl_undir_char1 = YYTRANSLATE (bgl_undir_char); \ - YYPOPSTACK; \ - goto yybackup; \ - } \ - else \ - { bgl_undir_error ("syntax error: cannot back up"); YYERROR; } \ +do \ + if (bgl_undir_char == YYEMPTY && yylen == 1) \ + { bgl_undir_char = (token), bgl_undir_lval = (value); \ + bgl_undir_char1 = YYTRANSLATE (bgl_undir_char); \ + YYPOPSTACK; \ + goto yybackup; \ + } \ + else \ + { bgl_undir_error ("syntax error: cannot back up"); YYERROR; } \ while (0) -#define YYTERROR 1 -#define YYERRCODE 256 +#define YYTERROR 1 +#define YYERRCODE 256 #ifndef YYPURE -#define YYLEX bgl_undir_lex() +#define YYLEX bgl_undir_lex() #endif #ifdef YYPURE #ifdef YYLSP_NEEDED #ifdef YYLEX_PARAM -#define YYLEX bgl_undir_lex(&bgl_undir_lval, &yylloc, YYLEX_PARAM) +#define YYLEX bgl_undir_lex(&bgl_undir_lval, &yylloc, YYLEX_PARAM) #else -#define YYLEX bgl_undir_lex(&bgl_undir_lval, &yylloc) +#define YYLEX bgl_undir_lex(&bgl_undir_lval, &yylloc) #endif #else /* not YYLSP_NEEDED */ #ifdef YYLEX_PARAM -#define YYLEX bgl_undir_lex(&bgl_undir_lval, YYLEX_PARAM) +#define YYLEX bgl_undir_lex(&bgl_undir_lval, YYLEX_PARAM) #else -#define YYLEX bgl_undir_lex(&bgl_undir_lval) +#define YYLEX bgl_undir_lex(&bgl_undir_lval) #endif #endif /* not YYLSP_NEEDED */ #endif @@ -550,27 +550,27 @@ while (0) #ifndef YYPURE -int bgl_undir_char; /* the lookahead symbol */ -YYSTYPE bgl_undir_lval; /* the semantic value of the */ - /* lookahead symbol */ +int bgl_undir_char; /* the lookahead symbol */ +YYSTYPE bgl_undir_lval; /* the semantic value of the */ + /* lookahead symbol */ #ifdef YYLSP_NEEDED -YYLTYPE yylloc; /* location data for the lookahead */ - /* symbol */ +YYLTYPE yylloc; /* location data for the lookahead */ + /* symbol */ #endif -int bgl_undir_nerrs; /* number of parse errors so far */ +int bgl_undir_nerrs; /* number of parse errors so far */ #endif /* not YYPURE */ #if YYDEBUG != 0 -int bgl_undir_debug; /* nonzero means print parse trace */ +int bgl_undir_debug; /* nonzero means print parse trace */ /* Since this is uninitialized, it does not stop multiple parsers from coexisting. */ #endif -/* YYINITDEPTH indicates the initial size of the parser's stacks */ +/* YYINITDEPTH indicates the initial size of the parser's stacks */ -#ifndef YYINITDEPTH +#ifndef YYINITDEPTH #define YYINITDEPTH 200 #endif @@ -590,9 +590,9 @@ int bgl_undir_debug; /* nonzero means print parse trace */ definitions require. With GCC, __builtin_memcpy takes an arg of type size_t, but it can handle unsigned int. */ -#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ -#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) -#else /* not GNU C or C++ */ +#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ +#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) +#else /* not GNU C or C++ */ #ifndef __cplusplus /* This is the most reliable way to avoid incompatibilities @@ -667,17 +667,17 @@ yyparse(YYPARSE_PARAM_ARG) register int yyn; register short *yyssp; register YYSTYPE *yyvsp; - int yyerrstatus; /* number of tokens to shift before error messages enabled */ - int bgl_undir_char1 = 0; /* lookahead token as an internal (translated) token number */ + int yyerrstatus; /* number of tokens to shift before error messages enabled */ + int bgl_undir_char1 = 0; /* lookahead token as an internal (translated) token number */ - short yyssa[YYINITDEPTH]; /* the state stack */ - YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ + short yyssa[YYINITDEPTH]; /* the state stack */ + YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ - short *yyss = yyssa; /* refer to the stacks thru separate pointers */ - YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ + short *yyss = yyssa; /* refer to the stacks thru separate pointers */ + YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ #ifdef YYLSP_NEEDED - YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ + YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ YYLTYPE *yyls = yylsa; YYLTYPE *yylsp; @@ -698,9 +698,9 @@ yyparse(YYPARSE_PARAM_ARG) #endif #endif - YYSTYPE yyval; /* the variable used to return */ - /* semantic values from the action */ - /* routines */ + YYSTYPE yyval; /* the variable used to return */ + /* semantic values from the action */ + /* routines */ int yylen; @@ -712,7 +712,7 @@ yyparse(YYPARSE_PARAM_ARG) yystate = 0; yyerrstatus = 0; bgl_undir_nerrs = 0; - bgl_undir_char = YYEMPTY; /* Cause a token to be read. */ + bgl_undir_char = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack @@ -747,20 +747,20 @@ yynewstate: #ifdef yyoverflow /* Each stack pointer address is followed by the size of - the data in use in that stack, in bytes. */ + the data in use in that stack, in bytes. */ #ifdef YYLSP_NEEDED /* This used to be a conditional around just the two extra args, - but that might be undefined if yyoverflow is a macro. */ + but that might be undefined if yyoverflow is a macro. */ yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yyls1, size * sizeof (*yylsp), - &yystacksize); + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yyls1, size * sizeof (*yylsp), + &yystacksize); #else yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yystacksize); + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yystacksize); #endif yyss = yyss1; yyvs = yyvs1; @@ -770,34 +770,34 @@ yynewstate: #else /* no yyoverflow */ /* Extend the stack our own way. */ if (yystacksize >= YYMAXDEPTH) - { - bgl_undir_error("parser stack overflow"); - if (yyfree_stacks) - { - free (yyss); - free (yyvs); + { + bgl_undir_error("parser stack overflow"); + if (yyfree_stacks) + { + free (yyss); + free (yyvs); #ifdef YYLSP_NEEDED - free (yyls); + free (yyls); #endif - } - return 2; - } + } + return 2; + } yystacksize *= 2; if (yystacksize > YYMAXDEPTH) - yystacksize = YYMAXDEPTH; + yystacksize = YYMAXDEPTH; #ifndef YYSTACK_USE_ALLOCA yyfree_stacks = 1; #endif yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); __yy_memcpy ((char *)yyss, (char *)yyss1, - size * (unsigned int) sizeof (*yyssp)); + size * (unsigned int) sizeof (*yyssp)); yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); __yy_memcpy ((char *)yyvs, (char *)yyvs1, - size * (unsigned int) sizeof (*yyvsp)); + size * (unsigned int) sizeof (*yyvsp)); #ifdef YYLSP_NEEDED yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); __yy_memcpy ((char *)yyls, (char *)yyls1, - size * (unsigned int) sizeof (*yylsp)); + size * (unsigned int) sizeof (*yylsp)); #endif #endif /* no yyoverflow */ @@ -809,11 +809,11 @@ yynewstate: #if YYDEBUG != 0 if (bgl_undir_debug) - fprintf(stderr, "Stack size increased to %d\n", yystacksize); + fprintf(stderr, "Stack size increased to %d\n", yystacksize); #endif if (yyssp >= yyss + yystacksize - 1) - YYABORT; + YYABORT; } #if YYDEBUG != 0 @@ -843,21 +843,21 @@ yynewstate: { #if YYDEBUG != 0 if (bgl_undir_debug) - fprintf(stderr, "Reading a token: "); + fprintf(stderr, "Reading a token: "); #endif bgl_undir_char = YYLEX; } /* Convert token to internal form (in bgl_undir_char1) for indexing tables with */ - if (bgl_undir_char <= 0) /* This means end of input. */ + if (bgl_undir_char <= 0) /* This means end of input. */ { bgl_undir_char1 = 0; - bgl_undir_char = YYEOF; /* Don't call YYLEX any more */ + bgl_undir_char = YYEOF; /* Don't call YYLEX any more */ #if YYDEBUG != 0 if (bgl_undir_debug) - fprintf(stderr, "Now at end of input.\n"); + fprintf(stderr, "Now at end of input.\n"); #endif } else @@ -866,15 +866,15 @@ yynewstate: #if YYDEBUG != 0 if (bgl_undir_debug) - { - fprintf (stderr, "Next token is %d (%s", bgl_undir_char, yytname[bgl_undir_char1]); - /* Give the individual parser a way to print the precise meaning - of a token, for further debugging info. */ + { + fprintf (stderr, "Next token is %d (%s", bgl_undir_char, yytname[bgl_undir_char1]); + /* Give the individual parser a way to print the precise meaning + of a token, for further debugging info. */ #ifdef YYPRINT - YYPRINT (stderr, bgl_undir_char, bgl_undir_lval); + YYPRINT (stderr, bgl_undir_char, bgl_undir_lval); #endif - fprintf (stderr, ")\n"); - } + fprintf (stderr, ")\n"); + } #endif } @@ -894,7 +894,7 @@ yynewstate: if (yyn < 0) { if (yyn == YYFLAG) - goto yyerrlab; + goto yyerrlab; yyn = -yyn; goto yyreduce; } @@ -945,11 +945,11 @@ yyreduce: int i; fprintf (stderr, "Reducing via rule %d (line %d), ", - yyn, yyrline[yyn]); + yyn, yyrline[yyn]); /* Print the symbols being reduced, and their result. */ for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) - fprintf (stderr, "%s ", yytname[yyrhs[i]]); + fprintf (stderr, "%s ", yytname[yyrhs[i]]); fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); } #endif @@ -983,7 +983,7 @@ case 14: #line 279 "graphviz_parser.y" { graphviz::set_attribute(*graphviz::current_graph, - graphviz::attribute_state); + graphviz::attribute_state); ; break;} case 15: @@ -1017,7 +1017,7 @@ case 28: { graphviz::set_attribute( *static_cast(graphviz::current_graph), - GRAPH_GRAPH_A); + GRAPH_GRAPH_A); ; break;} case 29: @@ -1026,7 +1026,7 @@ case 29: graphviz::Vertex* temp = static_cast(yyvsp[-1].ptr); graphviz::current_vertex = *temp; graphviz::set_attribute(*static_cast(YYPARSE_PARAM), - NODE_A); + NODE_A); delete temp; yyval.i = 0; ; @@ -1047,7 +1047,7 @@ case 32: if (result.second) { graphviz::current_vertex = result.first->second; if (! graphviz::current_graph->is_root()) - boost::add_vertex(graphviz::current_vertex, *graphviz::current_graph); + boost::add_vertex(graphviz::current_vertex, *graphviz::current_graph); } else graphviz::current_vertex = graphviz::add_name(*name, *static_cast(YYPARSE_PARAM)) ; graphviz::Vertex* temp = new graphviz::Vertex(graphviz::current_vertex); @@ -1087,27 +1087,27 @@ case 35: Ptr source = static_cast(yyvsp[-2].ptr); for (std::vector::iterator it=graphviz::vlist.begin(); - it !=graphviz::vlist.end(); ++it) { + it !=graphviz::vlist.end(); ++it) { if ( source->second ) { - if ( (*it)->second ) - graphviz::add_edges(static_cast(source->first), - static_cast((*it)->first), - *static_cast(YYPARSE_PARAM)); - else - graphviz::add_edges(static_cast(source->first), - *static_cast((*it)->first), - *static_cast(YYPARSE_PARAM)); + if ( (*it)->second ) + graphviz::add_edges(static_cast(source->first), + static_cast((*it)->first), + *static_cast(YYPARSE_PARAM)); + else + graphviz::add_edges(static_cast(source->first), + *static_cast((*it)->first), + *static_cast(YYPARSE_PARAM)); } else { - graphviz::Vertex* temp = static_cast(source->first); - if ( (*it)->second ) - graphviz::add_edges(*temp, - static_cast((*it)->first), - *static_cast(YYPARSE_PARAM)); - else - graphviz::add_edges(*temp, - *static_cast((*it)->first), - *static_cast(YYPARSE_PARAM)); - delete temp; + graphviz::Vertex* temp = static_cast(source->first); + if ( (*it)->second ) + graphviz::add_edges(*temp, + static_cast((*it)->first), + *static_cast(YYPARSE_PARAM)); + else + graphviz::add_edges(*temp, + *static_cast((*it)->first), + *static_cast(YYPARSE_PARAM)); + delete temp; } delete source; @@ -1222,7 +1222,7 @@ case 46: short *ssp1 = yyss - 1; fprintf (stderr, "state stack now"); while (ssp1 != yyssp) - fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, " %d", *++ssp1); fprintf (stderr, "\n"); } #endif @@ -1272,44 +1272,44 @@ yyerrlab: /* here on detecting error */ yyn = yypact[yystate]; if (yyn > YYFLAG && yyn < YYLAST) - { - int size = 0; - char *msg; - int x, count; + { + int size = 0; + char *msg; + int x, count; - count = 0; - /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - size += strlen(yytname[x]) + 15, count++; - msg = (char *) malloc(size + 15); - if (msg != 0) - { - strcpy(msg, "parse error"); + count = 0; + /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + size += strlen(yytname[x]) + 15, count++; + msg = (char *) malloc(size + 15); + if (msg != 0) + { + strcpy(msg, "parse error"); - if (count < 5) - { - count = 0; - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - { - strcat(msg, count == 0 ? ", expecting `" : " or `"); - strcat(msg, yytname[x]); - strcat(msg, "'"); - count++; - } - } - bgl_undir_error(msg); - free(msg); - } - else - bgl_undir_error ("parse error; also virtual memory exceeded"); - } + if (count < 5) + { + count = 0; + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + { + strcat(msg, count == 0 ? ", expecting `" : " or `"); + strcat(msg, yytname[x]); + strcat(msg, "'"); + count++; + } + } + bgl_undir_error(msg); + free(msg); + } + else + bgl_undir_error ("parse error; also virtual memory exceeded"); + } else #endif /* YYERROR_VERBOSE */ - bgl_undir_error("parse error"); + bgl_undir_error("parse error"); } goto yyerrlab1; @@ -1321,11 +1321,11 @@ yyerrlab1: /* here on error raised explicitly by an action */ /* return failure if at end of input */ if (bgl_undir_char == YYEOF) - YYABORT; + YYABORT; #if YYDEBUG != 0 if (bgl_undir_debug) - fprintf(stderr, "Discarding token %d (%s).\n", bgl_undir_char, yytname[bgl_undir_char1]); + fprintf(stderr, "Discarding token %d (%s).\n", bgl_undir_char, yytname[bgl_undir_char1]); #endif bgl_undir_char = YYEMPTY; @@ -1334,7 +1334,7 @@ yyerrlab1: /* here on error raised explicitly by an action */ /* Else will try to reuse lookahead token after shifting the error token. */ - yyerrstatus = 3; /* Each real token shifted decrements this */ + yyerrstatus = 3; /* Each real token shifted decrements this */ goto yyerrhandle; @@ -1362,7 +1362,7 @@ yyerrpop: /* pop the current state because it cannot handle the error token */ short *ssp1 = yyss - 1; fprintf (stderr, "Error: state stack now"); while (ssp1 != yyssp) - fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, " %d", *++ssp1); fprintf (stderr, "\n"); } #endif @@ -1381,7 +1381,7 @@ yyerrhandle: if (yyn < 0) { if (yyn == YYFLAG) - goto yyerrpop; + goto yyerrpop; yyn = -yyn; goto yyreduce; } diff --git a/test/adj_list_test.cpp b/test/adj_list_test.cpp index 760d8e93..72156ccb 100644 --- a/test/adj_list_test.cpp +++ b/test/adj_list_test.cpp @@ -41,8 +41,8 @@ main() system("rm -f graph.exe graph.o graph.obj"); // the following system call should be replaced by a // portable "compile" command. - const char* compile = "g++ -I.. -O2 -Wall -Wno-long-long -ftemplate-depth-30 ../libs/graph/test/graph.cpp -o graph.exe"; - std::cout << compile << std::endl; + const char* compile = "g++ -I.. -O2 -Wall -Wno-long-long -ftemplate-depth-30 ../libs/graph/test/graph.cpp -o graph.exe"; + std::cout << compile << std::endl; rc = system(compile); if (rc != 0) { std::cerr << "compile failed for " << container_types[i] << " " diff --git a/test/bfs.cpp b/test/bfs.cpp index a748f7b3..4c785406 100644 --- a/test/bfs.cpp +++ b/test/bfs.cpp @@ -156,8 +156,8 @@ struct bfs_test vis(start, &distance[0], &parent[0], &color[0]); boost::breadth_first_search(g, start, - visitor(vis). - color_map(&color[0])); + visitor(vis). + color_map(&color[0])); // All white vertices should be unreachable from the source. for (boost::tie(ui, ui_end) = vertices(g); ui != ui_end; ++ui) diff --git a/test/dfs.cpp b/test/dfs.cpp index ee3dbf70..62f96966 100644 --- a/test/dfs.cpp +++ b/test/dfs.cpp @@ -124,7 +124,7 @@ struct dfs_test dfs_test_visitor vis(color, &parent[0], - &discover_time[0], &finish_time[0]); + &discover_time[0], &finish_time[0]); boost::depth_first_search(g, visitor(vis).color_map(color)); diff --git a/test/dijkstra_cc.cpp b/test/dijkstra_cc.cpp index 7168ebed..87a5bfdb 100644 --- a/test/dijkstra_cc.cpp +++ b/test/dijkstra_cc.cpp @@ -37,9 +37,9 @@ int main() readable_property_map_archetype index; read_write_property_map_archetype distance; dijkstra_shortest_paths(g, s, - vertex_index_map(index). - weight_map(weight). - distance_map(distance)); + vertex_index_map(index). + weight_map(weight). + distance_map(distance)); } { typedef incidence_graph_archetype::get(); read_write_property_map_archetype pred; dijkstra_shortest_paths(g, s, - predecessor_map(pred). - weight_map(weight)); + predecessor_map(pred). + weight_map(weight)); } { typedef incidence_graph_archetype pred; readable_property_map_archetype index; dijkstra_shortest_paths(g, s, - predecessor_map(pred). - vertex_index_map(index)); + predecessor_map(pred). + vertex_index_map(index)); } { typedef incidence_graph_archetype vis; dijkstra_shortest_paths(g, s, color_map(color). - vertex_index_map(index). - weight_map(weight). - distance_map(distance). - distance_combine(combine). - distance_compare(compare). - visitor(vis)); + vertex_index_map(index). + weight_map(weight). + distance_map(distance). + distance_combine(combine). + distance_compare(compare). + visitor(vis)); } return 0; } diff --git a/test/graph.cpp b/test/graph.cpp index f8c4c1b0..f4384d51 100644 --- a/test/graph.cpp +++ b/test/graph.cpp @@ -48,8 +48,8 @@ bool check_vertex_cleared(Graph& g, Vertex v, ID id) found = aiend; for ( ; ai != aiend; ++ai) if (cmp(*ai, v)) { - found = ai; - break; + found = ai; + break; } #else found = std::find_if(ai, aiend, std::bind1st(cmp,v)); @@ -67,10 +67,10 @@ bool check_vertex_cleared(Graph& g, Vertex v, ID id) template bool check_edge_added(Graph& g, Edge e, - typename graph_traits::vertex_descriptor a, - typename graph_traits::vertex_descriptor b, - EdgeID edge_id, std::size_t correct_id, - bool inserted) + typename graph_traits::vertex_descriptor a, + typename graph_traits::vertex_descriptor b, + EdgeID edge_id, std::size_t correct_id, + bool inserted) { if (! (source(e, g) == a)) { #if VERBOSE @@ -159,7 +159,7 @@ int main(int, char* []) Vertex a, b; a = random_vertex(g, gen); do { - b = random_vertex(g, gen); + b = random_vertex(g, gen); } while ( a == b ); // don't do self edges #if VERBOSE cerr << "add_edge(" << vertex_id_map[a] << "," << vertex_id_map[b] <<")" << endl; @@ -178,9 +178,9 @@ int main(int, char* []) // print_in_edges(g, vertex_id_map); #endif if (! check_edge_added(g, e, a, b, edge_id_map, - current_edge_id - 1, inserted)) { - ret = -1; - break; + current_edge_id - 1, inserted)) { + ret = -1; + break; } ++E; } @@ -208,9 +208,9 @@ int main(int, char* []) print_edges(g, vertex_id_map); #endif is_failed = is_failed || is_adjacent(g, a, b) || in_edge_set(g, a, b) - || num_edges(g) != count_edges(g); + || num_edges(g) != count_edges(g); if (is_failed) - break; + break; } if ( is_failed ) { ret = -1; @@ -248,9 +248,9 @@ int main(int, char* []) #endif is_failed = is_failed || old_E != num_edges(g) + 1 - || num_edges(g) != count_edges(g); + || num_edges(g) != count_edges(g); if (is_failed) - break; + break; } if ( is_failed ) { ret = -1; @@ -283,17 +283,17 @@ int main(int, char* []) { if (!in_vertex_set(g, vid)) { #if VERBOSE - cerr << " Failed, " << vertex_id_map[vid] << " not in vertices(g)" << endl; + cerr << " Failed, " << vertex_id_map[vid] << " not in vertices(g)" << endl; #endif - ret = -1; - break; + ret = -1; + break; } if (!in_vertex_set(g, vidp1)) { #if VERBOSE - cerr << " Failed, " << vertex_id_map[vidp1] << " not in vertices(g)" << endl; + cerr << " Failed, " << vertex_id_map[vidp1] << " not in vertices(g)" << endl; #endif - ret = -1; - break; + ret = -1; + break; } } @@ -303,20 +303,20 @@ int main(int, char* []) boost::tie(e,e_end) = out_edges(vid,g); if (e != e_end) { #if VERBOSE - cerr << " Failed, " << vertex_id_map[vid] - << " should not have any out-edges yet" << endl; + cerr << " Failed, " << vertex_id_map[vid] + << " should not have any out-edges yet" << endl; #endif - ret = -1; - break; + ret = -1; + break; } boost::tie(e,e_end) = out_edges(vidp1,g); if (e != e_end) { #if VERBOSE - cerr << " Failed, " << vertex_id_map[vidp1] - << " should not have any out-edges yet" << endl; + cerr << " Failed, " << vertex_id_map[vidp1] + << " should not have any out-edges yet" << endl; #endif - ret = -1; - break; + ret = -1; + break; } } @@ -324,22 +324,22 @@ int main(int, char* []) { graph_traits::edge_iterator e, e_end; for (boost::tie(e, e_end) = edges(g); e != e_end; ++e) { - if (source(*e,g) == vid || target(*e,g) == vid) { + if (source(*e,g) == vid || target(*e,g) == vid) { #if VERBOSE - cerr << " Failed, " << vertex_id_map[vid] - << " should not have any edges" << endl; + cerr << " Failed, " << vertex_id_map[vid] + << " should not have any edges" << endl; #endif - ret = -1; - break; - } - if (source(*e,g) == vidp1 || target(*e,g) == vidp1) { + ret = -1; + break; + } + if (source(*e,g) == vidp1 || target(*e,g) == vidp1) { #if VERBOSE - cerr << " Failed, " << vertex_id_map[vidp1] - << " should not have any edges" << endl; + cerr << " Failed, " << vertex_id_map[vidp1] + << " should not have any edges" << endl; #endif - ret = -1; - break; - } + ret = -1; + break; + } } } // Make sure num_vertices(g) has been updated @@ -348,7 +348,7 @@ int main(int, char* []) ret = -1; #if VERBOSE cerr << " Failed. N = " << N - << " but should be " << old_N + 2 << endl; + << " but should be " << old_N + 2 << endl; #endif break; } else { @@ -373,9 +373,9 @@ int main(int, char* []) boost::tie(e,inserted) = add_edge(vid, a, EdgeID(current_edge_id++), g); if (! check_edge_added(g, e, vid, a, edge_id_map, current_edge_id - 1, - inserted)) { - ret = -1; - break; + inserted)) { + ret = -1; + break; } #if VERBOSE @@ -384,13 +384,13 @@ int main(int, char* []) // add_edge without plugin boost::tie(e,inserted) = add_edge(b, vidp1, g); if (inserted) - edge_id_map[e] = current_edge_id; + edge_id_map[e] = current_edge_id; ++current_edge_id; if (! check_edge_added(g, e, b, vidp1, edge_id_map, - current_edge_id - 1, inserted)) { - ret = -1; - break; + current_edge_id - 1, inserted)) { + ret = -1; + break; } } @@ -407,7 +407,7 @@ int main(int, char* []) print_graph(g, vertex_id_map); // print_in_edges(g, vertex_id_map); print_edges(g, vertex_id_map); -#endif +#endif if (check_vertex_cleared(g, c, vertex_id_map) && num_edges(g) == count_edges(g)) { #if VERBOSE cerr << " Passed."<< endl; @@ -440,10 +440,10 @@ int main(int, char* []) boost::tie(v, v_end) = vertices(g); for (N = 0; v != v_end; ++v) ++N; // N = std::distance(v, v_end); if (N != old_N - 1) { - ret = -1; + ret = -1; #if VERBOSE - cerr << " Failed. N = " << N - << " but should be " << old_N - 1 << endl; + cerr << " Failed. N = " << N + << " but should be " << old_N - 1 << endl; #endif } } @@ -453,7 +453,7 @@ int main(int, char* []) ret = -1; #if VERBOSE cerr << " Failed. N = " << N - << " but should be " << old_N - 1 << endl; + << " but should be " << old_N - 1 << endl; #endif } else { #if VERBOSE diff --git a/test/subgraph.cpp b/test/subgraph.cpp index 428596d7..9f8cfc6e 100644 --- a/test/subgraph.cpp +++ b/test/subgraph.cpp @@ -53,8 +53,8 @@ int test_main(int argc, char* argv[]) std::vector vertex_set; std::vector< std::pair > edge_set; generate_random_graph(g, N, N * 2, gen, - std::back_inserter(vertex_set), - std::back_inserter(edge_set)); + std::back_inserter(vertex_set), + std::back_inserter(edge_set)); graph_test< subgraph_t > gt; @@ -80,7 +80,7 @@ int test_main(int argc, char* argv[]) verts.insert(random_vertex(g, gen)); for (std::set::iterator i = verts.begin(); - i != verts.end(); ++i) { + i != verts.end(); ++i) { vertex_t v_global = *i; vertex_t v = add_vertex(v_global, g_s); sub_vertex_set.push_back(v); @@ -91,9 +91,9 @@ int test_main(int argc, char* argv[]) // compute induced edges BGL_FORALL_EDGES(e, g, subgraph_t) if (contains(sub_global_map, source(e, g)) - && contains(sub_global_map, target(e, g))) - sub_edge_set.push_back(std::make_pair(global_sub_map[source(e, g)], - global_sub_map[target(e, g)])); + && contains(sub_global_map, target(e, g))) + sub_edge_set.push_back(std::make_pair(global_sub_map[source(e, g)], + global_sub_map[target(e, g)])); gt.test_incidence_graph(sub_vertex_set, sub_edge_set, g_s); gt.test_bidirectional_graph(sub_vertex_set, sub_edge_set, g_s); diff --git a/test/transitive_closure_test.cpp b/test/transitive_closure_test.cpp index cc03bdde..771e1ab7 100644 --- a/test/transitive_closure_test.cpp +++ b/test/transitive_closure_test.cpp @@ -51,7 +51,7 @@ bool check_transitive_closure(Graph& g, GraphTC& tc) typename graph_traits::out_edge_iterator j, j_end; for (tie(j, j_end) = out_edges(*i, tc); j != j_end; ++j) if (!is_reachable(source(*j, g), target(*j, g), g, &color_map_vec[0])) - return false; + return false; } return true; }