Re: [classad-users] A question regarding how to use classad with the Java implementation.


Date: Thu, 29 Nov 2007 13:51:19 -0600
From: Marvin Solomon <solomon@xxxxxxxxxxx>
Subject: Re: [classad-users] A question regarding how to use classad with the Java implementation.
There is no keyword "root".  The only attributes with special meaning,
according to the reference manual, are
    error false is isnt parent true undefined
In your example "root" is considered an undefined attribute, hence "root.value"
is also undefined and so is "v".  If you simply remove the "root." from your
example, you may get results closer to what you expect.



Gabriele Pierantoni wrote:
> Dear Sir/Madame,
>
> 	I'm trying to learn the ClassAd java library (Version 2.2)
> for my research and I am having problems in understanding the use of
> indented classads.
>
> I have a problem with indented classads.
>
> I have a test classad.
>
> --------------------------------------------
> String	p1 = new String(
> 		"[" +
> 		"value = 10;" +
> 		"inner = " +
> 			"[" +
> 			"v = root.value;" +
> 			"];" +
> 		"];");
> --------------------------------------------
>
>
> I create a RecordExpr with this String:
>
> -----------------------------------------------------------
> ClassAdParser	parser	=	new ClassAdParser(p1);
> RecordExpr	expr1	=	(RecordExpr) parser.parse();
> -----------------------------------------------------------
>
> And I try to evaluate the various expressions:
>
> 		
> System.out.println("- expr1 : " + expr1.eval());
> System.out.println("- expr1.value : " + expr1.lookup("value").eval());
> System.out.println("- expr1.inner : " + expr1.lookup("inner").eval());
> System.out.println("- expr1.inner.v : "
> +((RecordExpr)expr1.lookup("inner")).lookup("v").eval());
>
>
> The problem is that the value of v in the inner classad is undefined
> and I cannot understand why. Probably the lookup function is restricting
> the scope.
>
> -----------------------------------------
> - expr1 : [value=10;inner=[v=root.value]]
> - expr1.value : 10
> - expr1.inner : [v=root.value]
> - expr1.inner.v : UNDEFINED
> -----------------------------------------
>
> I was wondering if you could give me pointer to any documentation
> (expecially regarding the Java implementation) besides the papers
> listed in the ClassAd website or put me in contact with anybody
> able to help me.
>
> I am very grateful for any help you could provide.
>
> 	All the very best,
>
> 			Gabriele Pierantoni
>
[← Prev in Thread] Current Thread [Next in Thread→]