Changeset 1157
- Timestamp:
- 05/06/08 18:43:35 (4 months ago)
- Files:
-
- trunk/descent.core/src/descent/core/JavaCore.java (modified) (5 diffs)
- trunk/descent.core/src/descent/core/compiler/IProblem.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/ASTDmdNode.java (modified) (9 diffs)
- trunk/descent.core/src/descent/internal/compiler/parser/AddAssignExp.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/AddrExp.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/AndAndExp.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/ArrayExp.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/ArrayInitializer.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/ArrayLiteralExp.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/AssignExp.java (modified) (4 diffs)
- trunk/descent.core/src/descent/internal/compiler/parser/BinExp.java (modified) (4 diffs)
- trunk/descent.core/src/descent/internal/compiler/parser/CallExp.java (modified) (4 diffs)
- trunk/descent.core/src/descent/internal/compiler/parser/CastExp.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/CatAssignExp.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/CmpExp.java (modified) (2 diffs)
- trunk/descent.core/src/descent/internal/compiler/parser/DeleteExp.java (modified) (2 diffs)
- trunk/descent.core/src/descent/internal/compiler/parser/DivAssignExp.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/DotVarExp.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/DsymbolExp.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/EqualExp.java (modified) (2 diffs)
- trunk/descent.core/src/descent/internal/compiler/parser/Expression.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/IsExp.java (modified) (4 diffs)
- trunk/descent.core/src/descent/internal/compiler/parser/MinAssignExp.java (modified) (2 diffs)
- trunk/descent.core/src/descent/internal/compiler/parser/MulAssignExp.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/NewExp.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/PostExp.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/Problem.java (modified) (2 diffs)
- trunk/descent.core/src/descent/internal/compiler/parser/ProblemMessages.java (modified) (2 diffs)
- trunk/descent.core/src/descent/internal/compiler/parser/ProblemMessages.properties (modified) (2 diffs)
- trunk/descent.core/src/descent/internal/compiler/parser/ShlAssignExp.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/ShrAssignExp.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/StringExp.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/compiler/parser/TOK.java (modified) (2 diffs)
- trunk/descent.core/src/descent/internal/compiler/parser/Type.java (modified) (2 diffs)
- trunk/descent.core/src/descent/internal/compiler/parser/UshrAssignExp.java (modified) (1 diff)
- trunk/descent.core/src/descent/internal/core/parser (deleted)
- trunk/descent.core/src/descent/internal/core/resolved (deleted)
- trunk/descent.core/template/problem/problems.txt (modified) (2 diffs)
- trunk/update.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/descent.core/src/descent/core/JavaCore.java
r1029 r1157 92 92 import org.eclipse.core.runtime.IPath; 93 93 import org.eclipse.core.runtime.IProgressMonitor; 94 import org.eclipse.core.runtime.OperationCanceledException; 94 95 import org.eclipse.core.runtime.Platform; 95 96 import org.eclipse.core.runtime.Plugin; … … 101 102 102 103 import descent.core.compiler.CharOperation; 104 import descent.core.search.IJavaSearchConstants; 105 import descent.core.search.IJavaSearchScope; 106 import descent.core.search.SearchEngine; 107 import descent.core.search.SearchPattern; 108 import descent.core.search.TypeNameRequestor; 103 109 import descent.internal.compiler.util.SuffixConstants; 104 110 import descent.internal.core.BatchOperation; … … 2894 2900 try { 2895 2901 if (monitor != null) monitor.beginTask(Messages.javamodel_initialization, 100); 2896 /* TODO JDT search2897 2902 // dummy query for waiting until the indexes are ready and classpath containers/variables are initialized 2898 2903 SearchEngine engine = new SearchEngine(); … … 2906 2911 scope, 2907 2912 new TypeNameRequestor() { 2908 public void acceptType( 2909 int modifiers, 2910 char[] packageName, 2911 char[] simpleTypeName, 2912 char[][] enclosingTypeNames, 2913 String path) { 2913 @Override 2914 public void acceptType(long modifiers, char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, String path) { 2914 2915 // no type to accept 2915 2916 } … … 2927 2928 // else indexes were not ready: catch the exception so that jars are still refreshed 2928 2929 } 2929 */2930 2930 2931 2931 // check if the build state version number has changed since last session trunk/descent.core/src/descent/core/compiler/IProblem.java
r1155 r1157 481 481 int CalledWithArgumentTypesMatchesBoth = 270; 482 482 int SymbolIsNotAnArithmeticType = 271; 483 int CannotPerformModuloComplexArithmetic = 272; 484 int OperatorNotAllowedOnBoolExpression = 273; 485 int ForeachKeyTypeMustBeIntOrUint = 274; 486 int ForeachKeyCannotBeOutOrRef = 275; 487 int NoReverseIterationOnAssociativeArrays = 276; 488 int OnlyOneOrTwoArgumentsForAssociativeArrayForeach = 277; 489 int OnlyOneOrTwoArgumentsForArrayForeach = 278; 490 int ForeachTargetIsNotAnArrayOf = 279; 491 int ForeachValueCannotBeOutAndTypeBit = 280; 492 int ForeachKeyCannotBeInout = 281; 493 int ForeachValueOfUTFConversionCannotBeInout = 282; 494 int CannotInferTypeForSymbol = 283; 495 int CannotInferTypeFromInitializer = 284; 496 int NoStorageClassForSymbol = 285; 497 int OnlyOneValueOrTwoKeyValueArgumentsForTupleForeach = 286; 498 int CannotUniquelyInferForeachArgumentTypes = 287; 499 int InvalidForeachAggregate = 288; 500 int NotAnAssociativeArrayInitializer = 289; 501 int ArrayInitializersAsExpressionsNotAllowed = 290; 502 int IftypeConditionCannotBeAtGlobalScope = 291; 503 int SymbolIsNotAFieldOfSymbol = 292; 504 int RecursiveTemplateExpansion = 293; 505 int RecursiveTemplateExpansionForTemplateArgument = 294; 506 int IndexIsNotATypeOrExpression = 295; 507 int CannotHavePointerToSymbol = 296; 508 int SizeOfTypeIsNotKnown = 297; 509 int CanOnlySliceTupleTypes = 298; 510 int NoPropertyForTuple = 299; 511 int CannotResolveDotProperty = 300; 512 int CannotTakeAddressOfBitInArray = 301; 513 int OnlyOneIndexAllowedToIndex = 302; 514 int NoOpIndexOperatorOverloadForType = 303; 515 int ArrayDimensionOverflow = 304; 516 int OperatorAssignmentOverloadWithOpIndexIllegal = 305; 517 int CannotHaveOutOrInoutArgumentOfBitInArray = 306; 518 int SymbolIsAliasedToAFunction = 307; 519 int LinkageDoesNotMatchInterfaceFunction = 308; 520 int InterfaceFunctionIsNotImplemented = 309; 521 int ExpectedKeyAsArgumentToRemove = 310; 522 int CyclicConstructorCall = 311; 523 int MissingOrCurruptObjectDotD = 312; 524 int CannotContinueOutOfFinallyBlock = 313; 525 int ForwardDeclaration = 314; 526 int CannotFormDelegateDueToCovariantReturnType = 315; 527 int ForeachRangeKeyCannotHaveStorageClass = 316; 528 int MultipleOverridesOfSameFunction = 317; 529 int IdentityAssignmentOperatorOverloadIsIllegal = 318; 530 int LiteralsCannotBeClassMembers = 319; 531 int NoMatchForImplicitSuperCallInConstructor = 320; 532 int NoReturnAtEndOfFunction = 321; 533 int CanOnlyDeclareTypeAliasesWithinStaticIfConditionals = 322; 534 int PackageAndModuleHaveTheSameName = 323; 535 int StringLiteralsAreImmutable = 324; 536 int ExpressionDotNewIsOnlyForAllocatingNestedClasses = 325; 537 int TooManyArgumentsForArray = 326; 538 int ReturnExpressionExpected = 327; 539 int ReturnWithoutCallingConstructor = 328; 540 int ModuleIsInMultiplePackages = 329; 541 int ModuleIsInMultipleDefined = 330; 542 int NeedUpperAndLowerBoundToSlicePointer = 331; 543 int NeedUpperAndLowerBoundToSliceTuple = 332; 544 int CannotConvertStringLiteralToVoidPointer = 333; 545 int SymbolIsNotAPreInstanceInitializableField = 334; 546 int NoCaseStatementFollowingGoto = 335; 547 int SwitchStatementHasNoDefault = 336; 548 int SymbolIsNotAFunctionTemplate = 337; 549 int TupleIsNotAValidTemplateValueArgument = 338; 550 int IncompatibleArgumentsForTemplateInstantiation = 339; 551 int ThrowStatementsCannotBeInContracts = 340; 552 int CanOnlyThrowClassObjects = 341; 553 int StringExpectedAsSecondArgument = 342; 554 int WrongNumberOfArguments = 343; 555 int StringMustBeChars = 344; 556 int InvalidFirstArgument = 345; 557 int FirstArgumentIsNotAClass = 346; 558 int ArgumentHasNoMembers = 347; 559 int SymbolHasNoMembers = 348; 560 int KindSymbolHasNoMembers = 349; 561 int DotOffsetDeprecated = 350; 562 int NoClassInfoForComInterfaceObjects = 351; 563 int CannotMakeReferenceToABit = 352; 564 int CannotFormTupleOfTuples = 353; 565 int MissingInitializerInStaticConstructorForConstVariable = 354; 566 int GlobalsStaticsFieldsRefAndAutoParametersCannotBeAuto = 355; 567 int ReferenceToScopeClassMustBeScope = 356; 568 int NumberOfKeysMustMatchNumberOfValues = 357; 569 int ExpectedNumberArguments = 358; 570 int ArraySliceIfOutOfBounds = 359; 571 int InvalidUCS32Char = 360; 572 int TupleIndexExceedsBounds = 361; 573 int SliceIsOutOfRange = 362; 574 int CannotTakeAddressOf = 363; 575 int VariableIsUsedBeforeInitialization = 364; 576 int EscapingReferenceToLocal = 365; 577 int EscapingReferenceToAutoLocal = 366; 578 int EscapingReferenceToLocalVariable = 367; 579 int EscapingReferenceToVariadicParameter = 368; 580 int CanOnlyCatchClassObjects = 369; 581 int BaseClassIsForwardReferenced = 370; 582 int BaseIsForwardReferenced = 371; 583 int CannotInheritFromFinalClass = 372; 584 int StaticClassCannotInheritFromNestedClass = 373; 585 int SuperClassIsNestedWithin = 374; 586 int ArrayComparisonTypeMismatch = 375; 587 int ConditionalExpressionIsNotAModifiableLvalue = 376; 588 int CannotCastSymbolToSymbol = 377; 589 int CannotDeleteInstanceOfComInterface = 378; 590 int TemplateIsNotAMemberOf = 379; 591 int TemplateIdentifierIsNotAMemberOf = 380; 592 int CanOnlyInitiailizeConstMemberInsideConstructor = 381; 593 int SymbolIsNotAMember = 382; 594 int SymbolIsNotATemplate = 383; 595 int DSymbolHasNoSize = 384; 596 int ExpressionOfTypeDoesNotHaveABooleanValue = 385; 597 int ImplicitConversionCanCauseLossOfData = 386; 598 int ForwardReferenceToType = 387; 599 int FloatingPointConstantExpressionExpected = 388; 600 int ExpressionIsNotAValidTemplateValueArgument = 389; 601 int InvalidRangeLowerBound = 390; 602 int InvalidRangeUpperBound = 391; 603 int SymbolIsNotAScalarType = 392; 604 int ForeachIndexMustBeType = 393; 605 int ForeachValueMustBeType = 394; 606 int OpApplyFunctionMustReturnAnInt = 395; 607 int FunctionOfTypeOverridesButIsNotCovariant = 396; 608 int CannotOverrideFinalFunction = 397; 609 int IncompatibleCovariantTypes = 398; 610 int CannotUseTemplateToAddVirtualFunctionToClass = 399; 611 int OutResultIsAlreadyDefined = 400; 612 int MissingInitializerForConstField = 401; 613 int ImportNotFound = 402; 614 int SymbolMustBeAnArrayOfPointerType = 403; 615 int RvalueOfInExpressionMustBeAnAssociativeArray = 404; 616 int InterfaceInheritsFromDuplicateInterface = 405; 617 int LabelIsAlreadyDefined = 406; 618 int CannotSubtractPointerFromSymbol = 407; 619 int ThisForNestedClassMustBeAClassType = 408; 620 int CanOnlyDereferenceAPointer = 409; 621 int OuterClassThisNeededToNewNestedClass = 410; 622 int ThisForNestedClassMustBeOfType = 411; 623 int NoConstructorForSymbol = 412; 624 int NoAllocatorForSymbol = 413; 625 int NegativeArrayIndex = 414; 626 int NewCanOnlyCreateStructsDynamicArraysAndClassObjects = 415; 627 int MismatchedFunctionReturnTypeInference = 416; 628 int ShiftLeftExceeds = 417; 629 int SymbolCannotBeSlicedWithBrackets = 418; 630 int SliceExpressionIsNotAModifiableLvalue = 419; 631 int SymbolIsNotAMemberOf = 420; 632 int MoreInitiailizersThanFields = 421; 633 int OverlappingInitiailization = 422; 634 int CannotMakeExpressionOutOfInitializer = 423; 635 int NoDefaultOrCaseInSwitchStatement = 424; 636 int SymbolIsNotASymbol = 425; 637 int ForwardReferenceToTemplate = 426; 638 int ForwardReferenceToTemplateDeclaration = 427; 639 int SpecializationNotAllowedForDeducedParameter = 428; 640 int CannotDeclareTemplateAtFunctionScope = 429; 641 int TemplateHasNoValue = 430; 642 int CannotUseLocalAsTemplateParameter = 431; 643 int NoSizeForType = 432; 644 int SymbolDotSymbolIsNotADeclaration = 433; 645 int ThisIsRequiredButIsNotABaseClassOf = 434; 646 int ForwardReferenceToSymbol = 435; 647 int IdentifierOfSymbolIsNotDefined = 436; 648 int StructIsForwardReferenced = 437; 649 int CannotUseTemplateToAddFieldToAggregate = 438; 650 int CannotModifyFinalVariable = 439; 651 int InvalidUtf8Sequence2 = 440; 652 int Utf16HighValuePastEndOfString = 441; 653 int Utf16LowValueOutOfRange = 442; 654 int UnpairedUtf16Value = 443; 655 int IllegalUtf16Value = 444; 656 int StaticConstructorCanOnlyBePartOfStructClassModule = 445; 657 int ShiftAssignIsOutsideTheRange = 446; 658 int TemplateTupleParameterMustBeLastOne = 447; 659 int SymbolIsNestedInBoth = 448; 483 int SymbolIsNotAnArithmeticTypeItIs = 272; 484 int CannotPerformModuloComplexArithmetic = 273; 485 int OperatorNotAllowedOnBoolExpression = 274; 486 int ForeachKeyTypeMustBeIntOrUint = 275; 487 int ForeachKeyCannotBeOutOrRef = 276; 488 int NoReverseIterationOnAssociativeArrays = 277; 489 int OnlyOneOrTwoArgumentsForAssociativeArrayForeach = 278; 490 int OnlyOneOrTwoArgumentsForArrayForeach = 279; 491 int ForeachTargetIsNotAnArrayOf = 280; 492 int ForeachValueCannotBeOutAndTypeBit = 281; 493 int ForeachKeyCannotBeInout = 282; 494 int ForeachValueOfUTFConversionCannotBeInout = 283; 495 int CannotInferTypeForSymbol = 284; 496 int CannotInferTypeFromInitializer = 285; 497 int NoStorageClassForSymbol = 286; 498 int OnlyOneValueOrTwoKeyValueArgumentsForTupleForeach = 287; 499 int CannotUniquelyInferForeachArgumentTypes = 288; 500 int InvalidForeachAggregate = 289; 501 int NotAnAssociativeArrayInitializer = 290; 502 int ArrayInitializersAsExpressionsNotAllowed = 291; 503 int IftypeConditionCannotBeAtGlobalScope = 292; 504 int SymbolIsNotAFieldOfSymbol = 293; 505 int RecursiveTemplateExpansion = 294; 506 int RecursiveTemplateExpansionForTemplateArgument = 295; 507 int IndexIsNotATypeOrExpression = 296; 508 int CannotHavePointerToSymbol = 297; 509 int SizeOfTypeIsNotKnown = 298; 510 int CanOnlySliceTupleTypes = 299; 511 int NoPropertyForTuple = 300; 512 int CannotResolveDotProperty = 301; 513 int CannotTakeAddressOfBitInArray = 302; 514 int OnlyOneIndexAllowedToIndex = 303; 515 int NoOpIndexOperatorOverloadForType = 304; 516 int ArrayDimensionOverflow = 305; 517 int OperatorAssignmentOverloadWithOpIndexIllegal = 306; 518 int CannotHaveOutOrInoutArgumentOfBitInArray = 307; 519 int SymbolIsAliasedToAFunction = 308; 520 int LinkageDoesNotMatchInterfaceFunction = 309; 521 int InterfaceFunctionIsNotImplemented = 310; 522 int ExpectedKeyAsArgumentToRemove = 311; 523 int CyclicConstructorCall = 312; 524 int MissingOrCurruptObjectDotD = 313; 525 int CannotContinueOutOfFinallyBlock = 314; 526 int ForwardDeclaration = 315; 527 int CannotFormDelegateDueToCovariantReturnType = 316; 528 int ForeachRangeKeyCannotHaveStorageClass = 317; 529 int MultipleOverridesOfSameFunction = 318; 530 int IdentityAssignmentOperatorOverloadIsIllegal = 319; 531 int LiteralsCannotBeClassMembers = 320; 532 int NoMatchForImplicitSuperCallInConstructor = 321; 533 int NoReturnAtEndOfFunction = 322; 534 int CanOnlyDeclareTypeAliasesWithinStaticIfConditionals = 323; 535 int PackageAndModuleHaveTheSameName = 324; 536 int StringLiteralsAreImmutable = 325; 537 int ExpressionDotNewIsOnlyForAllocatingNestedClasses = 326; 538 int TooManyArgumentsForArray = 327; 539 int ReturnExpressionExpected = 328; 540 int ReturnWithoutCallingConstructor = 329; 541 int ModuleIsInMultiplePackages = 330; 542 int ModuleIsInMultipleDefined = 331; 543 int NeedUpperAndLowerBoundToSlicePointer = 332; 544 int NeedUpperAndLowerBoundToSliceTuple = 333; 545 int CannotConvertStringLiteralToVoidPointer = 334; 546 int SymbolIsNotAPreInstanceInitializableField = 335; 547 int NoCaseStatementFollowingGoto = 336; 548 int SwitchStatementHasNoDefault = 337; 549 int SymbolIsNotAFunctionTemplate = 338; 550 int TupleIsNotAValidTemplateValueArgument = 339; 551 int IncompatibleArgumentsForTemplateInstantiation = 340; 552 int ThrowStatementsCannotBeInContracts = 341; 553 int CanOnlyThrowClassObjects = 342; 554 int StringExpectedAsSecondArgument = 343; 555 int WrongNumberOfArguments = 344; 556 int StringMustBeChars = 345; 557 int InvalidFirstArgument = 346; 558 int FirstArgumentIsNotAClass = 347; 559 int ArgumentHasNoMembers = 348; 560 int SymbolHasNoMembers = 349; 561 int KindSymbolHasNoMembers = 350; 562 int DotOffsetDeprecated = 351; 563 int NoClassInfoForComInterfaceObjects = 352; 564 int CannotMakeReferenceToABit = 353; 565 int CannotFormTupleOfTuples = 354; 566 int MissingInitializerInStaticConstructorForConstVariable = 355; 567 int GlobalsStaticsFieldsRefAndAutoParametersCannotBeAuto = 356; 568 int ReferenceToScopeClassMustBeScope = 357; 569 int NumberOfKeysMustMatchNumberOfValues = 358; 570 int ExpectedNumberArguments = 359; 571 int ArraySliceIfOutOfBounds = 360; 572 int InvalidUCS32Char = 361; 573 int TupleIndexExceedsBounds = 362; 574 int SliceIsOutOfRange = 363; 575 int CannotTakeAddressOf = 364; 576 int VariableIsUsedBeforeInitialization = 365; 577 int EscapingReferenceToLocal = 366; 578 int EscapingReferenceToAutoLocal = 367; 579 int EscapingReferenceToLocalVariable = 368; 580 int EscapingReferenceToVariadicParameter = 369; 581 int CanOnlyCatchClassObjects = 370; 582 int BaseClassIsForwardReferenced = 371; 583 int BaseIsForwardReferenced = 372; 584 int CannotInheritFromFinalClass = 373; 585 int StaticClassCannotInheritFromNestedClass = 374; 586 int SuperClassIsNestedWithin = 375; 587 int ArrayComparisonTypeMismatch = 376; 588 int ConditionalExpressionIsNotAModifiableLvalue = 377; 589 int CannotCastSymbolToSymbol = 378; 590 int CannotDeleteInstanceOfComInterface = 379; 591 int TemplateIsNotAMemberOf = 380; 592 int TemplateIdentifierIsNotAMemberOf = 381; 593 int CanOnlyInitiailizeConstMemberInsideConstructor = 382; 594 int SymbolIsNotAMember = 383; 595 int SymbolIsNotATemplate = 384; 596 int DSymbolHasNoSize = 385; 597 int ExpressionOfTypeDoesNotHaveABooleanValue = 386; 598 int ImplicitConversionCanCauseLossOfData = 387; 599 int ForwardReferenceToType = 388; 600 int FloatingPointConstantExpressionExpected = 389; 601 int ExpressionIsNotAValidTemplateValueArgument = 390; 602 int InvalidRangeLowerBound = 391; 603 int InvalidRangeUpperBound = 392; 604 int SymbolIsNotAScalarType = 393; 605 int ForeachIndexMustBeType = 394; 606 int ForeachValueMustBeType = 395; 607 int OpApplyFunctionMustReturnAnInt = 396; 608 int FunctionOfTypeOverridesButIsNotCovariant = 397; 609 int CannotOverrideFinalFunction = 398; 610 int IncompatibleCovariantTypes = 399; 611 int CannotUseTemplateToAddVirtualFunctionToClass = 400; 612 int OutResultIsAlreadyDefined = 401; 613 int MissingInitializerForConstField = 402; 614 int ImportNotFound = 403; 615 int SymbolMustBeAnArrayOfPointerType = 404; 616 int RvalueOfInExpressionMustBeAnAssociativeArray = 405; 617 int InterfaceInheritsFromDuplicateInterface = 406; 618 int LabelIsAlreadyDefined = 407; 619 int CannotSubtractPointerFromSymbol = 408; 620 int ThisForNestedClassMustBeAClassType = 409; 621 int CanOnlyDereferenceAPointer = 410; 622 int OuterClassThisNeededToNewNestedClass = 411; 623 int ThisForNestedClassMustBeOfType = 412; 624 int NoConstructorForSymbol = 413; 625 int NoAllocatorForSymbol = 414; 626 int NegativeArrayIndex = 415; 627 int NewCanOnlyCreateStructsDynamicArraysAndClassObjects = 416; 628 int MismatchedFunctionReturnTypeInference = 417; 629 int ShiftLeftExceeds = 418; 630 int SymbolCannotBeSlicedWithBrackets = 419; 631 int SliceExpressionIsNotAModifiableLvalue = 420; 632 int SymbolIsNotAMemberOf = 421; 633 int MoreInitiailizersThanFields = 422; 634 int OverlappingInitiailization = 423; 635 int CannotMakeExpressionOutOfInitializer = 424; 636 int NoDefaultOrCaseInSwitchStatement = 425; 637 int SymbolIsNotASymbol = 426; 638 int ForwardReferenceToTemplate = 427; 639 int ForwardReferenceToTemplateDeclaration = 428; 640 int SpecializationNotAllowedForDeducedParameter = 429; 641 int CannotDeclareTemplateAtFunctionScope = 430; 642 int TemplateHasNoValue = 431; 643 int CannotUseLocalAsTemplateParameter = 432; 644 int NoSizeForType = 433; 645 int SymbolDotSymbolIsNotADeclaration = 434; 646 int ThisIsRequiredButIsNotABaseClassOf = 435; 647 int ForwardReferenceToSymbol = 436; 648 int IdentifierOfSymbolIsNotDefined = 437; 649 int StructIsForwardReferenced = 438; 650 int CannotUseTemplateToAddFieldToAggregate = 439; 651 int CannotModifyFinalVariable = 440; 652 int InvalidUtf8Sequence2 = 441; 653 int Utf16HighValuePastEndOfString = 442; 654 int Utf16LowValueOutOfRange = 443; 655 int UnpairedUtf16Value = 444; 656 int IllegalUtf16Value = 445; 657 int StaticConstructorCanOnlyBePartOfStructClassModule = 446; 658 int ShiftAssignIsOutsideTheRange = 447; 659 int TemplateTupleParameterMustBeLastOne = 448; 660 int SymbolIsNestedInBoth = 449; 661 int FunctionIsAbstract = 450; 662 int KindSymbolDoesNotOverload = 451; 663 int MismatchedTupleLengths = 452; 664 int DoNotUseNullWhenComparingClassTypes = 453; 665 int UseTokenInsteadOfTokenWhenComparingWithNull = 454; 660 666 661 667 } trunk/descent.core/src/descent/internal/compiler/parser/ASTDmdNode.java
r1155 r1157 621 621 SemanticContext context) { 622 622 if (e == null) { 623 if (d.prot() == PROTprivate && d.getModule() != sc.module 624 || d.prot() == PROTpackage && !hasPackageAccess(sc, d)) { 625 if (context.acceptsProblems()) { 626 context.acceptProblem(Problem.newSemanticTypeError(IProblem.SymbolIsNotAccessible, this, new String[] { d.kind(), d 627 .getModule().toChars(context), d.toChars(context), 628 sc.module.toChars(context) })); 629 } 623 if (context.acceptsProblems() && 624 (d.prot() == PROTprivate && d.getModule() != sc.module 625 || d.prot() == PROTpackage && !hasPackageAccess(sc, d))) { 626 context.acceptProblem(Problem.newSemanticTypeError(IProblem.SymbolIsNotAccessible, this, new String[] { d.kind(), d 627 .getModule().toChars(context), d.toChars(context), 628 sc.module.toChars(context) })); 630 629 } 631 630 } else if (e.type.ty == Tclass) { // Do access check … … 676 675 } 677 676 argbuf.reset(); 678 arg.type.toCBuffer2(argbuf, null, hgs, context);677 arg.type.toCBuffer2(argbuf, hgs, 0, context); 679 678 buf.write(argbuf); 680 679 } … … 687 686 for (int i = 0; i < arguments.size(); i++) { 688 687 Expression arg = arguments.get(i); 689 690 if (i != 0) { 691 buf.writeByte(','); 692 } 693 expToCBuffer(buf, hgs, arg, PREC.PREC_assign, context); 688 689 if (arg != null) { 690 if (i != 0) { 691 buf.writeByte(','); 692 } 693 expToCBuffer(buf, hgs, arg, PREC.PREC_assign, context); 694 } 694 695 } 695 696 } … … 902 903 // 'invariant' 903 904 // BUG: assignments to inout should also be type 'invariant' 904 arg = arg.modifiableLvalue(sc, null, context);905 arg = arg.modifiableLvalue(sc, arg, context); 905 906 906 907 // if (arg.op == TOKslice) … … 908 909 909 910 // Don't have a way yet to do a pointer to a bit in array 910 if (arg.op == TOKarray 911 && arg.type.toBasetype(context).ty == Tbit) { 912 if (context.acceptsProblems()) { 913 context.acceptProblem(Problem.newSemanticTypeError( 914 IProblem.CannotHaveOutOrInoutArgumentOfBitInArray, this)); 915 } 911 if (context.acceptsProblems() && 912 arg.op == TOKarray && 913 arg.type.toBasetype(context).ty == Tbit) { 914 context.acceptProblem(Problem.newSemanticTypeError( 915 IProblem.CannotHaveOutOrInoutArgumentOfBitInArray, this)); 916 916 } 917 917 } … … 1872 1872 1873 1873 public void errorOnModifier(int problemId, TOK tok, SemanticContext context) { 1874 if (context.acceptsProblems()) { 1875 return; 1876 } 1877 1874 1878 boolean reported = false; 1875 1879 … … 1877 1881 for (Modifier modifier : modifiers) { 1878 1882 if (modifier.tok == tok) { 1879 if (context.acceptsProblems()) { 1880 context.acceptProblem(Problem.newSemanticTypeError( 1881 problemId, modifier)); 1882 } 1883 context.acceptProblem(Problem.newSemanticTypeError( 1884 problemId, modifier)); 1883 1885 reported = true; 1884 1886 } … … 1889 1891 for (Modifier modifier : extraModifiers) { 1890 1892 if (modifier.tok == tok) { 1891 if (context.acceptsProblems()) { 1892 context.acceptProblem(Problem.newSemanticTypeError( 1893 problemId, modifier)); 1894 } 1893 context.acceptProblem(Problem.newSemanticTypeError( 1894 problemId, modifier)); 1895 1895 reported = true; 1896 1896 } … … 1899 1899 1900 1900 if (!reported) { 1901 if (context.acceptsProblems()) { 1902 context.acceptProblem(Problem.newSemanticTypeErrorLoc( 1903 problemId, this)); 1904 } 1901 context.acceptProblem(Problem.newSemanticTypeErrorLoc( 1902 problemId, this)); 1905 1903 } 1906 1904 } trunk/descent.core/src/descent/internal/compiler/parser/AddAssignExp.java
r964 r1157 55 55 } 56 56 57 e1 = e1.modifiableLvalue(sc, null, context);57 e1 = e1.modifiableLvalue(sc, e1, context); 58 58 59 59 Type tb1 = e1.type.toBasetype(context); trunk/descent.core/src/descent/internal/compiler/parser/AddrExp.java
r1154 r1157 137 137 TypeSArray ts = (TypeSArray) ve.type; 138 138 integer_t dim = ts.dim.toInteger(context); 139 if ( index.compareTo(0) < 0 || index.compareTo(dim) >= 0) {139 if (context.acceptsProblems() && (index.compareTo(0) < 0 || index.compareTo(dim) >= 0)) { 140 140 // PERHAPS test this error 141 if (context.acceptsProblems()) { 142 context.acceptProblem(Problem.newSemanticTypeError( 143 IProblem.ArrayIndexOutOfBounds, 144 this, 145 new String[] { 146 String.valueOf(index), 147 String.valueOf(dim), 148 })); 149 } 141 context.acceptProblem(Problem.newSemanticTypeError( 142 IProblem.ArrayIndexOutOfBounds, 143 this, 144 new String[] { 145 String.valueOf(index), 146 String.valueOf(dim), 147 })); 150 148 } 151 149 e = new SymOffExp(loc, ve.var, index.multiply(ts.next trunk/descent.core/src/descent/internal/compiler/parser/AndAndExp.java
r1154 r1157 123 123 } else { 124 124 e2 = e2.optimize(WANTflags | (result & WANTinterpret), context); 125 if (result > 0 && e2.type.toBasetype(context).ty == Tvoid 125 if (context.acceptsProblems() && 126 result > 0 && e2.type.toBasetype(context).ty == Tvoid 126 127 && context.global.errors <= 0) { 127 if (context.acceptsProblems()) { 128 context.acceptProblem(Problem.newSemanticTypeError( 129 IProblem.SymbolHasNoValue, this, 130 new String[] { "void" })); 131 } 128 context.acceptProblem(Problem.newSemanticTypeError( 129 IProblem.SymbolHasNoValue, this, 130 new String[] { "void" })); 132 131 } 133 132 if (e1.isConst()) { trunk/descent.core/src/descent/internal/compiler/parser/ArrayExp.java
r1154 r1157 109 109 @Override 110 110 public Expression toLvalue(Scope sc, Expression e, SemanticContext context) { 111 if ((type != null) && (type.toBasetype(context).ty == TY.Tvoid)) { 112 if (context.acceptsProblems()) { 113 context.acceptProblem(Problem.newSemanticTypeError( 114 IProblem.VoidsHaveNoValue, this)); 115 } 111 if (context.acceptsProblems() && 112 (type != null) && (type.toBasetype(context).ty == TY.Tvoid)) { 113 context.acceptProblem(Problem.newSemanticTypeError( 114 IProblem.VoidsHaveNoValue, this)); 116 115 } 117 116 return this; trunk/descent.core/src/descent/internal/compiler/parser/ArrayInitializer.java
r1154 r1157 136 136 } 137 137 } 138 if (new integer_t(dim).multiply(t.next.size(context)).compareTo(amax) >= 0) { 139 if (context.acceptsProblems()) { 140 context.acceptProblem(Problem.newSemanticTypeError(IProblem.ArrayDimensionExceedsMax, this, new String[] { String.valueOf(dim), amax.divide(t.next.size(context)).toString() })); 141 } 138 if (context.acceptsProblems() && 139 new integer_t(dim).multiply(t.next.size(context)).compareTo(amax) >= 0) { 140 context.acceptProblem(Problem.newSemanticTypeError(IProblem.ArrayDimensionExceedsMax, this, new String[] { String.valueOf(dim), amax.divide(t.next.size(context)).toString() })); 142 141 } 143 142 return this; trunk/descent.core/src/descent/internal/compiler/parser/ArrayLiteralExp.java
r1154 r1157 133 133 Expression e; 134 134 Type t0 = null; 135 136 if (type != null) { 137 return this; 138 } 135 139 136 140 // Run semantic() on each element trunk/descent.core/src/descent/internal/compiler/parser/AssignExp.java
r1154 r1157 4 4 import descent.core.compiler.IProblem; 5 5 import descent.internal.compiler.parser.ast.IASTVisitor; 6 7 import static descent.internal.compiler.parser.TOK.*; 6 8 7 9 // DMD 1.020 … … 150 152 e2 = resolveProperties(sc, e2, context); 151 153 assert (null != e1.type); 154 155 /* Rewrite tuple assignment as a tuple of assignments. 156 */ 157 if (e1.op == TOKtuple && e2.op == TOKtuple) 158 { TupleExp tup1 = (TupleExp)e1; 159 TupleExp tup2 = (TupleExp) e2; 160 int dim = size(tup1.exps); 161 if (dim != size(tup2.exps)) 162 { 163 if (context.acceptsProblems()) { 164 context.acceptProblem(Problem.newSemanticTypeError(IProblem.MismatchedTupleLengths, this, new String[] { String.valueOf(dim), String.valueOf(size(tup2.exps)) })); 165 } 166 } 167 else 168 { Expressions exps = new Expressions(); 169 exps.setDim(dim); 170 171 for (int i = 0; i < dim; i++) 172 { 173 Expression ex1 = (Expression) tup1.exps.get(i); 174 Expression ex2 = (Expression) tup2.exps.get(i); 175 exps.set(i, new AssignExp(loc, ex1, ex2)); 176 } 177 Expression e = new TupleExp(loc, exps); 178 e = e.semantic(sc, context); 179 return e; 180 } 181 } 182 152 183 153 184 t1 = e1.type.toBasetype(context); … … 178 209 // e1 is not an lvalue, but we let code generator handle it 179 210 ArrayLengthExp ale = (ArrayLengthExp) e1; 180 ale.e1 = ale.e1.modifiableLvalue(sc, null, context);211 ale.e1 = ale.e1.modifiableLvalue(sc, e1, context); 181 212 } else if (e1.op == TOK.TOKslice) { 182 213 ; … … 187 218 } 188 219 189 if (e1.op == TOK.TOKslice && null != t1.next 190 && !(t1.next.equals(e2.type.next))) { // memset 220 if (e1.op == TOK.TOKslice && 221 null != t1.nextOf() && 222 e2.implicitConvTo(t1.nextOf(), context) != MATCH.MATCHnomatch && 223 !(t1.nextOf().equals(e2.type.nextOf()))) { 224 // memset 225 ismemset = true; // make it easy for back end to tell what this is 191 226 e2 = e2.implicitCastTo(sc, t1.next, context); 192 227 } else if (t1.ty == TY.Tsarray) { trunk/descent.core/src/descent/internal/compiler/parser/BinExp.java
r1154 r1157 19 19 import static descent.internal.compiler.parser.TOK.TOKassign; 20 20 import static descent.internal.compiler.parser.TOK.TOKassocarrayliteral; 21 import static descent.internal.compiler.parser.TOK.TOKblit; 21 22 import static descent.internal.compiler.parser.TOK.TOKcast; 22 23 import static descent.internal.compiler.parser.TOK.TOKcatass; 24 import static descent.internal.compiler.parser.TOK.TOKconstruct; 23 25 import static descent.internal.compiler.parser.TOK.TOKdivass; 24 26 import static descent.internal.compiler.parser.TOK.TOKequal; … … 109 111 public int checkSideEffect(int flag, SemanticContext context) { 110 112 if (op == TOKplusplus || op == TOKminusminus || op == TOKassign 113 || op == TOKconstruct || op == TOKblit 111 114 || op == TOKaddass || op == TOKminass || op == TOKcatass 112 115 || op == TOKmulass || op == TOKdivass || op == TOKmodass … … 132 135 } 133 136 134 e1 = e1.modifiableLvalue(sc, null, context);137 e1 = e1.modifiableLvalue(sc, e1, context); 135 138 e1.checkScalar(context); 136 139 type = e1.type; … … 159 162 } 160 163 161 e1 = e1.modifiableLvalue(sc, null, context);164 e1 = e1.modifiableLvalue(sc, e1, context); 162 165 e1.checkScalar(context); 163 166 type = e1.type; 164 if (type.toBasetype(context).ty == Tbool) { 165 if (context.acceptsProblems()) { 166 context.acceptProblem(Problem.newSemanticTypeError( 167 IProblem.OperatorNotAllowedOnBoolExpression, this, new String[] { toChars(context) })); 168 } 167 if (context.acceptsProblems() && type.toBasetype(context).ty == Tbool) { 168 context.acceptProblem(Problem.newSemanticTypeError( 169 IProblem.OperatorNotAllowedOnBoolExpression, this, new String[] { toChars(context) })); 169 170 } 170 171 typeCombine(sc, context); trunk/descent.core/src/descent/internal/compiler/parser/CallExp.java
r1154 r1157 25 25 import static descent.internal.compiler.parser.TOK.TOKtemplate; 26 26 import static descent.internal.compiler.parser.TOK.TOKthis; 27 import static descent.internal.compiler.parser.TOK. TOKvar;27 import static descent.internal.compiler.parser.TOK.*; 28 28 29 29 import static descent.internal.compiler.parser.TY.Taarray; … … 307 307 sourceE1.setResolvedSymbol(opCall); 308 308 309 // goto L1; // overload of opCall, therefore it's a call 310 // Rewrite as e1.call(arguments) 311 Expression e = new DotIdExp(loc, e1, new IdentifierExp( 312 Id.call)); 313 e = new CallExp(loc, e, arguments); 314 e = e.semantic(sc, context); 315 return e; 309 // goto L1; 310 return semantic_L1(sc, context); 311 } 312 313 if (e1.op != TOKtype) { 314 if (context.acceptsProblems()) { 315 context.acceptProblem(Problem.newSemanticTypeError(IProblem.KindSymbolDoesNotOverload, this, new String[] { ad.kind(), ad.toChars(context) })); 316 } 316 317 } 317 318 … … 321 322 (StructDeclaration) ad, arguments); 322 323 e = e.semantic(sc, context); 324 e.type = e1.type; // in case e1.type was a typedef 323 325 return e; 324 326 } else if (t1.ty == Tclass) { 325 327 ad = ((TypeClass) t1).sym; 326 328 // goto L1;&n
