class Main{
	public static void main (String[] args) {
		System.out.println(new Fac1().fac(10)) ;
	}
}

class Fac { 
	//ahjgdg jhs;
	int num_aux;
	public int fac(int num) {  //scope of the variable is from Parent to the child
		int num_aux ;
		//int[] arr;
		if (9 < 8) 
			num_aux = 1;
		else
			num_aux = num ;//this.fac(num-1) ;
		return num_aux ;
	}
}

//class Fac1 {}

class Fac1 extends Fac{ 

	int num_aux;
	public int fac(int num) {
	
		int num_aux ;
		//int[] arr;
		if (num < 1) 
			num_aux = 1 ;
		else
			num_aux = num; //*this.fac(num-1) ;
		return num_aux ;
	}
}
Submitted on 26 November 2010 at 17:01

On 27 November 2010 at 14:24 Lennart Kats commented:

Even though the grammar says ID -> Type, "int" -> Type {prefer} and "int" -> ID {reject}, “int” is parsed as a Type here. I got a full copy of the grammar for reference. Looks like an instance of Spoofax/154. May be a duplicate of Spoofax/293.


On 9 December 2010 at 14:44 Lennart Kats tagged @maartje

On 31 January 2011 at 12:40 Lennart Kats tagged pre-new-terms

On 14 February 2011 at 14:44 Lennart Kats tagged 1.0

On 23 November 2011 at 16:25 Lennart Kats tagged 1.1

On 23 November 2011 at 18:00 Lennart Kats removed tag 1.0

On 8 January 2013 at 12:56 Eelco Visser removed tag 1.1

On 8 January 2013 at 12:56 Eelco Visser tagged interesting

On 10 March 2013 at 09:32 Guido Wachsmuth commented:

Fixed with Spoofax/154.


On 10 March 2013 at 09:32 Guido Wachsmuth closed this issue.

Log in to post comments