Changeset 1191
- Timestamp:
- 06/20/08 21:04:06 (7 months ago)
- Files:
-
- trunk/descent.core/src/descent/core/Signature.java (modified) (10 diffs)
- trunk/descent.core/src/descent/core/dom/CompilationUnitResolver.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/Objects.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/Statement.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/TypeSArray.java (modified) (2 diffs)
- trunk/descent.core/src/descent/internal/compiler/parser/TypeSlice.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/core/SignatureProcessor.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/core/util/Util.java (modified) (1 diff)
- trunk/descent.debug.core/src/descent/internal/debug/core/model/gdb/Running.java (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/descent.core/src/descent/core/Signature.java
r1189 r1191 83 83 * 84 84 * StaticArrayTypeSignature ::= 85 * "G" TypeSignature " G" Number "G" Chars // Number == Chars.length85 * "G" TypeSignature "&" Number "G" Chars // Number == Chars.length 86 86 * 87 87 * AssociativeArrayTypeSignature ::= … … 95 95 * 96 96 * SliceTypeSignature ::= 97 * " " TypeSignature ""98 * Number " " Chars // Number == Chars.length --> lower99 * Number " " Chars // Number == Chars.length --> upper97 * "." TypeSignature "~" 98 * Number "." Chars // Number == Chars.length --> lower 99 * Number "." Chars // Number == Chars.length --> upper 100 100 * 101 101 * FunctionTypeSignature ::= … … 129 129 * ( "C" // class 130 130 * | "S" // struct 131 * | " &" // union132 * | " |" // interface131 * | "U" // union 132 * | "I" // interface 133 133 * | "E" // enum 134 * | " ~" // enum member135 * | " " // variable134 * | "M" // enum member 135 * | "B" // variable 136 136 * | "=" // alias 137 137 * | "T" // typedef … … 379 379 380 380 /** 381 * Character constant indicating a static array type after it's type in a signature. 382 * Value is <code>'&'</code>. 383 */ 384 public static final char C_STATIC_ARRAY2 = '&'; 385 386 /** 381 387 * Character constant indicating an associative array type in a signature. 382 388 * Value is <code>'H'</code>. … … 388 394 * Value is <code>'>'</code>. 389 395 */ 390 public static final char C_TYPEOF = ' >';396 public static final char C_TYPEOF = 'O'; 391 397 392 398 /** … … 398 404 /** 399 405 * Character constant indicating a slice type in a signature. 400 * Value is <code>''</code>. 401 */ 402 public static final char C_SLICE = '¬'; 406 * Value is <code>'.'</code>. 407 */ 408 public static final char C_SLICE = '.'; 409 410 /** 411 * Character constant indicating a slice type after it's type in a signature. 412 * Value is <code>'~'</code>. 413 */ 414 public static final char C_SLICE2 = '~'; 403 415 404 416 /** … … 478 490 * Value is <code>'&'</code>. 479 491 */ 480 public static final char C_UNION = ' &';492 public static final char C_UNION = 'N'; 481 493 482 494 /** … … 484 496 * Value is <code>'|'</code>. 485 497 */ 486 public static final char C_INTERFACE = ' |';498 public static final char C_INTERFACE = 'I'; 487 499 488 500 /** … … 496 508 * Value is <code>'~'</code>. 497 509 */ 498 public static final char C_ENUM_MEMBER = ' ~';510 public static final char C_ENUM_MEMBER = 'M'; 499 511 500 512 /** 501 513 * Character constant indicating a variable in a signature. 502 * Value is <code>' '</code>.503 */ 504 public static final char C_VARIABLE = ' ¡';514 * Value is <code>'B'</code>. 515 */ 516 public static final char C_VARIABLE = 'B'; 505 517 506 518 /** … … 618 630 * Value is <code>'\\'</code>. 619 631 */ 620 public static final char C_TEMPLATE_VALUE_PARAMETER_SPECIFIC_VALUE = '\\';632 public static final char C_TEMPLATE_VALUE_PARAMETER_SPECIFIC_VALUE = '\\'; 621 633 622 634 /** trunk/descent.core/src/descent/core/dom/CompilationUnitResolver.java
r1165 r1191 359 359 module.semantic(context); 360 360 } catch (Throwable t) { 361 t.printStackTrace();362 361 Util.log(t); 363 362 } trunk/descent.core/src/descent/internal/compiler/parser/Objects.java
r1160 r1191 11 11 public Objects(int capacity) { 12 12 super(capacity); 13 setDim(capacity); 13 14 } 14 15 trunk/descent.core/src/descent/internal/compiler/parser/Statement.java
r1188 r1191 13 13 14 14 public int blockExit(SemanticContext context) { 15 throw new IllegalStateException("assert(0)"); 15 // TODO Semantic 16 // throw new IllegalStateException("assert(0)"); 17 return 0; 16 18 } 17 19 trunk/descent.core/src/descent/internal/compiler/parser/TypeSArray.java
r1165 r1191 2 2 3 3 import melnorme.miscutil.tree.TreeVisitor; 4 import descent.core.Signature; 4 5 import descent.core.compiler.IProblem; 5 6 import descent.internal.compiler.parser.ast.IASTVisitor; … … 491 492 @Override 492 493 protected void appendSignature0(StringBuilder sb) { 493 sb.append( 'G');494 sb.append(Signature.C_STATIC_ARRAY); 494 495 next.appendSignature(sb); 495 sb.append( 'G');496 sb.append(Signature.C_STATIC_ARRAY2); 496 497 497 498 char[] expc = encoder.encodeExpression(dim); 498 499 sb.append(expc.length); 499 sb.append( 'G');500 sb.append(Signature.C_STATIC_ARRAY); 500 501 sb.append(expc); 501 502 } trunk/descent.core/src/descent/internal/compiler/parser/TypeSlice.java
r1189 r1191 194 194 sb.append(Signature.C_SLICE); 195 195 next.appendSignature(sb); 196 sb.append(Signature.C_SLICE );196 sb.append(Signature.C_SLICE2); 197 197 198 198 char[] expc = encoder.encodeExpression(lwr); trunk/descent.core/src/descent/internal/core/SignatureProcessor.java
r1189 r1191 393 393 requestor.acceptPosition(localPosition); 394 394 continue; 395 case Signature.C_STATIC_ARRAY2: 396 case Signature.C_SLICE2: 397 return i; 395 398 default: 396 399 // Try with type basic trunk/descent.core/src/descent/internal/core/util/Util.java
r1093 r1191 1269 1269 1270 1270 public static void log(Throwable e) { 1271 log(e, "");1271 log(e, e.getMessage() == null ? e.getClass().getName() : e.getClass().getName() + ": " + e.getMessage()); 1272 1272 } 1273 1273 trunk/descent.debug.core/src/descent/internal/debug/core/model/gdb/Running.java
r716 r1191 12 12 private String fBreakpointFileName; 13 13 private int fBreakpointLineNumber; 14 private boolean fNextHasBreakpointInfo; 14 15 15 16 public Running(GdbDebugger cli) { … … 18 19 19 20 public void interpret(String text) throws DebugException, IOException { 21 if (fNextHasBreakpointInfo) { 22 fNextHasBreakpointInfo = false; 23 24 // at file:lineNumber address 25 int indexOfColon = text.lastIndexOf(':'); 26 if (indexOfColon != -1) { 27 if (!processBreakpointInfo(text, indexOfColon)) { 28 return; 29 } 30 } 31 } 32 20 33 if (fLastWasBreakpointHit) { 21 34 if (text.trim().equals("(gdb)")) { … … 31 44 } else if (text.startsWith("Breakpoint ")) { //$NON-NLS-1$ 32 45 // Breakpoint n hit at file:lineNumber address 33 34 46 int indexOfColon = text.lastIndexOf(':'); 35 47 if (indexOfColon != -1) { 36 int indexOfSpaceBefore = text.lastIndexOf(' ', indexOfColon - 1); 37 int indexOfSpaceAfter = text.indexOf(' ', indexOfColon + 1); 38 if (indexOfSpaceAfter == -1) { 39 indexOfSpaceAfter = text.length(); 48 if (!processBreakpointInfo(text, indexOfColon)) { 49 return; 40 50 } 41 if (indexOfSpaceBefore != -1 && indexOfSpaceAfter != -1) { 42 fBreakpointFileName = text.substring(indexOfSpaceBefore + 1, indexOfColon); 43 try { 44 fBreakpointLineNumber = Integer.parseInt(text.substring(indexOfColon + 1, indexOfSpaceAfter)); 45 } catch (NumberFormatException e) { 46 return; 47 } 48 fLastWasBreakpointHit = true; 49 } 51 } else { 52 // The information might be in the next line 53 fNextHasBreakpointInfo = true; 50 54 } 51 55 } 56 } 57 58 private boolean processBreakpointInfo(String text, int indexOfColon) { 59 // * at file:lineNumber address 60 int indexOfSpaceBefore = text.lastIndexOf(' ', indexOfColon - 1); 61 int indexOfSpaceAfter = text.indexOf(' ', indexOfColon + 1); 62 if (indexOfSpaceAfter == -1) { 63 indexOfSpaceAfter = text.length(); 64 } 65 if (indexOfSpaceBefore != -1 && indexOfSpaceAfter != -1) { 66 fBreakpointFileName = text.substring(indexOfSpaceBefore + 1, indexOfColon); 67 try { 68 fBreakpointLineNumber = Integer.parseInt(text.substring(indexOfColon + 1, indexOfSpaceAfter)); 69 } catch (NumberFormatException e) { 70 return false; 71 } 72 fLastWasBreakpointHit = true; 73 } 74 75 return true; 52 76 } 53 77
