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
>
|