     self.syntax = syntax
 
     for attr in syntax.groupAttributes {
+      switch attr.as(SyntaxEnum.self) {
       // Relation (lowerThan, higherThan)
-      if let relation = attr.as(PrecedenceGroupRelationSyntax.self) {
+      case .precedenceGroupRelation(let relation):
         let isLowerThan = relation.higherThanOrLowerThan.text == "lowerThan"
         for otherGroup in relation.otherNames {
           let otherGroupName = otherGroup.name.text

          self.relations.append(relation)
        }

        continue
      }

      // Assignment
      if let assignment = attr.as(PrecedenceGroupAssignmentSyntax.self) {
        self.assignment = assignment.flag.text == "true"
        continue
      }

      // Associativity
      if let associativity = attr.as(PrecedenceGroupAssociativitySyntax.self) {
        switch associativity.value.text {
        case "left":
          self.associativity = .left

        default:
          break
        }

      default:
        break
      }
    }
  }
