pd->curNameInst->start = resolved[0];
if ( resolved.length() > 1 ) {
/* Complain about the multiple references. */
- error(loc) << "multiple start labels" << endl;
+ error(loc) << "join operation has multiple start labels" << endl;
errorStateLabels( resolved );
}
}
pd->curNameInst->start->numRefs += 1;
}
else {
- /* No start label. Complain and recover by adding a label to the
- * adding one. Recover ignoring the problem. */
- error(loc) << "no start label" << endl;
+ /* No start label. */
+ error(loc) << "join operation has no start label" << endl;
}
/* Recurse into all expressions in the list. */
};
JoinOrLm( Join *join ) :
- join(join), type(JoinType) {}
+ join(join), longestMatch(0), type(JoinType) {}
JoinOrLm( LongestMatch *longestMatch ) :
- longestMatch(longestMatch), type(LongestMatchType) {}
+ join(0), longestMatch(longestMatch), type(LongestMatchType) {}
FsmAp *walk( ParseData *pd );
void makeNameTree( ParseData *pd );
if ( $1->isSet )
exportContext.remove( exportContext.length()-1 );
+
+ $4->join->loc = $3->loc;
};
instantiation:
if ( $1->isSet )
exportContext.remove( exportContext.length()-1 );
+
+ /* Pass a location to join_or_lm */
+ if ( $4->joinOrLm->join != 0 )
+ $4->joinOrLm->join->loc = $3->loc;
};
type token_type
};
lm_part_list:
- lm_part_list longest_match_part final {
+ lm_part_list longest_match_part
+ final {
if ( $2->lmPart != 0 )
$1->lmPartList->append( $2->lmPart );
$$->lmPartList = $1->lmPartList;
};
lm_part_list:
- longest_match_part final {
+ longest_match_part
+ final {
/* Create a new list with the part. */
$$->lmPartList = new LmPartList;
if ( $1->lmPart != 0 )
action->isLmAction = true;
$$->lmPart = new LongestMatchPart( $1->join, action,
$3->loc, pd->nextLongestMatchId++ );
+
+ /* Provide a location to join. Unfortunately We don't
+ * have the start of the join as in other occurances. Use the end. */
+ $1->join->loc = $3->loc;
};
nonterm opt_lm_part_action
'(' join ')' final {
/* Create a new factor going to a parenthesized join. */
$$->factor = new Factor( $2->join );
+ $2->join->loc = $1->loc;
};
nonterm range_lit