@@ -380,6 +380,55 @@ class StructTmLeapYearFieldAccess extends LeapYearFieldAccess {
380380 }
381381}
382382
383+ /**
384+ * `stDate.wMonth == 2`
385+ */
386+ class DateCheckMonthFebruary extends Operation {
387+ DateCheckMonthFebruary ( ) {
388+ this .getOperator ( ) = "==" and
389+ this .getAnOperand ( ) instanceof MonthFieldAccess and
390+ this .getAnOperand ( ) .( Literal ) .getValue ( ) = "2"
391+ }
392+
393+ Expr getDateQualifier ( ) {
394+ result = this .getAnOperand ( ) .( MonthFieldAccess ) .getQualifier ( )
395+ }
396+ }
397+
398+ /**
399+ * `stDate.wDay == 29`
400+ */
401+ class DateCheckDay29 extends Operation {
402+ DateCheckDay29 ( ) {
403+ this .getOperator ( ) = "==" and
404+ this .getAnOperand ( ) instanceof DayFieldAccess and
405+ this .getAnOperand ( ) .( Literal ) .getValue ( ) = "29"
406+ }
407+
408+ Expr getDateQualifier ( ) {
409+ result = this .getAnOperand ( ) .( DayFieldAccess ) .getQualifier ( )
410+ }
411+ }
412+
413+ /**
414+ * The combination of a February and Day 29 verification
415+ * `stDate.wMonth == 2 && stDate.wDay == 29`
416+ */
417+ class DateFebruary29Check extends Operation {
418+ DateFebruary29Check ( ) {
419+ this .getOperator ( ) = "&&" and
420+ exists ( DateCheckMonthFebruary checkFeb , DateCheckDay29 check29 |
421+ checkFeb = this .getAnOperand ( ) and
422+ check29 = this .getAnOperand ( ) and
423+ hashCons ( checkFeb .getDateQualifier ( ) ) = hashCons ( check29 .getDateQualifier ( ) )
424+ )
425+ }
426+
427+ Expr getDateQualifier ( ) {
428+ result = this .getAnOperand ( ) .( DateCheckMonthFebruary ) .getDateQualifier ( )
429+ }
430+ }
431+
383432/**
384433 * `Function` that includes an operation that is checking for leap year.
385434 */
0 commit comments