diff --git a/CompilerGeneration.jrag b/CompilerGeneration.jrag index 962191ff2b71f0d24e11ff8bd24fb215b3b48607..e486e29a08cf43841f9c0abff30fe8a92bc21936 100644 --- a/CompilerGeneration.jrag +++ b/CompilerGeneration.jrag @@ -421,6 +421,16 @@ aspect GenMisc { pStream.println(ind(1)+"public String Attribute.name() {"); pStream.println(ind(2)+"return getValue().getSTRING_LITERAL();"); pStream.println(ind(1)+"}"); + pStream.println(ind(1)+"public String Attribute.value() {"); + pStream.println(ind(2)+"String s = getValue().getSTRING_LITERAL();"); + pStream.println(ind(2)+"int hash = s.indexOf('#');"); + pStream.println(ind(2)+"int firstCit = s.indexOf('\"');"); + pStream.println(ind(2)+"int lastCit = s.lastIndexOf('\"');"); + pStream.println(ind(2)+"hash = hash < 0 ? 0 : hash;"); + pStream.println(ind(2)+"firstCit = firstCit < 0 ? 0 : firstCit;"); + pStream.println(ind(2)+"lastCit = lastCit > firstCit ? lastCit : s.length()-1;"); + pStream.println(ind(2)+"return s.substring(Math.max(hash,firstCit)+1,lastCit);"); + pStream.println(ind(1)+"}"); // ClassUse.decl() // pStream.println(ind(1)+"syn lazy Thing ClassUse.decl() {");