Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions analyze/aps-debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <string.h>
#include <strings.h>
#include "aps-ag.h"
#include "utilities.h"

static int aps_error_count = 0;

Expand Down Expand Up @@ -83,6 +84,7 @@ static void list_debug_flags() {
fprintf(stderr,"\tO TOTAL_ORDER\n");
fprintf(stderr,"\tT PROD_ORDER\n");
fprintf(stderr,"\t3 TYPE_3_DEBUG\n");
fprintf(stderr,"\t4 SCC_ADDITIONS\n");
exit(0);
}

Expand Down Expand Up @@ -122,6 +124,7 @@ void set_debug_flags(const char *options)
case 'v': oag_debug |= DEBUG_ORDER_VERBOSE; break;
case 'T': oag_debug |= PROD_ORDER; break;
case '3': oag_debug |= TYPE_3_DEBUG; break;
case '4': scc_debug |= SCC_ADDITIONS; break;
}
} while (*options != '\0');
}
Expand Down
25 changes: 12 additions & 13 deletions examples/scala/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,27 @@ OUT_BASE = obj
OUT = ${OUT_BASE}/${EVALUATOR}
$(shell mkdir -p ${OUT})

SCALAGEN = simple.scala classic-binding.scala tiny.scala broad-fiber-cycle.scala \
below-fiber-cycle.scala below-single-fiber-cycle.scala local-fiber-cycle.scala \
test-coll.scala test-use-coll.scala test-cycle.scala use-global.scala \
test-fields.scala \
grammar.scala first.scala follow.scala nullable.scala \
AST_TREE_SCALAGEN = simple.scala tiny.scala grammar.scala \
farrow-lv-tree.scala farrow-ubd-tree.scala

MISCGEN = nested-cycles.scala SimpleParser.scala SimpleScanner.scala \
EVALUATOR_EXAMPLES = classic-binding first follow nullable test-coll \
test-use-coll test-cycle test-fields use-global broad-fiber-cycle \
below-fiber-cycle below-single-fiber-cycle local-fiber-cycle nested-cycles \
farrow-lv farrow-ubd farrow-ubd-fiber nested-ubd nested-ubd-fiber
SCALAGEN = ${AST_TREE_SCALAGEN} \
$(foreach example,${EVALUATOR_EXAMPLES},$(example).scala $(example).static.scala)

MISCGEN = SimpleParser.scala SimpleScanner.scala \
GrammarTokens.scala SimpleTokens.scala GrammarScanner.scala GrammarParser.scala \
FarrowLvTokens.scala FarrowLvTokens.scala FarrowLvScanner.scala FarrowLvParser.scala farrow-lv.scala \
FarrowUbdTokens.scala FarrowUbdTokens.scala FarrowUbdScanner.scala FarrowUbdParser.scala farrow-ubd.scala \
farrow-ubd-fiber.scala \
NestedUbdTokens.scala NestedUbdScanner.scala NestedUbdParser.scala nested-ubd.scala \
nested-ubd-fiber.scala nested-ubd-tree.scala \
FarrowLvTokens.scala FarrowLvScanner.scala FarrowLvParser.scala \
FarrowUbdTokens.scala FarrowUbdScanner.scala FarrowUbdParser.scala \
NestedUbdTokens.scala NestedUbdScanner.scala NestedUbdParser.scala \
*.output *.lex *.y *.scala~

.PHONY: all clean phony_explicit

# keep generated .scala
.SECONDARY:

all : ${SCALAGEN}
all : ${OUT}/grammar_implicit.class ${OUT}/simple_implicit.class ${OUT}/classic_binding_implicit.class ${OUT}/Classic.class
all : ${OUT}/GrammarScanner.class ${OUT}/GrammarTokens.class ${OUT}/SimpleScanner.class ${OUT}/SimpleTokens.class
all : ${OUT}/GrammarParserBase.class ${OUT}/GrammarParser.class ${OUT}/SimpleParserBase.class ${OUT}/SimpleParser.class
Expand Down
9 changes: 4 additions & 5 deletions utilities/scc.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include "hashtable.h"
#include "stack.h"

int scc_debug = 0;

/**
* Give a graph and vertex it returns the internal index
* @param graph SCC graph
Expand Down Expand Up @@ -301,11 +303,8 @@ SCC_COMPONENTS* scc_graph_components(SccGraph* graph) {
}
} while (changed);

if (count_transitive_edges_added > 0) {
printf(
"Graph provided to SCC utility has not gone through "
"transitive closure (%d new transitive edges have been added)\n",
count_transitive_edges_added);
if (count_transitive_edges_added > 0 && (scc_debug & SCC_ADDITIONS)) {
printf("Transitive closure added %d edges\n", count_transitive_edges_added);
}

graph->neighbors = collect_neighbors(graph);
Expand Down
3 changes: 3 additions & 0 deletions utilities/scc.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#include <stdint.h>
#include "hashtable.h"

extern int scc_debug;
#define SCC_ADDITIONS 4

typedef struct scc_component {
void** array;
int length;
Expand Down
Loading