@@ -40,7 +40,7 @@ class AspAttribute extends AspElement, @asp_attribute { }
4040 */
4141class AspOpenTag extends AspElement , @asp_open_tag {
4242 /** Either `>` or `/>`, depending on whether it's an empty tag. */
43- private string closeAngle ( ) { if isEmpty ( ) then result = "/>" else result = ">" }
43+ private string closeAngle ( ) { if this . isEmpty ( ) then result = "/>" else result = ">" }
4444
4545 /** Gets the `i`th attribute of this open tag. */
4646 AspAttribute getAttribute ( int i ) { asp_tag_attribute ( this , i , _, result ) }
@@ -58,9 +58,9 @@ class AspOpenTag extends AspElement, @asp_open_tag {
5858 predicate isEmpty ( ) { asp_tag_isempty ( this ) }
5959
6060 override string toString ( ) {
61- if hasAttribute ( )
62- then result = "<" + getName ( ) + " ..." + closeAngle ( )
63- else result = "<" + getName ( ) + closeAngle ( )
61+ if this . hasAttribute ( )
62+ then result = "<" + this . getName ( ) + " ..." + this . closeAngle ( )
63+ else result = "<" + this . getName ( ) + this . closeAngle ( )
6464 }
6565}
6666
@@ -75,9 +75,9 @@ class AspOpenTag extends AspElement, @asp_open_tag {
7575 */
7676class AspCloseTag extends AspElement , @asp_close_tag {
7777 /** Gets the name of this close tag. */
78- string getName ( ) { result = getBody ( ) }
78+ string getName ( ) { result = this . getBody ( ) }
7979
80- override string toString ( ) { result = "</" + getName ( ) + ">" }
80+ override string toString ( ) { result = "</" + this . getName ( ) + ">" }
8181}
8282
8383/**
@@ -146,44 +146,49 @@ class AspDirective extends AspElement, @asp_directive {
146146 string getName ( ) { asp_directive_name ( this , result ) }
147147
148148 /** Holds if this directive has an attribute. */
149- predicate hasAttribute ( ) { exists ( getAttribute ( _) ) }
149+ predicate hasAttribute ( ) { exists ( this . getAttribute ( _) ) }
150150
151151 override string toString ( ) {
152- if hasAttribute ( )
153- then result = "<%@" + getName ( ) + " ...%>"
154- else result = "<%@" + getName ( ) + "%>"
152+ if this . hasAttribute ( )
153+ then result = "<%@" + this . getName ( ) + " ...%>"
154+ else result = "<%@" + this . getName ( ) + "%>"
155155 }
156156}
157157
158158/** A quoted string used as an attribute in a tag. */
159159class AspQuotedString extends AspAttribute , @asp_quoted_string {
160160 override string toString ( ) {
161- if exists ( getBody ( ) .indexOf ( "\"" ) )
162- then result = "'" + getBody ( ) + "'"
163- else result = "\"" + getBody ( ) + "\""
161+ if exists ( this . getBody ( ) .indexOf ( "\"" ) )
162+ then result = "'" + this . getBody ( ) + "'"
163+ else result = "\"" + this . getBody ( ) + "\""
164164 }
165165}
166166
167167/** Arbitrary text. It will be inserted into the document as is. */
168168class AspText extends AspElement , @asp_text {
169- override string toString ( ) { result = getBody ( ) }
169+ override string toString ( ) { result = this . getBody ( ) }
170170}
171171
172172/** An XML directive, such as a `DOCTYPE` declaration. */
173173class AspXmlDirective extends AspElement , @asp_xml_directive {
174- override string toString ( ) { result = getBody ( ) }
174+ override string toString ( ) { result = this . getBody ( ) }
175175}
176176
177177/**
178178 * A 'Page' ASP directive.
179179 */
180180class PageDirective extends AspDirective {
181- PageDirective ( ) { getName ( ) = "Page" }
181+ PageDirective ( ) { this . getName ( ) = "Page" }
182182
183183 /**
184184 * Gets the 'CodeBehind' class from which this page inherits.
185185 */
186- ValueOrRefType getInheritedType ( ) { result .getQualifiedName ( ) = getInheritedTypeQualifiedName ( ) }
186+ ValueOrRefType getInheritedType ( ) {
187+ exists ( string qualifier , string name |
188+ result .hasQualifiedName ( qualifier , name ) and
189+ printQualifiedName ( qualifier , name ) = this .getInheritedTypeQualifiedName ( )
190+ )
191+ }
187192
188193 private string getInheritedTypeQualifiedName ( ) {
189194 // Relevant attributes:
@@ -192,11 +197,11 @@ class PageDirective extends AspDirective {
192197 // provide a fallback namespace if `Inherits` does not have one
193198 // - `CodeBehindFile`/`CodeFile`: used by tooling, but not semantically
194199 // relevant at runtime
195- exists ( string inherits | inherits = getAttributeByName ( "Inherits" ) .getBody ( ) |
200+ exists ( string inherits | inherits = this . getAttributeByName ( "Inherits" ) .getBody ( ) |
196201 if inherits .indexOf ( "." ) != - 1
197202 then result = inherits
198203 else
199- exists ( string className | className = getAttributeByName ( "ClassName" ) .getBody ( ) |
204+ exists ( string className | className = this . getAttributeByName ( "ClassName" ) .getBody ( ) |
200205 // take everything up to and including the last .
201206 className .prefix ( className .indexOf ( "." , count ( className .indexOf ( "." ) ) - 1 , 0 ) + 1 ) +
202207 inherits = result
0 commit comments