Cobra Interactive Query Language setlinks

NAME

setlinks — set .bound field at some control-flow keywords

SYNTAX

	setlinks

DESCRIPTION

This command is the C version of the scripted functions that are defined in play/goto_links.cobra, play/else_links.cobra and play/switch_links.cobra. For specific keywords the token field .bound is now set to a token reference that can be helpful in reconstructing control flow. Specifically, the field is set as follows:
  • goto: the .bound field points to the destination label of the jump
  • switch: the .bound field points to the end of the switch body
  • case: the .bound field points to the next case label in the same switch statement
  • break: the .bound field points to the end of the enclosing block (in curly braces)

EXAMPLES

	: r
	: setlinks
	: %{ x = .bound; if (x.seq > 0) { print .fnm ":" .lnr ": " .txt " -> " x.lnr "\n"; } %}
	: m goto
	: r all	# clear all fields, including .bound
Note that in inline programs one cannot directly refer to the .bound.seq field, so if this is needed, the best way is to first assign the value to a temporary variable (in this case 'x') and check the value of x.seq.

SEE ALSO

reset, stretch

Return to index
Manual
Tutorial
(Last Updated: 3 May 2019)