@@ -392,7 +392,7 @@ class ArrayInit extends Expr, @arrayinit {
392392 * element assignments since there the assignment destination is not directly
393393 * the array variable but instead an `ArrayAccess`.
394394 */
395- class Assignment extends Expr , @assignment {
395+ class Assignment extends BinaryExpr , @assignment {
396396 /** Gets the destination (left-hand side) of the assignment. */
397397 Expr getDest ( ) { result .isNthChildOf ( this , 0 ) }
398398
@@ -417,6 +417,8 @@ class Assignment extends Expr, @assignment {
417417 * For example, `x = 23`.
418418 */
419419class AssignExpr extends Assignment , @assignexpr {
420+ override string getOp ( ) { result = "=" }
421+
420422 override string getAPrimaryQlClass ( ) { result = "AssignExpr" }
421423}
422424
@@ -445,7 +447,7 @@ class AssignOp extends Assignment, @assignop {
445447 override Expr getSource ( ) { result .getParent ( ) = this }
446448
447449 /** Gets a string representation of the assignment operator of this compound assignment. */
448- /*abstract*/ string getOp ( ) { result = "??=" }
450+ /*abstract*/ override string getOp ( ) { result = "??=" }
449451
450452 /** Gets a printable representation of this expression. */
451453 override string toString ( ) { result = "..." + this .getOp ( ) + "..." }
@@ -739,155 +741,155 @@ class BinaryExpr extends Expr, @binaryexpr {
739741 }
740742
741743 /** Gets a printable representation of this expression. */
742- override string toString ( ) { result = "..." + this .getOp ( ) + "..." }
744+ override string toString ( ) { result = "... " + this .getOp ( ) + " ..." }
743745
744746 /** Gets a string representation of the operator of this binary expression. */
745- /*abstract*/ string getOp ( ) { result = " ?? " }
747+ /*abstract*/ string getOp ( ) { result = "?? " }
746748}
747749
748750/** A binary expression using the `*` operator. */
749751class MulExpr extends BinaryExpr , @mulexpr {
750- override string getOp ( ) { result = " * " }
752+ override string getOp ( ) { result = "* " }
751753
752754 override string getAPrimaryQlClass ( ) { result = "MulExpr" }
753755}
754756
755757/** A binary expression using the `/` operator. */
756758class DivExpr extends BinaryExpr , @divexpr {
757- override string getOp ( ) { result = " / " }
759+ override string getOp ( ) { result = "/ " }
758760
759761 override string getAPrimaryQlClass ( ) { result = "DivExpr" }
760762}
761763
762764/** A binary expression using the `%` operator. */
763765class RemExpr extends BinaryExpr , @remexpr {
764- override string getOp ( ) { result = " % " }
766+ override string getOp ( ) { result = "% " }
765767
766768 override string getAPrimaryQlClass ( ) { result = "RemExpr" }
767769}
768770
769771/** A binary expression using the `+` operator. */
770772class AddExpr extends BinaryExpr , @addexpr {
771- override string getOp ( ) { result = " + " }
773+ override string getOp ( ) { result = "+ " }
772774
773775 override string getAPrimaryQlClass ( ) { result = "AddExpr" }
774776}
775777
776778/** A binary expression using the `-` operator. */
777779class SubExpr extends BinaryExpr , @subexpr {
778- override string getOp ( ) { result = " - " }
780+ override string getOp ( ) { result = "- " }
779781
780782 override string getAPrimaryQlClass ( ) { result = "SubExpr" }
781783}
782784
783785/** A binary expression using the `<<` operator. */
784786class LeftShiftExpr extends BinaryExpr , @lshiftexpr {
785- override string getOp ( ) { result = " << " }
787+ override string getOp ( ) { result = "<< " }
786788
787789 override string getAPrimaryQlClass ( ) { result = "LeftShiftExpr" }
788790}
789791
790792/** A binary expression using the `>>` operator. */
791793class RightShiftExpr extends BinaryExpr , @rshiftexpr {
792- override string getOp ( ) { result = " >> " }
794+ override string getOp ( ) { result = ">> " }
793795
794796 override string getAPrimaryQlClass ( ) { result = "RightShiftExpr" }
795797}
796798
797799/** A binary expression using the `>>>` operator. */
798800class UnsignedRightShiftExpr extends BinaryExpr , @urshiftexpr {
799- override string getOp ( ) { result = " >>> " }
801+ override string getOp ( ) { result = ">>>" }
800802
801803 override string getAPrimaryQlClass ( ) { result = "UnsignedRightShiftExpr" }
802804}
803805
804806/** A binary expression using the `&` operator. */
805807class AndBitwiseExpr extends BinaryExpr , @andbitexpr {
806- override string getOp ( ) { result = " & " }
808+ override string getOp ( ) { result = "& " }
807809
808810 override string getAPrimaryQlClass ( ) { result = "AndBitwiseExpr" }
809811}
810812
811813/** A binary expression using the `|` operator. */
812814class OrBitwiseExpr extends BinaryExpr , @orbitexpr {
813- override string getOp ( ) { result = " | " }
815+ override string getOp ( ) { result = "| " }
814816
815817 override string getAPrimaryQlClass ( ) { result = "OrBitwiseExpr" }
816818}
817819
818820/** A binary expression using the `^` operator. */
819821class XorBitwiseExpr extends BinaryExpr , @xorbitexpr {
820- override string getOp ( ) { result = " ^ " }
822+ override string getOp ( ) { result = "^ " }
821823
822824 override string getAPrimaryQlClass ( ) { result = "XorBitwiseExpr" }
823825}
824826
825827/** A binary expression using the `&&` operator. */
826828class AndLogicalExpr extends BinaryExpr , @andlogicalexpr {
827- override string getOp ( ) { result = " && " }
829+ override string getOp ( ) { result = "&& " }
828830
829831 override string getAPrimaryQlClass ( ) { result = "AndLogicalExpr" }
830832}
831833
832834/** A binary expression using the `||` operator. */
833835class OrLogicalExpr extends BinaryExpr , @orlogicalexpr {
834- override string getOp ( ) { result = " || " }
836+ override string getOp ( ) { result = "|| " }
835837
836838 override string getAPrimaryQlClass ( ) { result = "OrLogicalExpr" }
837839}
838840
839841/** A binary expression using the `<` operator. */
840842class LTExpr extends BinaryExpr , @ltexpr {
841- override string getOp ( ) { result = " < " }
843+ override string getOp ( ) { result = "< " }
842844
843845 override string getAPrimaryQlClass ( ) { result = "LTExpr" }
844846}
845847
846848/** A binary expression using the `>` operator. */
847849class GTExpr extends BinaryExpr , @gtexpr {
848- override string getOp ( ) { result = " > " }
850+ override string getOp ( ) { result = "> " }
849851
850852 override string getAPrimaryQlClass ( ) { result = "GTExpr" }
851853}
852854
853855/** A binary expression using the `<=` operator. */
854856class LEExpr extends BinaryExpr , @leexpr {
855- override string getOp ( ) { result = " <= " }
857+ override string getOp ( ) { result = "<= " }
856858
857859 override string getAPrimaryQlClass ( ) { result = "LEExpr" }
858860}
859861
860862/** A binary expression using the `>=` operator. */
861863class GEExpr extends BinaryExpr , @geexpr {
862- override string getOp ( ) { result = " >= " }
864+ override string getOp ( ) { result = ">= " }
863865
864866 override string getAPrimaryQlClass ( ) { result = "GEExpr" }
865867}
866868
867869/** A binary expression using Java's `==` or Kotlin's `===` operator. */
868870class EQExpr extends BinaryExpr , @eqexpr {
869- override string getOp ( ) { result = " == " }
871+ override string getOp ( ) { result = "== " }
870872
871873 override string getAPrimaryQlClass ( ) { result = "EQExpr" }
872874}
873875
874876/** A binary expression using the Kotlin `==` operator, semantically equivalent to `Objects.equals`. */
875877class ValueEQExpr extends BinaryExpr , @valueeqexpr {
876- override string getOp ( ) { result = " (value equals) " }
878+ override string getOp ( ) { result = "(value equals)" }
877879
878880 override string getAPrimaryQlClass ( ) { result = "ValueEQExpr" }
879881}
880882
881883/** A binary expression using Java's `!=` or Kotlin's `!==` operator. */
882884class NEExpr extends BinaryExpr , @neexpr {
883- override string getOp ( ) { result = " != " }
885+ override string getOp ( ) { result = "!= " }
884886
885887 override string getAPrimaryQlClass ( ) { result = "NEExpr" }
886888}
887889
888890/** A binary expression using the Kotlin `!=` operator, semantically equivalent to `Objects.equals`. */
889891class ValueNEExpr extends BinaryExpr , @valueneexpr {
890- override string getOp ( ) { result = " (value not-equals) " }
892+ override string getOp ( ) { result = "(value not-equals)" }
891893
892894 override string getAPrimaryQlClass ( ) { result = "ValueNEExpr" }
893895}
0 commit comments