001 /* This file was generated with JastAdd2 (http://jastadd.org) version 2.1.13-12-g880e696 */ 002 package org.extendj.ast; 003 004 import java.util.HashSet; 005 import java.io.File; 006 import java.util.Set; 007 import java.util.Collections; 008 import java.util.Collection; 009 import java.util.ArrayList; 010 import beaver.*; 011 import java.util.*; 012 import java.io.ByteArrayOutputStream; 013 import java.io.PrintStream; 014 import java.lang.reflect.InvocationTargetException; 015 import java.lang.reflect.Method; 016 import org.jastadd.util.*; 017 import java.util.zip.*; 018 import java.io.*; 019 import org.jastadd.util.PrettyPrintable; 020 import org.jastadd.util.PrettyPrinter; 021 import java.io.FileNotFoundException; 022 import java.io.BufferedInputStream; 023 import java.io.DataInputStream; 024 /** 025 * @ast node 026 * @declaredat /home/jesper/git/extendj/java4/grammar/Java.ast:60 027 * @production DoubleType : {@link FloatingPointType}; 028 029 */ 030 public class DoubleType extends FloatingPointType implements Cloneable { 031 /** 032 * @aspect Java4PrettyPrint 033 * @declaredat /home/jesper/git/extendj/java4/frontend/PrettyPrint.jadd:437 034 */ 035 public void prettyPrint(PrettyPrinter out) { 036 out.print("double"); 037 } 038 /** 039 * @aspect Attributes 040 * @declaredat /home/jesper/git/extendj/java4/backend/Attributes.jrag:90 041 */ 042 public int addConstant(ConstantPool p, Constant c) { return p.addConstant(c.doubleValue()); } 043 /** 044 * @aspect CodeGeneration 045 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:172 046 */ 047 public void emitPushConstant(CodeGeneration gen, int value) { DoubleLiteral.push(gen, value); } 048 /** 049 * @aspect CodeGeneration 050 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:245 051 */ 052 public void emitReturn(CodeGeneration gen) { gen.emit(Bytecode.DRETURN);} 053 /** 054 * @aspect CodeGeneration 055 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:311 056 */ 057 public void emitLoadLocal(CodeGeneration gen, int pos) { 058 gen.maxLocals = Math.max(gen.maxLocals, pos+2); 059 if (pos == 0) { 060 gen.emit(Bytecode.DLOAD_0); 061 } else if (pos == 1) { 062 gen.emit(Bytecode.DLOAD_1); 063 } else if (pos == 2) { 064 gen.emit(Bytecode.DLOAD_2); 065 } else if (pos == 3) { 066 gen.emit(Bytecode.DLOAD_3); 067 } else if (pos < 256) { 068 gen.emit(Bytecode.DLOAD).add(pos); 069 } else { 070 gen.emit(Bytecode.WIDE).emit(Bytecode.DLOAD).add2(pos); 071 } 072 } 073 /** 074 * @aspect CodeGeneration 075 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:454 076 */ 077 public void emitStoreLocal(CodeGeneration gen, int pos) { 078 gen.maxLocals = Math.max(gen.maxLocals, pos+2); 079 if (pos == 0) { 080 gen.emit(Bytecode.DSTORE_0); 081 } else if (pos == 1) { 082 gen.emit(Bytecode.DSTORE_1); 083 } else if (pos == 2) { 084 gen.emit(Bytecode.DSTORE_2); 085 } else if (pos == 3) { 086 gen.emit(Bytecode.DSTORE_3); 087 } else if (pos < 256) { 088 gen.emit(Bytecode.DSTORE).add(pos); 089 } else { 090 gen.emit(Bytecode.WIDE).emit(Bytecode.DSTORE).add2(pos); 091 } 092 } 093 /** 094 * @aspect CodeGeneration 095 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:483 096 */ 097 public void emitDup(CodeGeneration gen) { gen.emit(Bytecode.DUP2); } 098 /** 099 * @aspect CodeGeneration 100 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:488 101 */ 102 public void emitDup_x1(CodeGeneration gen) { gen.emit(Bytecode.DUP2_X1); } 103 /** 104 * @aspect CodeGeneration 105 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:493 106 */ 107 public void emitDup_x2(CodeGeneration gen) { gen.emit(Bytecode.DUP2_X2); } 108 /** 109 * @aspect CodeGeneration 110 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:498 111 */ 112 public void emitPop(CodeGeneration gen) { gen.emit(Bytecode.POP2); } 113 /** 114 * @aspect CodeGenerationConversions 115 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:583 116 */ 117 void emitCastTo(CodeGeneration gen, TypeDecl type) { type.doubleToThis(gen); } 118 /** 119 * @aspect CodeGenerationConversions 120 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:595 121 */ 122 void intToThis(CodeGeneration gen) { gen.emit(Bytecode.I2D); } 123 /** 124 * @aspect CodeGenerationConversions 125 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:607 126 */ 127 void floatToThis(CodeGeneration gen) { gen.emit(Bytecode.F2D); } 128 /** 129 * @aspect CodeGenerationConversions 130 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:616 131 */ 132 void doubleToThis(CodeGeneration gen) { } 133 /** 134 * @aspect CodeGenerationConversions 135 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:625 136 */ 137 void longToThis(CodeGeneration gen) { gen.emit(Bytecode.L2D); } 138 /** 139 * @aspect CodeGenerationConversions 140 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:632 141 */ 142 void byteToThis(CodeGeneration gen) { gen.emit(Bytecode.I2D);} 143 /** 144 * @aspect CodeGenerationConversions 145 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:640 146 */ 147 void charToThis(CodeGeneration gen) { gen.emit(Bytecode.I2D);} 148 /** 149 * @aspect CodeGenerationConversions 150 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:648 151 */ 152 void shortToThis(CodeGeneration gen) { gen.emit(Bytecode.I2D); } 153 /** 154 * @aspect CodeGenerationBinaryOperations 155 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:679 156 */ 157 void neg(CodeGeneration gen) { gen.emit(Bytecode.DNEG); } 158 /** 159 * @aspect CodeGenerationBinaryOperations 160 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:691 161 */ 162 void add(CodeGeneration gen) {gen.emit(Bytecode.DADD);} 163 /** 164 * @aspect CodeGenerationBinaryOperations 165 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:697 166 */ 167 void sub(CodeGeneration gen) {gen.emit(Bytecode.DSUB);} 168 /** 169 * @aspect CodeGenerationBinaryOperations 170 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:703 171 */ 172 void mul(CodeGeneration gen) {gen.emit(Bytecode.DMUL);} 173 /** 174 * @aspect CodeGenerationBinaryOperations 175 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:709 176 */ 177 void div(CodeGeneration gen) {gen.emit(Bytecode.DDIV);} 178 /** 179 * @aspect CodeGenerationBinaryOperations 180 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:715 181 */ 182 void rem(CodeGeneration gen) {gen.emit(Bytecode.DREM);} 183 /** 184 * @aspect CodeGenerationBranch 185 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:748 186 */ 187 public void branchLT(CodeGeneration gen, int label) { gen.emit(Bytecode.DCMPG).emitCompare(Bytecode.IFLT, label); } 188 /** 189 * @aspect CodeGenerationBranch 190 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:754 191 */ 192 public void branchLTInv(CodeGeneration gen, int label) { gen.emit(Bytecode.DCMPL).emitCompare(Bytecode.IFLT, label); } 193 /** 194 * @aspect CodeGenerationBranch 195 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:758 196 */ 197 public void branchLE(CodeGeneration gen, int label) { gen.emit(Bytecode.DCMPG).emitCompare(Bytecode.IFLE, label); } 198 /** 199 * @aspect CodeGenerationBranch 200 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:764 201 */ 202 public void branchLEInv(CodeGeneration gen, int label) { gen.emit(Bytecode.DCMPL).emitCompare(Bytecode.IFLE, label); } 203 /** 204 * @aspect CodeGenerationBranch 205 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:768 206 */ 207 public void branchGE(CodeGeneration gen, int label) { gen.emit(Bytecode.DCMPL).emitCompare(Bytecode.IFGE, label); } 208 /** 209 * @aspect CodeGenerationBranch 210 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:774 211 */ 212 public void branchGEInv(CodeGeneration gen, int label) { gen.emit(Bytecode.DCMPG).emitCompare(Bytecode.IFGE, label); } 213 /** 214 * @aspect CodeGenerationBranch 215 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:778 216 */ 217 public void branchGT(CodeGeneration gen, int label) { gen.emit(Bytecode.DCMPL).emitCompare(Bytecode.IFGT, label); } 218 /** 219 * @aspect CodeGenerationBranch 220 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:784 221 */ 222 public void branchGTInv(CodeGeneration gen, int label) { gen.emit(Bytecode.DCMPG).emitCompare(Bytecode.IFGT, label); } 223 /** 224 * @aspect CodeGenerationBranch 225 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:788 226 */ 227 public void branchEQ(CodeGeneration gen, int label) { gen.emit(Bytecode.DCMPL).emitCompare(Bytecode.IFEQ, label); } 228 /** 229 * @aspect CodeGenerationBranch 230 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:797 231 */ 232 public void branchNE(CodeGeneration gen, int label) { gen.emit(Bytecode.DCMPL).emitCompare(Bytecode.IFNE, label); } 233 /** 234 * @aspect AnnotationsCodegen 235 * @declaredat /home/jesper/git/extendj/java5/backend/AnnotationsCodegen.jrag:226 236 */ 237 public int addAnnotConstant(ConstantPool p, Constant c) { 238 return addConstant(p, c); 239 } 240 /** 241 * @declaredat ASTNode:1 242 */ 243 public DoubleType() { 244 super(); 245 } 246 /** 247 * Initializes the child array to the correct size. 248 * Initializes List and Opt nta children. 249 * @apilevel internal 250 * @ast method 251 * @declaredat ASTNode:10 252 */ 253 public void init$Children() { 254 children = new ASTNode[3]; 255 setChild(new Opt(), 1); 256 setChild(new List(), 2); 257 } 258 /** 259 * @declaredat ASTNode:15 260 */ 261 public DoubleType(Modifiers p0, String p1, Opt<Access> p2, List<BodyDecl> p3) { 262 setChild(p0, 0); 263 setID(p1); 264 setChild(p2, 1); 265 setChild(p3, 2); 266 } 267 /** 268 * @declaredat ASTNode:21 269 */ 270 public DoubleType(Modifiers p0, beaver.Symbol p1, Opt<Access> p2, List<BodyDecl> p3) { 271 setChild(p0, 0); 272 setID(p1); 273 setChild(p2, 1); 274 setChild(p3, 2); 275 } 276 /** 277 * @apilevel low-level 278 * @declaredat ASTNode:30 279 */ 280 protected int numChildren() { 281 return 3; 282 } 283 /** 284 * @apilevel internal 285 * @declaredat ASTNode:36 286 */ 287 public boolean mayHaveRewrite() { 288 return false; 289 } 290 /** 291 * @apilevel internal 292 * @declaredat ASTNode:42 293 */ 294 public void flushAttrCache() { 295 super.flushAttrCache(); 296 typeDescriptor_reset(); 297 jvmName_reset(); 298 boxed_reset(); 299 } 300 /** 301 * @apilevel internal 302 * @declaredat ASTNode:51 303 */ 304 public void flushCollectionCache() { 305 super.flushCollectionCache(); 306 } 307 /** 308 * @apilevel internal 309 * @declaredat ASTNode:57 310 */ 311 public void flushRewriteCache() { 312 super.flushRewriteCache(); 313 } 314 /** 315 * @apilevel internal 316 * @declaredat ASTNode:63 317 */ 318 public DoubleType clone() throws CloneNotSupportedException { 319 DoubleType node = (DoubleType) super.clone(); 320 return node; 321 } 322 /** 323 * @apilevel internal 324 * @declaredat ASTNode:70 325 */ 326 public DoubleType copy() { 327 try { 328 DoubleType node = (DoubleType) clone(); 329 node.parent = null; 330 if (children != null) { 331 node.children = (ASTNode[]) children.clone(); 332 } 333 return node; 334 } catch (CloneNotSupportedException e) { 335 throw new Error("Error: clone not supported for " + getClass().getName()); 336 } 337 } 338 /** 339 * Create a deep copy of the AST subtree at this node. 340 * The copy is dangling, i.e. has no parent. 341 * @return dangling copy of the subtree at this node 342 * @apilevel low-level 343 * @deprecated Please use treeCopy or treeCopyNoTransform instead 344 * @declaredat ASTNode:89 345 */ 346 @Deprecated 347 public DoubleType fullCopy() { 348 return treeCopyNoTransform(); 349 } 350 /** 351 * Create a deep copy of the AST subtree at this node. 352 * The copy is dangling, i.e. has no parent. 353 * @return dangling copy of the subtree at this node 354 * @apilevel low-level 355 * @declaredat ASTNode:99 356 */ 357 public DoubleType treeCopyNoTransform() { 358 DoubleType tree = (DoubleType) copy(); 359 if (children != null) { 360 for (int i = 0; i < children.length; ++i) { 361 ASTNode child = (ASTNode) children[i]; 362 if (child != null) { 363 child = child.treeCopyNoTransform(); 364 tree.setChild(child, i); 365 } 366 } 367 } 368 return tree; 369 } 370 /** 371 * Create a deep copy of the AST subtree at this node. 372 * The subtree of this node is traversed to trigger rewrites before copy. 373 * The copy is dangling, i.e. has no parent. 374 * @return dangling copy of the subtree at this node 375 * @apilevel low-level 376 * @declaredat ASTNode:119 377 */ 378 public DoubleType treeCopy() { 379 doFullTraversal(); 380 return treeCopyNoTransform(); 381 } 382 /** 383 * @apilevel internal 384 * @declaredat ASTNode:126 385 */ 386 protected boolean is$Equal(ASTNode node) { 387 return super.is$Equal(node) && (tokenString_ID == ((DoubleType)node).tokenString_ID); 388 } 389 /** 390 * Replaces the Modifiers child. 391 * @param node The new node to replace the Modifiers child. 392 * @apilevel high-level 393 */ 394 public void setModifiers(Modifiers node) { 395 setChild(node, 0); 396 } 397 /** 398 * Retrieves the Modifiers child. 399 * @return The current node used as the Modifiers child. 400 * @apilevel high-level 401 */ 402 @ASTNodeAnnotation.Child(name="Modifiers") 403 public Modifiers getModifiers() { 404 return (Modifiers) getChild(0); 405 } 406 /** 407 * Retrieves the Modifiers child. 408 * <p><em>This method does not invoke AST transformations.</em></p> 409 * @return The current node used as the Modifiers child. 410 * @apilevel low-level 411 */ 412 public Modifiers getModifiersNoTransform() { 413 return (Modifiers) getChildNoTransform(0); 414 } 415 /** 416 * Replaces the lexeme ID. 417 * @param value The new value for the lexeme ID. 418 * @apilevel high-level 419 */ 420 public void setID(String value) { 421 tokenString_ID = value; 422 } 423 /** 424 * JastAdd-internal setter for lexeme ID using the Beaver parser. 425 * @param symbol Symbol containing the new value for the lexeme ID 426 * @apilevel internal 427 */ 428 public void setID(beaver.Symbol symbol) { 429 if (symbol.value != null && !(symbol.value instanceof String)) 430 throw new UnsupportedOperationException("setID is only valid for String lexemes"); 431 tokenString_ID = (String)symbol.value; 432 IDstart = symbol.getStart(); 433 IDend = symbol.getEnd(); 434 } 435 /** 436 * Retrieves the value for the lexeme ID. 437 * @return The value for the lexeme ID. 438 * @apilevel high-level 439 */ 440 @ASTNodeAnnotation.Token(name="ID") 441 public String getID() { 442 return tokenString_ID != null ? tokenString_ID : ""; 443 } 444 /** 445 * Replaces the optional node for the SuperClass child. This is the <code>Opt</code> 446 * node containing the child SuperClass, not the actual child! 447 * @param opt The new node to be used as the optional node for the SuperClass child. 448 * @apilevel low-level 449 */ 450 public void setSuperClassOpt(Opt<Access> opt) { 451 setChild(opt, 1); 452 } 453 /** 454 * Replaces the (optional) SuperClass child. 455 * @param node The new node to be used as the SuperClass child. 456 * @apilevel high-level 457 */ 458 public void setSuperClass(Access node) { 459 getSuperClassOpt().setChild(node, 0); 460 } 461 /** 462 * Check whether the optional SuperClass child exists. 463 * @return {@code true} if the optional SuperClass child exists, {@code false} if it does not. 464 * @apilevel high-level 465 */ 466 public boolean hasSuperClass() { 467 return getSuperClassOpt().getNumChild() != 0; 468 } 469 /** 470 * Retrieves the (optional) SuperClass child. 471 * @return The SuperClass child, if it exists. Returns {@code null} otherwise. 472 * @apilevel low-level 473 */ 474 public Access getSuperClass() { 475 return (Access) getSuperClassOpt().getChild(0); 476 } 477 /** 478 * Retrieves the optional node for the SuperClass child. This is the <code>Opt</code> node containing the child SuperClass, not the actual child! 479 * @return The optional node for child the SuperClass child. 480 * @apilevel low-level 481 */ 482 @ASTNodeAnnotation.OptChild(name="SuperClass") 483 public Opt<Access> getSuperClassOpt() { 484 return (Opt<Access>) getChild(1); 485 } 486 /** 487 * Retrieves the optional node for child SuperClass. This is the <code>Opt</code> node containing the child SuperClass, not the actual child! 488 * <p><em>This method does not invoke AST transformations.</em></p> 489 * @return The optional node for child SuperClass. 490 * @apilevel low-level 491 */ 492 public Opt<Access> getSuperClassOptNoTransform() { 493 return (Opt<Access>) getChildNoTransform(1); 494 } 495 /** 496 * Replaces the BodyDecl list. 497 * @param list The new list node to be used as the BodyDecl list. 498 * @apilevel high-level 499 */ 500 public void setBodyDeclList(List<BodyDecl> list) { 501 setChild(list, 2); 502 } 503 /** 504 * Retrieves the number of children in the BodyDecl list. 505 * @return Number of children in the BodyDecl list. 506 * @apilevel high-level 507 */ 508 public int getNumBodyDecl() { 509 return getBodyDeclList().getNumChild(); 510 } 511 /** 512 * Retrieves the number of children in the BodyDecl list. 513 * Calling this method will not trigger rewrites. 514 * @return Number of children in the BodyDecl list. 515 * @apilevel low-level 516 */ 517 public int getNumBodyDeclNoTransform() { 518 return getBodyDeclListNoTransform().getNumChildNoTransform(); 519 } 520 /** 521 * Retrieves the element at index {@code i} in the BodyDecl list. 522 * @param i Index of the element to return. 523 * @return The element at position {@code i} in the BodyDecl list. 524 * @apilevel high-level 525 */ 526 public BodyDecl getBodyDecl(int i) { 527 return (BodyDecl) getBodyDeclList().getChild(i); 528 } 529 /** 530 * Check whether the BodyDecl list has any children. 531 * @return {@code true} if it has at least one child, {@code false} otherwise. 532 * @apilevel high-level 533 */ 534 public boolean hasBodyDecl() { 535 return getBodyDeclList().getNumChild() != 0; 536 } 537 /** 538 * Append an element to the BodyDecl list. 539 * @param node The element to append to the BodyDecl list. 540 * @apilevel high-level 541 */ 542 public void addBodyDecl(BodyDecl node) { 543 List<BodyDecl> list = (parent == null) ? getBodyDeclListNoTransform() : getBodyDeclList(); 544 list.addChild(node); 545 } 546 /** 547 * @apilevel low-level 548 */ 549 public void addBodyDeclNoTransform(BodyDecl node) { 550 List<BodyDecl> list = getBodyDeclListNoTransform(); 551 list.addChild(node); 552 } 553 /** 554 * Replaces the BodyDecl list element at index {@code i} with the new node {@code node}. 555 * @param node The new node to replace the old list element. 556 * @param i The list index of the node to be replaced. 557 * @apilevel high-level 558 */ 559 public void setBodyDecl(BodyDecl node, int i) { 560 List<BodyDecl> list = getBodyDeclList(); 561 list.setChild(node, i); 562 } 563 /** 564 * Retrieves the BodyDecl list. 565 * @return The node representing the BodyDecl list. 566 * @apilevel high-level 567 */ 568 @ASTNodeAnnotation.ListChild(name="BodyDecl") 569 public List<BodyDecl> getBodyDeclList() { 570 List<BodyDecl> list = (List<BodyDecl>) getChild(2); 571 return list; 572 } 573 /** 574 * Retrieves the BodyDecl list. 575 * <p><em>This method does not invoke AST transformations.</em></p> 576 * @return The node representing the BodyDecl list. 577 * @apilevel low-level 578 */ 579 public List<BodyDecl> getBodyDeclListNoTransform() { 580 return (List<BodyDecl>) getChildNoTransform(2); 581 } 582 /** 583 * Retrieves the BodyDecl list. 584 * @return The node representing the BodyDecl list. 585 * @apilevel high-level 586 */ 587 public List<BodyDecl> getBodyDecls() { 588 return getBodyDeclList(); 589 } 590 /** 591 * Retrieves the BodyDecl list. 592 * <p><em>This method does not invoke AST transformations.</em></p> 593 * @return The node representing the BodyDecl list. 594 * @apilevel low-level 595 */ 596 public List<BodyDecl> getBodyDeclsNoTransform() { 597 return getBodyDeclListNoTransform(); 598 } 599 /** 600 * @attribute syn 601 * @aspect ConstantExpression 602 * @declaredat /home/jesper/git/extendj/java4/frontend/ConstantExpression.jrag:72 603 */ 604 @ASTNodeAnnotation.Attribute 605 public Constant cast(Constant c) { 606 Constant cast_Constant_value = Constant.create(c.doubleValue()); 607 608 return cast_Constant_value; 609 } 610 /** 611 * @attribute syn 612 * @aspect ConstantExpression 613 * @declaredat /home/jesper/git/extendj/java4/frontend/ConstantExpression.jrag:86 614 */ 615 @ASTNodeAnnotation.Attribute 616 public Constant plus(Constant c) { 617 Constant plus_Constant_value = c; 618 619 return plus_Constant_value; 620 } 621 /** 622 * @attribute syn 623 * @aspect ConstantExpression 624 * @declaredat /home/jesper/git/extendj/java4/frontend/ConstantExpression.jrag:95 625 */ 626 @ASTNodeAnnotation.Attribute 627 public Constant minus(Constant c) { 628 Constant minus_Constant_value = Constant.create(-c.doubleValue()); 629 630 return minus_Constant_value; 631 } 632 /** 633 * @attribute syn 634 * @aspect ConstantExpression 635 * @declaredat /home/jesper/git/extendj/java4/frontend/ConstantExpression.jrag:111 636 */ 637 @ASTNodeAnnotation.Attribute 638 public Constant mul(Constant c1, Constant c2) { 639 Constant mul_Constant_Constant_value = Constant.create(c1.doubleValue() * c2.doubleValue()); 640 641 return mul_Constant_Constant_value; 642 } 643 /** 644 * @attribute syn 645 * @aspect ConstantExpression 646 * @declaredat /home/jesper/git/extendj/java4/frontend/ConstantExpression.jrag:120 647 */ 648 @ASTNodeAnnotation.Attribute 649 public Constant div(Constant c1, Constant c2) { 650 Constant div_Constant_Constant_value = Constant.create(c1.doubleValue() / c2.doubleValue()); 651 652 return div_Constant_Constant_value; 653 } 654 /** 655 * @attribute syn 656 * @aspect ConstantExpression 657 * @declaredat /home/jesper/git/extendj/java4/frontend/ConstantExpression.jrag:129 658 */ 659 @ASTNodeAnnotation.Attribute 660 public Constant mod(Constant c1, Constant c2) { 661 Constant mod_Constant_Constant_value = Constant.create(c1.doubleValue() % c2.doubleValue()); 662 663 return mod_Constant_Constant_value; 664 } 665 /** 666 * @attribute syn 667 * @aspect ConstantExpression 668 * @declaredat /home/jesper/git/extendj/java4/frontend/ConstantExpression.jrag:138 669 */ 670 @ASTNodeAnnotation.Attribute 671 public Constant add(Constant c1, Constant c2) { 672 Constant add_Constant_Constant_value = Constant.create(c1.doubleValue() + c2.doubleValue()); 673 674 return add_Constant_Constant_value; 675 } 676 /** 677 * @attribute syn 678 * @aspect ConstantExpression 679 * @declaredat /home/jesper/git/extendj/java4/frontend/ConstantExpression.jrag:148 680 */ 681 @ASTNodeAnnotation.Attribute 682 public Constant sub(Constant c1, Constant c2) { 683 Constant sub_Constant_Constant_value = Constant.create(c1.doubleValue() - c2.doubleValue()); 684 685 return sub_Constant_Constant_value; 686 } 687 /** 688 * @attribute syn 689 * @aspect ConstantExpression 690 * @declaredat /home/jesper/git/extendj/java4/frontend/ConstantExpression.jrag:202 691 */ 692 @ASTNodeAnnotation.Attribute 693 public Constant questionColon(Constant cond, Constant c1, Constant c2) { 694 Constant questionColon_Constant_Constant_Constant_value = Constant.create(cond.booleanValue() ? c1.doubleValue() : c2.doubleValue()); 695 696 return questionColon_Constant_Constant_Constant_value; 697 } 698 /** 699 * @attribute syn 700 * @aspect ConstantExpression 701 * @declaredat /home/jesper/git/extendj/java4/frontend/ConstantExpression.jrag:326 702 */ 703 @ASTNodeAnnotation.Attribute 704 public boolean eqIsTrue(Expr left, Expr right) { 705 boolean eqIsTrue_Expr_Expr_value = left.constant().doubleValue() == right.constant().doubleValue(); 706 707 return eqIsTrue_Expr_Expr_value; 708 } 709 /** 710 * @attribute syn 711 * @aspect ConstantExpression 712 * @declaredat /home/jesper/git/extendj/java4/frontend/ConstantExpression.jrag:337 713 */ 714 @ASTNodeAnnotation.Attribute 715 public boolean ltIsTrue(Expr left, Expr right) { 716 boolean ltIsTrue_Expr_Expr_value = left.constant().doubleValue() < right.constant().doubleValue(); 717 718 return ltIsTrue_Expr_Expr_value; 719 } 720 /** 721 * @attribute syn 722 * @aspect ConstantExpression 723 * @declaredat /home/jesper/git/extendj/java4/frontend/ConstantExpression.jrag:343 724 */ 725 @ASTNodeAnnotation.Attribute 726 public boolean leIsTrue(Expr left, Expr right) { 727 boolean leIsTrue_Expr_Expr_value = left.constant().doubleValue() <= right.constant().doubleValue(); 728 729 return leIsTrue_Expr_Expr_value; 730 } 731 /** 732 * @attribute syn 733 * @aspect TypeAnalysis 734 * @declaredat /home/jesper/git/extendj/java4/frontend/TypeAnalysis.jrag:221 735 */ 736 @ASTNodeAnnotation.Attribute 737 public boolean isDouble() { 738 boolean isDouble_value = true; 739 740 return isDouble_value; 741 } 742 /** 743 * @attribute syn 744 * @aspect CodeGeneration 745 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:249 746 */ 747 @ASTNodeAnnotation.Attribute 748 public byte arrayLoad() { 749 byte arrayLoad_value = Bytecode.DALOAD; 750 751 return arrayLoad_value; 752 } 753 /** 754 * @attribute syn 755 * @aspect CodeGeneration 756 * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:380 757 */ 758 @ASTNodeAnnotation.Attribute 759 public byte arrayStore() { 760 byte arrayStore_value = Bytecode.DASTORE; 761 762 return arrayStore_value; 763 } 764 /** 765 * @apilevel internal 766 */ 767 protected boolean typeDescriptor_computed = false; 768 /** 769 * @apilevel internal 770 */ 771 protected String typeDescriptor_value; 772 /** 773 * @apilevel internal 774 */ 775 private void typeDescriptor_reset() { 776 typeDescriptor_computed = false; 777 typeDescriptor_value = null; 778 } 779 /** 780 * @attribute syn 781 * @aspect ConstantPoolNames 782 * @declaredat /home/jesper/git/extendj/java4/backend/ConstantPoolNames.jrag:77 783 */ 784 @ASTNodeAnnotation.Attribute 785 public String typeDescriptor() { 786 ASTNode$State state = state(); 787 if (typeDescriptor_computed) { 788 return typeDescriptor_value; 789 } 790 boolean intermediate = state.INTERMEDIATE_VALUE; 791 state.INTERMEDIATE_VALUE = false; 792 int num = state.boundariesCrossed; 793 boolean isFinal = this.is$Final(); 794 typeDescriptor_value = "D"; 795 if (isFinal && num == state().boundariesCrossed) { 796 typeDescriptor_computed = true; 797 } else { 798 } 799 state.INTERMEDIATE_VALUE |= intermediate; 800 801 return typeDescriptor_value; 802 } 803 /** 804 * @attribute syn 805 * @aspect CreateBCode 806 * @declaredat /home/jesper/git/extendj/java4/backend/CreateBCode.jrag:905 807 */ 808 @ASTNodeAnnotation.Attribute 809 public int arrayPrimitiveTypeDescriptor() { 810 int arrayPrimitiveTypeDescriptor_value = 7; 811 812 return arrayPrimitiveTypeDescriptor_value; 813 } 814 /** 815 * @apilevel internal 816 */ 817 protected boolean jvmName_computed = false; 818 /** 819 * @apilevel internal 820 */ 821 protected String jvmName_value; 822 /** 823 * @apilevel internal 824 */ 825 private void jvmName_reset() { 826 jvmName_computed = false; 827 jvmName_value = null; 828 } 829 /** 830 * @attribute syn 831 * @aspect Java2Rewrites 832 * @declaredat /home/jesper/git/extendj/java4/backend/Java2Rewrites.jrag:36 833 */ 834 @ASTNodeAnnotation.Attribute 835 public String jvmName() { 836 ASTNode$State state = state(); 837 if (jvmName_computed) { 838 return jvmName_value; 839 } 840 boolean intermediate = state.INTERMEDIATE_VALUE; 841 state.INTERMEDIATE_VALUE = false; 842 int num = state.boundariesCrossed; 843 boolean isFinal = this.is$Final(); 844 jvmName_value = "D"; 845 if (isFinal && num == state().boundariesCrossed) { 846 jvmName_computed = true; 847 } else { 848 } 849 state.INTERMEDIATE_VALUE |= intermediate; 850 851 return jvmName_value; 852 } 853 /** 854 * @attribute syn 855 * @aspect Java2Rewrites 856 * @declaredat /home/jesper/git/extendj/java4/backend/Java2Rewrites.jrag:68 857 */ 858 @ASTNodeAnnotation.Attribute 859 public String primitiveClassName() { 860 String primitiveClassName_value = "Double"; 861 862 return primitiveClassName_value; 863 } 864 /** 865 * @attribute syn 866 * @aspect LocalNum 867 * @declaredat /home/jesper/git/extendj/java4/backend/LocalNum.jrag:199 868 */ 869 @ASTNodeAnnotation.Attribute 870 public int variableSize() { 871 int variableSize_value = 2; 872 873 return variableSize_value; 874 } 875 /** 876 * @apilevel internal 877 */ 878 protected boolean boxed_computed = false; 879 /** 880 * @apilevel internal 881 */ 882 protected TypeDecl boxed_value; 883 /** 884 * @apilevel internal 885 */ 886 private void boxed_reset() { 887 boxed_computed = false; 888 boxed_value = null; 889 } 890 /** 891 * @attribute syn 892 * @aspect AutoBoxing 893 * @declaredat /home/jesper/git/extendj/java5/frontend/AutoBoxing.jrag:56 894 */ 895 @ASTNodeAnnotation.Attribute 896 public TypeDecl boxed() { 897 ASTNode$State state = state(); 898 if (boxed_computed) { 899 return boxed_value; 900 } 901 boolean intermediate = state.INTERMEDIATE_VALUE; 902 state.INTERMEDIATE_VALUE = false; 903 int num = state.boundariesCrossed; 904 boolean isFinal = this.is$Final(); 905 boxed_value = lookupType("java.lang", "Double"); 906 if (isFinal && num == state().boundariesCrossed) { 907 boxed_computed = true; 908 } else { 909 } 910 state.INTERMEDIATE_VALUE |= intermediate; 911 912 return boxed_value; 913 } 914 /** 915 * @apilevel internal 916 */ 917 public ASTNode rewriteTo() { 918 return super.rewriteTo(); 919 } 920 }