[Pntool-developers] SF.net SVN: pntool:[184] translator
Brought to you by:
compaqdrew,
miordache
From: <the...@us...> - 2009-07-07 21:26:48
|
Revision: 184 http://pntool.svn.sourceforge.net/pntool/?rev=184&view=rev Author: thecodeweasel Date: 2009-07-07 21:26:41 +0000 (Tue, 07 Jul 2009) Log Message: ----------- Moving symbols to the left side of constraint equations and number to the right. Not tested, but it at least doesn't break anything... Modified Paths: -------------- translator/pncompactor.c translator/pncompactor.g translator/pncompactor.h translator/pngenerator.c translator/pngenerator.g translator/pngenerator.h Modified: translator/pncompactor.c =================================================================== --- translator/pncompactor.c 2009-07-07 20:15:31 UTC (rev 183) +++ translator/pncompactor.c 2009-07-07 21:26:41 UTC (rev 184) @@ -2,7 +2,7 @@ * This C source file was generated by $ANTLR version 3.1.2 * * - From the grammar source file : /Users/bion/projects/iordache/translator/pncompactor.g - * - On : 2009-07-05 23:51:33 + * - On : 2009-07-07 16:13:45 * - for the tree parser : pncompactorTreeParser * * Editing it, at least manually, is not wise. * @@ -692,129 +692,129 @@ /** Bitset defining follow set for error recovery in rule state: FOLLOW_eq_in_eq360 */ static ANTLR3_BITWORD FOLLOW_eq_in_eq360_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) }; static ANTLR3_BITSET_LIST FOLLOW_eq_in_eq360 = { FOLLOW_eq_in_eq360_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_EQ_OP_in_relationalExpression382 */ -static ANTLR3_BITWORD FOLLOW_EQ_OP_in_relationalExpression382_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) }; -static ANTLR3_BITSET_LIST FOLLOW_EQ_OP_in_relationalExpression382 = { FOLLOW_EQ_OP_in_relationalExpression382_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_additiveExpression_in_relationalExpression384 */ -static ANTLR3_BITWORD FOLLOW_additiveExpression_in_relationalExpression384_bits[] = { ANTLR3_UINT64_LIT(0x00000000C2080088) }; -static ANTLR3_BITSET_LIST FOLLOW_additiveExpression_in_relationalExpression384 = { FOLLOW_additiveExpression_in_relationalExpression384_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_additiveExpression_in_relationalExpression388 */ -static ANTLR3_BITWORD FOLLOW_additiveExpression_in_relationalExpression388_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) }; -static ANTLR3_BITSET_LIST FOLLOW_additiveExpression_in_relationalExpression388 = { FOLLOW_additiveExpression_in_relationalExpression388_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_primary_in_additiveExpression409 */ -static ANTLR3_BITWORD FOLLOW_primary_in_additiveExpression409_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) }; -static ANTLR3_BITSET_LIST FOLLOW_primary_in_additiveExpression409 = { FOLLOW_primary_in_additiveExpression409_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_PLUS_in_additiveExpression419 */ -static ANTLR3_BITWORD FOLLOW_PLUS_in_additiveExpression419_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) }; -static ANTLR3_BITSET_LIST FOLLOW_PLUS_in_additiveExpression419 = { FOLLOW_PLUS_in_additiveExpression419_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_additiveExpression_in_additiveExpression423 */ -static ANTLR3_BITWORD FOLLOW_additiveExpression_in_additiveExpression423_bits[] = { ANTLR3_UINT64_LIT(0x00000000C2080088) }; -static ANTLR3_BITSET_LIST FOLLOW_additiveExpression_in_additiveExpression423 = { FOLLOW_additiveExpression_in_additiveExpression423_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_additiveExpression_in_additiveExpression440 */ -static ANTLR3_BITWORD FOLLOW_additiveExpression_in_additiveExpression440_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) }; -static ANTLR3_BITSET_LIST FOLLOW_additiveExpression_in_additiveExpression440 = { FOLLOW_additiveExpression_in_additiveExpression440_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_MINUS_in_additiveExpression490 */ -static ANTLR3_BITWORD FOLLOW_MINUS_in_additiveExpression490_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) }; -static ANTLR3_BITSET_LIST FOLLOW_MINUS_in_additiveExpression490 = { FOLLOW_MINUS_in_additiveExpression490_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_additiveExpression_in_additiveExpression494 */ -static ANTLR3_BITWORD FOLLOW_additiveExpression_in_additiveExpression494_bits[] = { ANTLR3_UINT64_LIT(0x00000000C2080088) }; -static ANTLR3_BITSET_LIST FOLLOW_additiveExpression_in_additiveExpression494 = { FOLLOW_additiveExpression_in_additiveExpression494_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_additiveExpression_in_additiveExpression510 */ -static ANTLR3_BITWORD FOLLOW_additiveExpression_in_additiveExpression510_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) }; -static ANTLR3_BITSET_LIST FOLLOW_additiveExpression_in_additiveExpression510 = { FOLLOW_additiveExpression_in_additiveExpression510_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_MINUS_in_primary571 */ -static ANTLR3_BITWORD FOLLOW_MINUS_in_primary571_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) }; -static ANTLR3_BITSET_LIST FOLLOW_MINUS_in_primary571 = { FOLLOW_MINUS_in_primary571_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_eq_in_primary575 */ -static ANTLR3_BITWORD FOLLOW_eq_in_primary575_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) }; -static ANTLR3_BITSET_LIST FOLLOW_eq_in_primary575 = { FOLLOW_eq_in_primary575_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_group_elements_in_primary590 */ -static ANTLR3_BITWORD FOLLOW_group_elements_in_primary590_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) }; -static ANTLR3_BITSET_LIST FOLLOW_group_elements_in_primary590 = { FOLLOW_group_elements_in_primary590_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_number_in_primary631 */ -static ANTLR3_BITWORD FOLLOW_number_in_primary631_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) }; -static ANTLR3_BITSET_LIST FOLLOW_number_in_primary631 = { FOLLOW_number_in_primary631_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_MULT_in_primary642 */ -static ANTLR3_BITWORD FOLLOW_MULT_in_primary642_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) }; -static ANTLR3_BITSET_LIST FOLLOW_MULT_in_primary642 = { FOLLOW_MULT_in_primary642_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_number_in_primary644 */ -static ANTLR3_BITWORD FOLLOW_number_in_primary644_bits[] = { ANTLR3_UINT64_LIT(0x0000000082080088) }; -static ANTLR3_BITSET_LIST FOLLOW_number_in_primary644 = { FOLLOW_number_in_primary644_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_primary_in_primary646 */ -static ANTLR3_BITWORD FOLLOW_primary_in_primary646_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) }; -static ANTLR3_BITSET_LIST FOLLOW_primary_in_primary646 = { FOLLOW_primary_in_primary646_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_MULT_in_primary681 */ -static ANTLR3_BITWORD FOLLOW_MULT_in_primary681_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) }; -static ANTLR3_BITSET_LIST FOLLOW_MULT_in_primary681 = { FOLLOW_MULT_in_primary681_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_number_in_primary683 */ -static ANTLR3_BITWORD FOLLOW_number_in_primary683_bits[] = { ANTLR3_UINT64_LIT(0x0000000038000000) }; -static ANTLR3_BITSET_LIST FOLLOW_number_in_primary683 = { FOLLOW_number_in_primary683_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_eq_in_primary687 */ -static ANTLR3_BITWORD FOLLOW_eq_in_primary687_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) }; -static ANTLR3_BITSET_LIST FOLLOW_eq_in_primary687 = { FOLLOW_eq_in_primary687_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_LIVE_in_live_def711 */ -static ANTLR3_BITWORD FOLLOW_LIVE_in_live_def711_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) }; -static ANTLR3_BITSET_LIST FOLLOW_LIVE_in_live_def711 = { FOLLOW_LIVE_in_live_def711_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_ALL_in_live_def713 */ -static ANTLR3_BITWORD FOLLOW_ALL_in_live_def713_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000808) }; -static ANTLR3_BITSET_LIST FOLLOW_ALL_in_live_def713 = { FOLLOW_ALL_in_live_def713_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_live_def715 */ -static ANTLR3_BITWORD FOLLOW_ID_in_live_def715_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000808) }; -static ANTLR3_BITSET_LIST FOLLOW_ID_in_live_def715 = { FOLLOW_ID_in_live_def715_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_LIVE_in_live_def723 */ -static ANTLR3_BITWORD FOLLOW_LIVE_in_live_def723_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) }; -static ANTLR3_BITSET_LIST FOLLOW_LIVE_in_live_def723 = { FOLLOW_LIVE_in_live_def723_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_live_def725 */ -static ANTLR3_BITWORD FOLLOW_ID_in_live_def725_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000808) }; -static ANTLR3_BITSET_LIST FOLLOW_ID_in_live_def725 = { FOLLOW_ID_in_live_def725_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_UNCONTROL_in_uncontrol737 */ -static ANTLR3_BITWORD FOLLOW_UNCONTROL_in_uncontrol737_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) }; -static ANTLR3_BITSET_LIST FOLLOW_UNCONTROL_in_uncontrol737 = { FOLLOW_UNCONTROL_in_uncontrol737_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_uncontrol739 */ -static ANTLR3_BITWORD FOLLOW_ID_in_uncontrol739_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000808) }; -static ANTLR3_BITSET_LIST FOLLOW_ID_in_uncontrol739 = { FOLLOW_ID_in_uncontrol739_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_UNOBSERVE_in_unobserve751 */ -static ANTLR3_BITWORD FOLLOW_UNOBSERVE_in_unobserve751_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) }; -static ANTLR3_BITSET_LIST FOLLOW_UNOBSERVE_in_unobserve751 = { FOLLOW_UNOBSERVE_in_unobserve751_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_unobserve753 */ -static ANTLR3_BITWORD FOLLOW_ID_in_unobserve753_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000808) }; -static ANTLR3_BITSET_LIST FOLLOW_ID_in_unobserve753 = { FOLLOW_ID_in_unobserve753_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_print_in_other_commands765 */ -static ANTLR3_BITWORD FOLLOW_print_in_other_commands765_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) }; -static ANTLR3_BITSET_LIST FOLLOW_print_in_other_commands765 = { FOLLOW_print_in_other_commands765_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_PRINT_in_print775 */ -static ANTLR3_BITWORD FOLLOW_PRINT_in_print775_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) }; -static ANTLR3_BITSET_LIST FOLLOW_PRINT_in_print775 = { FOLLOW_PRINT_in_print775_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_print777 */ -static ANTLR3_BITWORD FOLLOW_ID_in_print777_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000088) }; -static ANTLR3_BITSET_LIST FOLLOW_ID_in_print777 = { FOLLOW_ID_in_print777_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_group_elements_in_print779 */ -static ANTLR3_BITWORD FOLLOW_group_elements_in_print779_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) }; -static ANTLR3_BITSET_LIST FOLLOW_group_elements_in_print779 = { FOLLOW_group_elements_in_print779_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_number798 */ -static ANTLR3_BITWORD FOLLOW_INT_in_number798_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) }; -static ANTLR3_BITSET_LIST FOLLOW_INT_in_number798 = { FOLLOW_INT_in_number798_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_MINUS_in_number811 */ -static ANTLR3_BITWORD FOLLOW_MINUS_in_number811_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) }; -static ANTLR3_BITSET_LIST FOLLOW_MINUS_in_number811 = { FOLLOW_MINUS_in_number811_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_number813 */ -static ANTLR3_BITWORD FOLLOW_INT_in_number813_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) }; -static ANTLR3_BITSET_LIST FOLLOW_INT_in_number813 = { FOLLOW_INT_in_number813_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_GROUP_in_group_elements831 */ -static ANTLR3_BITWORD FOLLOW_GROUP_in_group_elements831_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) }; -static ANTLR3_BITSET_LIST FOLLOW_GROUP_in_group_elements831 = { FOLLOW_GROUP_in_group_elements831_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_group_elements833 */ -static ANTLR3_BITWORD FOLLOW_ID_in_group_elements833_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000808) }; -static ANTLR3_BITSET_LIST FOLLOW_ID_in_group_elements833 = { FOLLOW_ID_in_group_elements833_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_numbered_ID844 */ -static ANTLR3_BITWORD FOLLOW_ID_in_numbered_ID844_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) }; -static ANTLR3_BITSET_LIST FOLLOW_ID_in_numbered_ID844 = { FOLLOW_ID_in_numbered_ID844_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_numbered_ID850 */ -static ANTLR3_BITWORD FOLLOW_ID_in_numbered_ID850_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) }; -static ANTLR3_BITSET_LIST FOLLOW_ID_in_numbered_ID850 = { FOLLOW_ID_in_numbered_ID850_bits, 1 }; -/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_numbered_ID852 */ -static ANTLR3_BITWORD FOLLOW_INT_in_numbered_ID852_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) }; -static ANTLR3_BITSET_LIST FOLLOW_INT_in_numbered_ID852 = { FOLLOW_INT_in_numbered_ID852_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_EQ_OP_in_relationalExpression387 */ +static ANTLR3_BITWORD FOLLOW_EQ_OP_in_relationalExpression387_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) }; +static ANTLR3_BITSET_LIST FOLLOW_EQ_OP_in_relationalExpression387 = { FOLLOW_EQ_OP_in_relationalExpression387_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_additiveExpression_in_relationalExpression391 */ +static ANTLR3_BITWORD FOLLOW_additiveExpression_in_relationalExpression391_bits[] = { ANTLR3_UINT64_LIT(0x00000000C2080088) }; +static ANTLR3_BITSET_LIST FOLLOW_additiveExpression_in_relationalExpression391 = { FOLLOW_additiveExpression_in_relationalExpression391_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_additiveExpression_in_relationalExpression397 */ +static ANTLR3_BITWORD FOLLOW_additiveExpression_in_relationalExpression397_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) }; +static ANTLR3_BITSET_LIST FOLLOW_additiveExpression_in_relationalExpression397 = { FOLLOW_additiveExpression_in_relationalExpression397_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_primary_in_additiveExpression444 */ +static ANTLR3_BITWORD FOLLOW_primary_in_additiveExpression444_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) }; +static ANTLR3_BITSET_LIST FOLLOW_primary_in_additiveExpression444 = { FOLLOW_primary_in_additiveExpression444_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_PLUS_in_additiveExpression456 */ +static ANTLR3_BITWORD FOLLOW_PLUS_in_additiveExpression456_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) }; +static ANTLR3_BITSET_LIST FOLLOW_PLUS_in_additiveExpression456 = { FOLLOW_PLUS_in_additiveExpression456_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_additiveExpression_in_additiveExpression460 */ +static ANTLR3_BITWORD FOLLOW_additiveExpression_in_additiveExpression460_bits[] = { ANTLR3_UINT64_LIT(0x00000000C2080088) }; +static ANTLR3_BITSET_LIST FOLLOW_additiveExpression_in_additiveExpression460 = { FOLLOW_additiveExpression_in_additiveExpression460_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_additiveExpression_in_additiveExpression477 */ +static ANTLR3_BITWORD FOLLOW_additiveExpression_in_additiveExpression477_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) }; +static ANTLR3_BITSET_LIST FOLLOW_additiveExpression_in_additiveExpression477 = { FOLLOW_additiveExpression_in_additiveExpression477_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_MINUS_in_additiveExpression618 */ +static ANTLR3_BITWORD FOLLOW_MINUS_in_additiveExpression618_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) }; +static ANTLR3_BITSET_LIST FOLLOW_MINUS_in_additiveExpression618 = { FOLLOW_MINUS_in_additiveExpression618_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_additiveExpression_in_additiveExpression622 */ +static ANTLR3_BITWORD FOLLOW_additiveExpression_in_additiveExpression622_bits[] = { ANTLR3_UINT64_LIT(0x00000000C2080088) }; +static ANTLR3_BITSET_LIST FOLLOW_additiveExpression_in_additiveExpression622 = { FOLLOW_additiveExpression_in_additiveExpression622_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_additiveExpression_in_additiveExpression638 */ +static ANTLR3_BITWORD FOLLOW_additiveExpression_in_additiveExpression638_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) }; +static ANTLR3_BITSET_LIST FOLLOW_additiveExpression_in_additiveExpression638 = { FOLLOW_additiveExpression_in_additiveExpression638_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_MINUS_in_primary795 */ +static ANTLR3_BITWORD FOLLOW_MINUS_in_primary795_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) }; +static ANTLR3_BITSET_LIST FOLLOW_MINUS_in_primary795 = { FOLLOW_MINUS_in_primary795_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_eq_in_primary799 */ +static ANTLR3_BITWORD FOLLOW_eq_in_primary799_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) }; +static ANTLR3_BITSET_LIST FOLLOW_eq_in_primary799 = { FOLLOW_eq_in_primary799_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_group_elements_in_primary814 */ +static ANTLR3_BITWORD FOLLOW_group_elements_in_primary814_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) }; +static ANTLR3_BITSET_LIST FOLLOW_group_elements_in_primary814 = { FOLLOW_group_elements_in_primary814_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_number_in_primary855 */ +static ANTLR3_BITWORD FOLLOW_number_in_primary855_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) }; +static ANTLR3_BITSET_LIST FOLLOW_number_in_primary855 = { FOLLOW_number_in_primary855_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_MULT_in_primary868 */ +static ANTLR3_BITWORD FOLLOW_MULT_in_primary868_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) }; +static ANTLR3_BITSET_LIST FOLLOW_MULT_in_primary868 = { FOLLOW_MULT_in_primary868_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_number_in_primary870 */ +static ANTLR3_BITWORD FOLLOW_number_in_primary870_bits[] = { ANTLR3_UINT64_LIT(0x0000000082080088) }; +static ANTLR3_BITSET_LIST FOLLOW_number_in_primary870 = { FOLLOW_number_in_primary870_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_primary_in_primary872 */ +static ANTLR3_BITWORD FOLLOW_primary_in_primary872_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) }; +static ANTLR3_BITSET_LIST FOLLOW_primary_in_primary872 = { FOLLOW_primary_in_primary872_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_MULT_in_primary903 */ +static ANTLR3_BITWORD FOLLOW_MULT_in_primary903_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) }; +static ANTLR3_BITSET_LIST FOLLOW_MULT_in_primary903 = { FOLLOW_MULT_in_primary903_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_number_in_primary905 */ +static ANTLR3_BITWORD FOLLOW_number_in_primary905_bits[] = { ANTLR3_UINT64_LIT(0x0000000038000000) }; +static ANTLR3_BITSET_LIST FOLLOW_number_in_primary905 = { FOLLOW_number_in_primary905_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_eq_in_primary909 */ +static ANTLR3_BITWORD FOLLOW_eq_in_primary909_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) }; +static ANTLR3_BITSET_LIST FOLLOW_eq_in_primary909 = { FOLLOW_eq_in_primary909_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_LIVE_in_live_def933 */ +static ANTLR3_BITWORD FOLLOW_LIVE_in_live_def933_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) }; +static ANTLR3_BITSET_LIST FOLLOW_LIVE_in_live_def933 = { FOLLOW_LIVE_in_live_def933_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_ALL_in_live_def935 */ +static ANTLR3_BITWORD FOLLOW_ALL_in_live_def935_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000808) }; +static ANTLR3_BITSET_LIST FOLLOW_ALL_in_live_def935 = { FOLLOW_ALL_in_live_def935_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_live_def937 */ +static ANTLR3_BITWORD FOLLOW_ID_in_live_def937_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000808) }; +static ANTLR3_BITSET_LIST FOLLOW_ID_in_live_def937 = { FOLLOW_ID_in_live_def937_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_LIVE_in_live_def945 */ +static ANTLR3_BITWORD FOLLOW_LIVE_in_live_def945_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) }; +static ANTLR3_BITSET_LIST FOLLOW_LIVE_in_live_def945 = { FOLLOW_LIVE_in_live_def945_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_live_def947 */ +static ANTLR3_BITWORD FOLLOW_ID_in_live_def947_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000808) }; +static ANTLR3_BITSET_LIST FOLLOW_ID_in_live_def947 = { FOLLOW_ID_in_live_def947_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_UNCONTROL_in_uncontrol959 */ +static ANTLR3_BITWORD FOLLOW_UNCONTROL_in_uncontrol959_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) }; +static ANTLR3_BITSET_LIST FOLLOW_UNCONTROL_in_uncontrol959 = { FOLLOW_UNCONTROL_in_uncontrol959_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_uncontrol961 */ +static ANTLR3_BITWORD FOLLOW_ID_in_uncontrol961_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000808) }; +static ANTLR3_BITSET_LIST FOLLOW_ID_in_uncontrol961 = { FOLLOW_ID_in_uncontrol961_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_UNOBSERVE_in_unobserve973 */ +static ANTLR3_BITWORD FOLLOW_UNOBSERVE_in_unobserve973_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) }; +static ANTLR3_BITSET_LIST FOLLOW_UNOBSERVE_in_unobserve973 = { FOLLOW_UNOBSERVE_in_unobserve973_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_unobserve975 */ +static ANTLR3_BITWORD FOLLOW_ID_in_unobserve975_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000808) }; +static ANTLR3_BITSET_LIST FOLLOW_ID_in_unobserve975 = { FOLLOW_ID_in_unobserve975_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_print_in_other_commands987 */ +static ANTLR3_BITWORD FOLLOW_print_in_other_commands987_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) }; +static ANTLR3_BITSET_LIST FOLLOW_print_in_other_commands987 = { FOLLOW_print_in_other_commands987_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_PRINT_in_print997 */ +static ANTLR3_BITWORD FOLLOW_PRINT_in_print997_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) }; +static ANTLR3_BITSET_LIST FOLLOW_PRINT_in_print997 = { FOLLOW_PRINT_in_print997_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_print999 */ +static ANTLR3_BITWORD FOLLOW_ID_in_print999_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000088) }; +static ANTLR3_BITSET_LIST FOLLOW_ID_in_print999 = { FOLLOW_ID_in_print999_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_group_elements_in_print1001 */ +static ANTLR3_BITWORD FOLLOW_group_elements_in_print1001_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) }; +static ANTLR3_BITSET_LIST FOLLOW_group_elements_in_print1001 = { FOLLOW_group_elements_in_print1001_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_number1020 */ +static ANTLR3_BITWORD FOLLOW_INT_in_number1020_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) }; +static ANTLR3_BITSET_LIST FOLLOW_INT_in_number1020 = { FOLLOW_INT_in_number1020_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_MINUS_in_number1033 */ +static ANTLR3_BITWORD FOLLOW_MINUS_in_number1033_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) }; +static ANTLR3_BITSET_LIST FOLLOW_MINUS_in_number1033 = { FOLLOW_MINUS_in_number1033_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_number1035 */ +static ANTLR3_BITWORD FOLLOW_INT_in_number1035_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) }; +static ANTLR3_BITSET_LIST FOLLOW_INT_in_number1035 = { FOLLOW_INT_in_number1035_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_GROUP_in_group_elements1053 */ +static ANTLR3_BITWORD FOLLOW_GROUP_in_group_elements1053_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) }; +static ANTLR3_BITSET_LIST FOLLOW_GROUP_in_group_elements1053 = { FOLLOW_GROUP_in_group_elements1053_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_group_elements1055 */ +static ANTLR3_BITWORD FOLLOW_ID_in_group_elements1055_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000808) }; +static ANTLR3_BITSET_LIST FOLLOW_ID_in_group_elements1055 = { FOLLOW_ID_in_group_elements1055_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_numbered_ID1066 */ +static ANTLR3_BITWORD FOLLOW_ID_in_numbered_ID1066_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) }; +static ANTLR3_BITSET_LIST FOLLOW_ID_in_numbered_ID1066 = { FOLLOW_ID_in_numbered_ID1066_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_numbered_ID1072 */ +static ANTLR3_BITWORD FOLLOW_ID_in_numbered_ID1072_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) }; +static ANTLR3_BITSET_LIST FOLLOW_ID_in_numbered_ID1072 = { FOLLOW_ID_in_numbered_ID1072_bits, 1 }; +/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_numbered_ID1074 */ +static ANTLR3_BITWORD FOLLOW_INT_in_numbered_ID1074_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) }; +static ANTLR3_BITSET_LIST FOLLOW_INT_in_numbered_ID1074 = { FOLLOW_INT_in_numbered_ID1074_bits, 1 }; @@ -822,7 +822,7 @@ * DFA tables for the parser */ /** Static dfa state tables for Cyclic dfa: - * 160:1: primary[bool enableAlt] : ( ^( MINUS eq ) -> eq | group_elements -> {!enableAlt || i == 1}? group_elements -> ^( MULT[tok2, newVal2] NUM[tok, newVal] group_elements ) | number | ^( MULT number primary[false] ) -> {$number.value == 0}? -> ^( MULT number primary ) | ^( MULT number eq ) -> {i == 0}? -> eq ); + * 195:1: primary[bool enableAlt] returns [int num, bool numeric] : ( ^( MINUS eq ) -> eq | group_elements -> {!enableAlt || i == 1}? group_elements -> ^( MULT[tok2, newVal2] NUM[tok, newVal] group_elements ) | number -> | ^( MULT number primary[false] ) -> {$number.value == 0}? -> ^( MULT INT[tok, newVal] primary ) | ^( MULT number eq ) -> {i == 0}? -> eq ); */ static const ANTLR3_INT32 dfa24_eot[15] = { @@ -854,33 +854,33 @@ static const ANTLR3_INT32 dfa24_T0[] = { - 14 + 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4, -1, -1, -1, -1, -1, 3, + -1, -1, -1, -1, -1, 1 };static const ANTLR3_INT32 dfa24_T1[] = { - 3, -1, 7, 7, 7 + 12 };static const ANTLR3_INT32 dfa24_T2[] = { + 5 + };static const ANTLR3_INT32 dfa24_T3[] = + { 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, 10, -1, 11, 11, 11, -1, 10 - };static const ANTLR3_INT32 dfa24_T3[] = + };static const ANTLR3_INT32 dfa24_T4[] = { 13 - };static const ANTLR3_INT32 dfa24_T4[] = - { - 6 };static const ANTLR3_INT32 dfa24_T5[] = { 8, -1, -1, -1, -1, -1, 9 };static const ANTLR3_INT32 dfa24_T6[] = { - 12 + 6 };static const ANTLR3_INT32 dfa24_T7[] = { - 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4, -1, -1, -1, -1, -1, 3, - -1, -1, -1, -1, -1, 1 + 14 };static const ANTLR3_INT32 dfa24_T8[] = { - 5 + 3, -1, 7, 7, 7 }; /* Transition tables are a table of sub tables, with some tables @@ -888,9 +888,9 @@ */ static const ANTLR3_INT32 * const dfa24_transitions[] = { - dfa24_T7, dfa24_T8, dfa24_T_empty, dfa24_T_empty, dfa24_T4, dfa24_T1, - dfa24_T5, dfa24_T_empty, dfa24_T2, dfa24_T6, dfa24_T_empty, dfa24_T_empty, - dfa24_T3, dfa24_T0, dfa24_T2 + dfa24_T0, dfa24_T2, dfa24_T_empty, dfa24_T_empty, dfa24_T6, dfa24_T8, + dfa24_T5, dfa24_T_empty, dfa24_T3, dfa24_T1, dfa24_T_empty, dfa24_T_empty, + dfa24_T4, dfa24_T7, dfa24_T3 }; @@ -901,7 +901,7 @@ = { 24, /* Decision number of this dfa */ /* Which decision this represents: */ - (const pANTLR3_UCHAR)"160:1: primary[bool enableAlt] : ( ^( MINUS eq ) -> eq | group_elements -> {!enableAlt || i == 1}? group_elements -> ^( MULT[tok2, newVal2] NUM[tok, newVal] group_elements ) | number | ^( MULT number primary[false] ) -> {$number.value == 0}? -> ^( MULT number primary ) | ^( MULT number eq ) -> {i == 0}? -> eq );", + (const pANTLR3_UCHAR)"195:1: primary[bool enableAlt] returns [int num, bool numeric] : ( ^( MINUS eq ) -> eq | group_elements -> {!enableAlt || i == 1}? group_elements -> ^( MULT[tok2, newVal2] NUM[tok, newVal] group_elements ) | number -> | ^( MULT number primary[false] ) -> {$number.value == 0}? -> ^( MULT INT[tok, newVal] primary ) | ^( MULT number eq ) -> {i == 0}? -> eq );", (CDFA_SPECIAL_FUNC) antlr3dfaspecialStateTransition, /* Default special state transition function */ antlr3dfaspecialTransition, /* DFA specialTransition is currently just a default function in the runtime */ antlr3dfapredict, /* DFA simulator function is in the runtime */ @@ -3285,7 +3285,7 @@ /** * $ANTLR start constraints - * /Users/bion/projects/iordache/translator/pncompactor.g:69:1: constraints : ^( constraint_block ( ( eq ) | live_def | uncontrol | unobserve )* ) ; + * /Users/bion/projects/iordache/translator/pncompactor.g:69:1: constraints : ^( constraint_block ( ( eq ) | live_def | uncontrol | unobserve )+ ) ; */ static pncompactor_constraints_return constraints(ppncompactor ctx) @@ -3345,8 +3345,8 @@ retval.tree = NULL; { - // /Users/bion/projects/iordache/translator/pncompactor.g:74:2: ( ^( constraint_block ( ( eq ) | live_def | uncontrol | unobserve )* ) ) - // /Users/bion/projects/iordache/translator/pncompactor.g:74:4: ^( constraint_block ( ( eq ) | live_def | uncontrol | unobserve )* ) + // /Users/bion/projects/iordache/translator/pncompactor.g:74:2: ( ^( constraint_block ( ( eq ) | live_def | uncontrol | unobserve )+ ) ) + // /Users/bion/projects/iordache/translator/pncompactor.g:74:4: ^( constraint_block ( ( eq ) | live_def | uncontrol | unobserve )+ ) { root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR)); @@ -3369,149 +3369,160 @@ root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, constraint_block38.tree, root_1)); - if ( LA(1)==ANTLR3_TOKEN_DOWN ) { - MATCHT(ANTLR3_TOKEN_DOWN, NULL); + MATCHT(ANTLR3_TOKEN_DOWN, NULL); + // /Users/bion/projects/iordache/translator/pncompactor.g:74:23: ( ( eq ) | live_def | uncontrol | unobserve )+ + { + int cnt21=0; - // /Users/bion/projects/iordache/translator/pncompactor.g:74:23: ( ( eq ) | live_def | uncontrol | unobserve )* - for (;;) { int alt21=5; - switch ( LA(1) ) - { - case AND_OP: - case OR_OP: - case EQ_OP: - { - alt21=1; - } - break; - case LIVE: - { - alt21=2; - } - break; - case UNCONTROL: - { - alt21=3; - } - break; - case UNOBSERVE: - { - alt21=4; - } - break; + switch ( LA(1) ) + { + case AND_OP: + case OR_OP: + case EQ_OP: + { + alt21=1; + } + break; + case LIVE: + { + alt21=2; + } + break; + case UNCONTROL: + { + alt21=3; + } + break; + case UNOBSERVE: + { + alt21=4; + } + break; - } + } - switch (alt21) - { - case 1: - // /Users/bion/projects/iordache/translator/pncompactor.g:74:24: ( eq ) - { - // /Users/bion/projects/iordache/translator/pncompactor.g:74:24: ( eq ) - // /Users/bion/projects/iordache/translator/pncompactor.g:74:25: eq - { - { + switch (alt21) + { + case 1: + // /Users/bion/projects/iordache/translator/pncompactor.g:74:24: ( eq ) + { + // /Users/bion/projects/iordache/translator/pncompactor.g:74:24: ( eq ) + // /Users/bion/projects/iordache/translator/pncompactor.g:74:25: eq + { + { - (SCOPE_TOP(constraints))->dist= antlr3StackNew(ANTLR3_SIZE_HINT); - int j = 1; - (SCOPE_TOP(constraints))->dist->push( (SCOPE_TOP(constraints))->dist, &j, NULL); - if(DEBUG) { - printf("-->%d : %d\n", *(int*) (SCOPE_TOP(constraints))->dist->peek( (SCOPE_TOP(constraints))->dist), (SCOPE_TOP(constraints))->dist->size( (SCOPE_TOP(constraints))->dist)); - } - - } - _last = (pANTLR3_BASE_TREE)LT(1); - FOLLOWPUSH(FOLLOW_eq_in_constraints317); - eq39=eq(ctx); + (SCOPE_TOP(constraints))->dist= antlr3StackNew(ANTLR3_SIZE_HINT); + int j = 1; + (SCOPE_TOP(constraints))->dist->push( (SCOPE_TOP(constraints))->dist, &j, NULL); + if(DEBUG) { + printf("-->%d : %d\n", *(int*) (SCOPE_TOP(constraints))->dist->peek( (SCOPE_TOP(constraints))->dist), (SCOPE_TOP(constraints))->dist->size( (SCOPE_TOP(constraints))->dist)); + } + + } + _last = (pANTLR3_BASE_TREE)LT(1); + FOLLOWPUSH(FOLLOW_eq_in_constraints317); + eq39=eq(ctx); - FOLLOWPOP(); - if (HASEXCEPTION()) - { - goto ruleconstraintsEx; - } + FOLLOWPOP(); + if (HASEXCEPTION()) + { + goto ruleconstraintsEx; + } - ADAPTOR->addChild(ADAPTOR, root_1, eq39.tree); - { + ADAPTOR->addChild(ADAPTOR, root_1, eq39.tree); + { - if(DEBUG) { - printf("---------------------\n"); - fflush(stdout); - } - - } + if(DEBUG) { + printf("---------------------\n"); + fflush(stdout); + } + + } - } + } - } - break; - case 2: - // /Users/bion/projects/iordache/translator/pncompactor.g:86:6: live_def - { - _last = (pANTLR3_BASE_TREE)LT(1); - FOLLOWPUSH(FOLLOW_live_def_in_constraints322); - live_def40=live_def(ctx); + } + break; + case 2: + // /Users/bion/projects/iordache/translator/pncompactor.g:86:6: live_def + { + _last = (pANTLR3_BASE_TREE)LT(1); + FOLLOWPUSH(FOLLOW_live_def_in_constraints322); + live_def40=live_def(ctx); - FOLLOWPOP(); - if (HASEXCEPTION()) - { - goto ruleconstraintsEx; - } + FOLLOWPOP(); + if (HASEXCEPTION()) + { + goto ruleconstraintsEx; + } - ADAPTOR->addChild(ADAPTOR, root_1, live_def40.tree); + ADAPTOR->addChild(ADAPTOR, root_1, live_def40.tree); - } - break; - case 3: - // /Users/bion/projects/iordache/translator/pncompactor.g:86:15: uncontrol - { - _last = (pANTLR3_BASE_TREE)LT(1); - FOLLOWPUSH(FOLLOW_uncontrol_in_constraints324); - uncontrol41=uncontrol(ctx); + } + break; + case 3: + // /Users/bion/projects/iordache/translator/pncompactor.g:86:15: uncontrol + { + _last = (pANTLR3_BASE_TREE)LT(1); + FOLLOWPUSH(FOLLOW_uncontrol_in_constraints324); + uncontrol41=uncontrol(ctx); - FOLLOWPOP(); - if (HASEXCEPTION()) - { - goto ruleconstraintsEx; - } + FOLLOWPOP(); + if (HASEXCEPTION()) + { + goto ruleconstraintsEx; + } - ADAPTOR->addChild(ADAPTOR, root_1, uncontrol41.tree); + ADAPTOR->addChild(ADAPTOR, root_1, uncontrol41.tree); - } - break; - case 4: - // /Users/bion/projects/iordache/translator/pncompactor.g:86:25: unobserve - { - _last = (pANTLR3_BASE_TREE)LT(1); - FOLLOWPUSH(FOLLOW_unobserve_in_constraints326); - unobserve42=unobserve(ctx); + } + break; + case 4: + // /Users/bion/projects/iordache/translator/pncompactor.g:86:25: unobserve + { + _last = (pANTLR3_BASE_TREE)LT(1); + FOLLOWPUSH(FOLLOW_unobserve_in_constraints326); + unobserve42=unobserve(ctx); - FOLLOWPOP(); - if (HASEXCEPTION()) - { - goto ruleconstraintsEx; - } + FOLLOWPOP(); + if (HASEXCEPTION()) + { + goto ruleconstraintsEx; + } - ADAPTOR->addChild(ADAPTOR, root_1, unobserve42.tree); + ADAPTOR->addChild(ADAPTOR, root_1, unobserve42.tree); - } - break; + } + break; - default: - goto loop21; /* break out of the loop */ - break; - } - } - loop21: ; /* Jump out to here if this rule does not match */ + default: + + if ( cnt21 >= 1 ) + { + goto loop21; + } + /* mismatchedSetEx() + */ + CONSTRUCTEX(); + EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION; + EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME; - MATCHT(ANTLR3_TOKEN_UP, NULL); - }ADAPTOR->addChild(ADAPTOR, root_0, root_1);_last = _save_last_1; + goto ruleconstraintsEx; + } + cnt21++; + } + loop21: ; /* Jump to here if this rule does not match */ } + MATCHT(ANTLR3_TOKEN_UP, NULL); ADAPTOR->addChild(ADAPTOR, root_0, root_1);_last = _save_last_1; + } + } } @@ -3808,7 +3819,7 @@ /** * $ANTLR start relationalExpression - * /Users/bion/projects/iordache/translator/pncompactor.g:93:1: relationalExpression : ^( EQ_OP additiveExpression additiveExpression ) ; + * /Users/bion/projects/iordache/translator/pncompactor.g:93:1: relationalExpression : ^( EQ_OP add1= additiveExpression add2= additiveExpression ) -> ^( EQ_OP ^( ADD[tok1] $add1 $add2) NUM[tok2, str2] ) ; */ static pncompactor_relationalExpression_return relationalExpression(ppncompactor ctx) @@ -3822,16 +3833,17 @@ pANTLR3_BASE_TREE _first_0; pANTLR3_BASE_TREE EQ_OP48; - pncompactor_additiveExpression_return additiveExpression49; - #undef RETURN_TYPE_additiveExpression49 - #define RETURN_TYPE_additiveExpression49 pncompactor_additiveExpression_return + pncompactor_additiveExpression_return add1; + #undef RETURN_TYPE_add1 + #define RETURN_TYPE_add1 pncompactor_additiveExpression_return - pncompactor_additiveExpression_return additiveExpression50; - #undef RETURN_TYPE_additiveExpression50 - #define RETURN_TYPE_additiveExpression50 pncompactor_additiveExpression_return + pncompactor_additiveExpression_return add2; + #undef RETURN_TYPE_add2 + #define RETURN_TYPE_add2 pncompactor_additiveExpression_return pANTLR3_BASE_TREE EQ_OP48_tree; - + pANTLR3_REWRITE_RULE_NODE_STREAM stream_EQ_OP; + pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_additiveExpression; /* Initialize rule variables */ @@ -3842,23 +3854,30 @@ _first_0 = NULL; + + pANTLR3_COMMON_TOKEN tok1; + pANTLR3_COMMON_TOKEN tok2; + char* str2; + EQ_OP48 = NULL; - additiveExpression49.tree = NULL; + add1.tree = NULL; - additiveExpression50.tree = NULL; + add2.tree = NULL; retval.start = LT(1); retval.stop = retval.start; EQ_OP48_tree = NULL; + stream_EQ_OP = NULL; + #define CREATE_stream_EQ_OP if (stream_EQ_OP == NULL) {stream_EQ_OP = antlr3RewriteRuleNODEStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token EQ_OP"); } + stream_additiveExpression = NULL; + #define CREATE_stream_additiveExpression if (stream_additiveExpression == NULL) {stream_additiveExpression = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule additiveExpression"); } retval.tree = NULL; { - // /Users/bion/projects/iordache/translator/pncompactor.g:99:5: ( ^( EQ_OP additiveExpression additiveExpression ) ) - // /Users/bion/projects/iordache/translator/pncompactor.g:99:9: ^( EQ_OP additiveExpression additiveExpression ) + // /Users/bion/projects/iordache/translator/pncompactor.g:104:5: ( ^( EQ_OP add1= additiveExpression add2= additiveExpression ) -> ^( EQ_OP ^( ADD[tok1] $add1 $add2) NUM[tok2, str2] ) ) + // /Users/bion/projects/iordache/translator/pncompactor.g:104:9: ^( EQ_OP add1= additiveExpression add2= additiveExpression ) { - root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR)); - _last = (pANTLR3_BASE_TREE)LT(1); { pANTLR3_BASE_TREE _save_last_1; @@ -3866,22 +3885,20 @@ pANTLR3_BASE_TREE root_1;_save_last_1 = _last; _first_last_1 = NULL; root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));_last = (pANTLR3_BASE_TREE)LT(1); - EQ_OP48 = (pANTLR3_BASE_TREE) MATCHT(EQ_OP, &FOLLOW_EQ_OP_in_relationalExpression382); + EQ_OP48 = (pANTLR3_BASE_TREE) MATCHT(EQ_OP, &FOLLOW_EQ_OP_in_relationalExpression387); if (HASEXCEPTION()) { goto rulerelationalExpressionEx; } + + CREATE_stream_EQ_OP; stream_EQ_OP->add(stream_EQ_OP, EQ_OP48, NULL); - EQ_OP48_tree = (pANTLR3_BASE_TREE)ADAPTOR->dupNode(ADAPTOR, EQ_OP48); - root_1 = (pANTLR3_BASE_TREE)ADAPTOR->becomeRoot(ADAPTOR, EQ_OP48_tree, root_1); - - MATCHT(ANTLR3_TOKEN_DOWN, NULL); _last = (pANTLR3_BASE_TREE)LT(1); - FOLLOWPUSH(FOLLOW_additiveExpression_in_relationalExpression384); - additiveExpression49=additiveExpression(ctx); + FOLLOWPUSH(FOLLOW_additiveExpression_in_relationalExpression391); + add1=additiveExpression(ctx); FOLLOWPOP(); if (HASEXCEPTION()) @@ -3889,13 +3906,13 @@ goto rulerelationalExpressionEx; } - ADAPTOR->addChild(ADAPTOR, root_1, additiveExpression49.tree); + CREATE_stream_additiveExpression; stream_additiveExpression->add(stream_additiveExpression, add1.tree, NULL); { if(DEBUG) { printf("#######\n"); } } _last = (pANTLR3_BASE_TREE)LT(1); - FOLLOWPUSH(FOLLOW_additiveExpression_in_relationalExpression388); - additiveExpression50=additiveExpression(ctx); + FOLLOWPUSH(FOLLOW_additiveExpression_in_relationalExpression397); + add2=additiveExpression(ctx); FOLLOWPOP(); if (HASEXCEPTION()) @@ -3903,12 +3920,82 @@ goto rulerelationalExpressionEx; } - ADAPTOR->addChild(ADAPTOR, root_1, additiveExpression50.tree); + CREATE_stream_additiveExpression; stream_additiveExpression->add(stream_additiveExpression, add2.tree, NULL); MATCHT(ANTLR3_TOKEN_UP, NULL); ADAPTOR->addChild(ADAPTOR, root_0, root_1);_last = _save_last_1; } + { + str2 = (char*)tcalloc(abs(add1.num + add2.num)%10+2, sizeof(char)); + sprintf(str2, "%d", add1.num+add2.num); + tok1 = ADAPTOR->createToken(ADAPTOR, MINUS, (pANTLR3_UINT8)"+"); + tok2 = ADAPTOR->createToken(ADAPTOR, MINUS, (pANTLR3_UINT8)str2); + + } + + + /* AST REWRITE + * elements : add1, EQ_OP, add2 + * token labels : + * rule labels : add2, add1, retval + * token list labels : + * rule list labels : + */ + { + pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_add2; + pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_add1; + pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval; + + stream_add2=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token add2", add2.tree != NULL ? add2.tree : NULL); + stream_add1=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token add1", add1.tree != NULL ? add1.tree : NULL); + stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL); + + root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR)); + retval.tree = root_0; + // 109:8: -> ^( EQ_OP ^( ADD[tok1] $add1 $add2) NUM[tok2, str2] ) + { + // /Users/bion/projects/iordache/translator/pncompactor.g:109:11: ^( EQ_OP ^( ADD[tok1] $add1 $add2) NUM[tok2, str2] ) + { + pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR)); + root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_EQ_OP->nextNode(stream_EQ_OP), root_1)); + + // /Users/bion/projects/iordache/translator/pncompactor.g:109:19: ^( ADD[tok1] $add1 $add2) + { + pANTLR3_BASE_TREE root_2 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR)); + root_2 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, + #if 1 == 2 + (pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, ADD, TOKTEXT(tok1)) + #else + (pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, ADD, (pANTLR3_UINT8)tok1) + #endif + , root_2)); + + ADAPTOR->addChild(ADAPTOR, root_2, stream_add1 == NULL ? NULL : stream_add1->nextTree(stream_add1)); + ADAPTOR->addChild(ADAPTOR, root_2, stream_add2 == NULL ? NULL : stream_add2->nextTree(stream_add2)); + + ADAPTOR->addChild(ADAPTOR, root_1, root_2); + } + ADAPTOR->addChild(ADAPTOR, root_1, + #if 2 == 2 + (pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, NUM, TOKTEXT(tok2, str2)) + #else + (pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, NUM, (pANTLR3_UINT8)tok2, str2) + #endif + ); + + ADAPTOR->addChild(ADAPTOR, root_0, root_1); + } + + } + + retval.tree = root_0; // set result root + if (stream_add2 != NULL) stream_add2->free(stream_add2); + if (stream_add1 != NULL) stream_add1->free(stream_add1); + if (stream_retval != NULL) stream_retval->free(stream_retval); + + + } } } @@ -3921,8 +4008,8 @@ retval.stop = LT(-1); retval.tree = (pANTLR3_BASE_TREE)ADAPTOR->rulePostProcessing(ADAPTOR, root_0); - - + if (stream_EQ_OP != NULL) stream_EQ_OP->free(stream_EQ_OP); + if (stream_additiveExpression != NULL) stream_additiveExpression->free(stream_additiveExpression); if (HASEXCEPTION()) { PREPORTERROR(); @@ -3935,7 +4022,7 @@ /** * $ANTLR start additiveExpression - * /Users/bion/projects/iordache/translator/pncompactor.g:101:1: additiveExpression : ( primary[true] | ^( PLUS add1= additiveExpression add2= additiveExpression ) -> {flipped}? ^( SUB[tok, \"-\"] $add1 $add2) -> ^( ADD[tok, \"+\"] $add1 $add2) | ^( MINUS add1= additiveExpression add2= additiveExpression ) -> {flipped}? ^( ADD[tok, \"+\"] $add1 $add2) -> ^( SUB[tok, \"-\"] $add1 $add2) ); + * /Users/bion/projects/iordache/translator/pncompactor.g:111:1: additiveExpression returns [int num, bool numeric] : ( primary[true] | ^( PLUS add1= additiveExpression add2= additiveExpression ) -> {$add1.numeric && $add2.numeric}? -> {$add1.numeric && flipped}? ^( MINUS[tok, \"-\"] $add2) -> {$add1.numeric}? ^( PLUS[tok, \"+\"] $add2) -> {$add2.numeric}? ^( PLUS[tok, \"+\"] $add1) -> {flipped}? ^( SUB[tok, \"-\"] $add1 $add2) -> ^( ADD[tok, \"+\"] $add1 $add2) | ^( MINUS add1= additiveExpression add2= additiveExpression ) -> {$add1.numeric && $add2.numeric}? -> {$add1.numeric && flipped}? ^( PLUS[tok, \"+\"] $add2) -> {$add1.numeric}? ^( MINUS[tok, \"-\"] $add2) -> {$add2.numeric}? ^( PLUS[tok, \"+\"] $add1) -> {flipped}? ^( ADD[tok, \"+\"] $add1 $add2) -> ^( SUB[tok, \"-\"] $add1 $add2) ); */ static pncompactor_additiveExpression_return additiveExpression(ppncompactor ctx) @@ -3948,8 +4035,8 @@ pANTLR3_BASE_TREE _first_0; - pANTLR3_BASE_TREE PLUS52; - pANTLR3_BASE_TREE MINUS53; + pANTLR3_BASE_TREE PLUS50; + pANTLR3_BASE_TREE MINUS51; pncompactor_additiveExpression_return add1; #undef RETURN_TYPE_add1 #define RETURN_TYPE_add1 pncompactor_additiveExpression_return @@ -3958,12 +4045,12 @@ #undef RETURN_TYPE_add2 #define RETURN_TYPE_add2 pncompactor_additiveExpression_return - pncompactor_primary_return primary51; - #undef RETURN_TYPE_primary51 - #define RETURN_TYPE_primary51 pncompactor_primary_return + pncompactor_primary_return primary49; + #undef RETURN_TYPE_primary49 + #define RETURN_TYPE_primary49 pncompactor_primary_return - pANTLR3_BASE_TREE PLUS52_tree; - pANTLR3_BASE_TREE MINUS53_tree; + pANTLR3_BASE_TREE PLUS50_tree; + pANTLR3_BASE_TREE MINUS51_tree; pANTLR3_REWRITE_RULE_NODE_STREAM stream_MINUS; pANTLR3_REWRITE_RULE_NODE_STREAM stream_PLUS; pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_additiveExpression; @@ -3981,19 +4068,20 @@ bool flipped = false; int i; pANTLR3_COMMON_TOKEN tok; + char* str; - PLUS52 = NULL; - MINUS53 = NULL; + PLUS50 = NULL; + MINUS51 = NULL; add1.tree = NULL; add2.tree = NULL; - primary51.tree = NULL; + primary49.tree = NULL; retval.start = LT(1); retval.stop = retval.start; - PLUS52_tree = NULL; - MINUS53_tree = NULL; + PLUS50_tree = NULL; + MINUS51_tree = NULL; stream_MINUS = NULL; #define CREATE_stream_MINUS if (stream_MINUS == NULL) {stream_MINUS = antlr3RewriteRuleNODEStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token MINUS"); } @@ -4005,7 +4093,7 @@ retval.tree = NULL; { { - // /Users/bion/projects/iordache/translator/pncompactor.g:107:5: ( primary[true] | ^( PLUS add1= additiveExpression add2= additiveExpression ) -> {flipped}? ^( SUB[tok, \"-\"] $add1 $add2) -> ^( ADD[tok, \"+\"] $add1 $add2) | ^( MINUS add1= additiveExpression add2= additiveExpression ) -> {flipped}? ^( ADD[tok, \"+\"] $add1 $add2) -> ^( SUB[tok, \"-\"] $add1 $add2) ) + // /Users/bion/projects/iordache/translator/pncompactor.g:118:5: ( primary[true] | ^( PLUS add1= additiveExpression add2= additiveExpression ) -> {$add1.numeric && $add2.numeric}? -> {$add1.numeric && flipped}? ^( MINUS[tok, \"-\"] $add2) -> {$add1.numeric}? ^( PLUS[tok, \"+\"] $add2) -> {$add2.numeric}? ^( PLUS[tok, \"+\"] $add1) -> {flipped}? ^( SUB[tok, \"-\"] $add1 $add2) -> ^( ADD[tok, \"+\"] $add1 $add2) | ^( MINUS add1= additiveExpression add2= additiveExpression ) -> {$add1.numeric && $add2.numeric}? -> {$add1.numeric && flipped}? ^( PLUS[tok, \"+\"] $add2) -> {$add1.numeric}? ^( MINUS[tok, \"-\"] $add2) -> {$add2.numeric}? ^( PLUS[tok, \"+\"] $add1) -> {flipped}? ^( ADD[tok, \"+\"] $add1 $add2) -> ^( SUB[tok, \"-\"] $add1 $add2) ) ANTLR3_UINT32 alt23; @@ -4120,13 +4208,13 @@ switch (alt23) { case 1: - // /Users/bion/projects/iordache/translator/pncompactor.g:107:9: primary[true] + // /Users/bion/projects/iordache/translator/pncompactor.g:118:9: primary[true] { root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR)); _last = (pANTLR3_BASE_TREE)LT(1); - FOLLOWPUSH(FOLLOW_primary_in_additiveExpression409); - primary51=primary(ctx, true); + FOLLOWPUSH(FOLLOW_primary_in_additiveExpression444); + primary49=primary(ctx, true); FOLLOWPOP(); if (HASEXCEPTION()) @@ -4134,12 +4222,18 @@ goto ruleadditiveExpressionEx; } - ADAPTOR->addChild(ADAPTOR, root_0, primary51.tree); + ADAPTOR->addChild(ADAPTOR, root_0, primary49.tree); + { + retval.num= primary49.num; + retval.numeric= primary49.numeric; + + } + } break; case 2: - // /Users/bion/projects/iordache/translator/pncompactor.g:108:7: ^( PLUS add1= additiveExpression add2= additiveExpression ) + // /Users/bion/projects/iordache/translator/pncompactor.g:122:7: ^( PLUS add1= additiveExpression add2= additiveExpression ) { _last = (pANTLR3_BASE_TREE)LT(1); { @@ -4148,19 +4242,19 @@ pANTLR3_BASE_TREE root_1;_save_last_1 = _last; _first_last_1 = NULL; root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));_last = (pANTLR3_BASE_TREE)LT(1); - PLUS52 = (pANTLR3_BASE_TREE) MATCHT(PLUS, &FOLLOW_PLUS_in_additiveExpression419); + PLUS50 = (pANTLR3_BASE_TREE) MATCHT(PLUS, &FOLLOW_PLUS_in_additiveExpression456); if (HASEXCEPTION()) { goto ruleadditiveExpressionEx; } - CREATE_stream_PLUS; stream_PLUS->add(stream_PLUS, PLUS52, NULL); + CREATE_stream_PLUS; stream_PLUS->add(stream_PLUS, PLUS50, NULL); MATCHT(ANTLR3_TOKEN_DOWN, NULL); _last = (pANTLR3_BASE_TREE)LT(1); - FOLLOWPUSH(FOLLOW_additiveExpression_in_additiveExpression423); + FOLLOWPUSH(FOLLOW_additiveExpression_in_additiveExpression460); add1=additiveExpression(ctx); FOLLOWPOP(); @@ -4183,7 +4277,7 @@ } _last = (pANTLR3_BASE_TREE)LT(1); - FOLLOWPUSH(FOLLOW_additiveExpression_in_additiveExpression440); + FOLLOWPUSH(FOLLOW_additiveExpression_in_additiveExpression477); add2=additiveExpression(ctx); FOLLOWPOP(); @@ -4213,30 +4307,105 @@ MATCHT(ANTLR3_TOKEN_UP, NULL); ADAPTOR->addChild(ADAPTOR, root_0, root_1);_last = _save_last_1; } + { + if(flipped) { + retval.num= add1.num-add2.num; + } else { + retval.num= add2.num+add1.num; + ... [truncated message content] |