---
sourceDocument: 호주 API 참조
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/ko-KR/api-reference

 Release :

    - australia

ft:locale :

    - ko-KR

ft:publication_title :

    - 호주 API 참조

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# LinterCheckAstNode - 범위, 전역

# LinterCheckAstNode - 범위, 전역 {#ariaid-title1}

* 릴리스 버전: Australia
* 
* 업데이트 날짜 2026년 03월 12일
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 소요 시간: 4분

LinterCheckAstNode API는 린터 검사에서 AST(추상 구문 트리) 노드 세부 정보를 가져오는 메서드를 제공합니다.

이 API는 (com.glide.instance_scan) 플러그인에 인스턴스 스캔 포함되어 있으며 `sn_instance_scan` 네임스페이스에서 실행됩니다. 자세한 내용은 [인스턴스 스캔](https://www.servicenow.com/docs/access?context=hs-landing-page&version=australia&pubname=australia-platform-administration&ft:locale=en-US)을 참조하십시오.

이 클래스의 메서드를 사용하여 [린터 검사 양식](https://www.servicenow.com/docs/access?context=hc-linter-check&version=australia&pubname=australia-platform-administration&ft:locale=en-US)의 스크립트 필드에 코드를 추가하여 AST 노드 유형에 대한 린터 검사를 실행합니다. 자세한 내용은 [고급 린터 검사 스크립트를](https://www.servicenow.com/docs/access?context=hs-linter-check-scripts&version=australia&pubname=australia-platform-administration&ft:locale=en-US) 참조하세요.

린터 검사를 생성하여 스크립트의 문제를 식별합니다. 기록에 대해 린터 검사가 실행되면 해당 코드에 대한 추상 구문 트리가 생성됩니다. 추상 구문 트리를 사용하여 코드 관련 문제를 분석할 수 있습니다.

인스턴스 스캔 engine.rootNode 개체를 사용하는 이 API의 액세스 메서드입니다.

## LinterCheckAstNode - getNameIdentifier() {#ariaid-title2}

이름 노드 유형의 문자열 값을 검색합니다. 이름 노드는 함수 또는 변수 이름과 같이 키워드가 아닌 단순 식별자를 나타냅니다.
{#LinterCheckAN-getNameIdentifier__table_ckd_hxt_4pb__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 안 함 |   |   |
[표 1. 매개변수]

{#LinterCheckAN-getNameIdentifier__table_ckd_hxt_4pb} {#LinterCheckAN-getNameIdentifier__table_dkd_hxt_4pb__entry__2}

| 유형 | 설명 |
|-|-|
| 문자열 | Linter 객체가 이름 노드 유형인 경우 이름을 문자열로 반환합니다. 그렇지 않으면 null입니다. |
[표 2. 반환]

{#LinterCheckAN-getNameIdentifier__table_dkd_hxt_4pb}  
다음 예제에서는 린터 검사에서 결과 API [incrementWithNode()](https://servicenow-prod.fluidtopics.net/mRt8HgcgQz_MtJnCcjI2vw#Findings-incrementWithNode_O "현재 발견 결과가 Linter 검사에서 가져온 경우 이 메서드는 현재 발견 횟수를 늘리고 동시에 Linter 노드 객체를 발견 결과에 전달합니다.") 메서드를 사용합니다. [린터 검사 양식](https://www.servicenow.com/docs/access?context=hc-linter-check&version=australia&pubname=australia-platform-administration&ft:locale=en-US)의 스크립트 필드에서 이 방법을 사용합니다.

    (function(engine) {
      engine.rootNode.visit(function(node) {
        if (node.getTypeName() === "NAME" &&
            node.getNameIdentifier() === "soughtFunction" &&
            node.getParent().getTypeName() === "CALL") {
          engine.finding.incrementWithNode(node);
        } 
      });
    })(engine);

{#LinterCheckAN-getNameIdentifier__cBlock-instScan-linter-increment}

## LinterCheckAstNode - getParent() {#ariaid-title3}

액세스한 노드의 상위 노드 객체를 가져옵니다.
{#LinterCheckAN-getParent__table_ckd_hxt_4pb__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 안 함 |   |   |
[표 3. 매개변수]

{#LinterCheckAN-getParent__table_ckd_hxt_4pb} {#LinterCheckAN-getParent__table_dkd_hxt_4pb__entry__2}

| 유형 | 설명 |
|-|-|
| 객체 | 액세스한 노드의 상위 노드 객체입니다. |
[표 4. 반환]

{#LinterCheckAN-getParent__table_dkd_hxt_4pb}  
다음 예제에서는 린터 검사에서 결과 API [incrementWithNode()](https://servicenow-prod.fluidtopics.net/mRt8HgcgQz_MtJnCcjI2vw#Findings-incrementWithNode_O "현재 발견 결과가 Linter 검사에서 가져온 경우 이 메서드는 현재 발견 횟수를 늘리고 동시에 Linter 노드 객체를 발견 결과에 전달합니다.") 메서드를 사용합니다. [린터 검사 양식](https://www.servicenow.com/docs/access?context=hc-linter-check&version=australia&pubname=australia-platform-administration&ft:locale=en-US)의 스크립트 필드에서 이 방법을 사용합니다.

    (function(engine) {
      engine.rootNode.visit(function(node) {
        if (node.getTypeName() === "NAME" &&
            node.getNameIdentifier() === "soughtFunction" &&
            node.getParent().getTypeName() === "CALL") {
          engine.finding.incrementWithNode(node);
        } 
      });
    })(engine);

{#LinterCheckAN-getParent__cBlock-instScan-linter-increment}

## LinterCheckAstNode - getTypeName() {#ariaid-title4}

액세스한 노드의 유형을 가져옵니다.
{#LinterCheckAN-getTypeName__table_ckd_hxt_4pb__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 안 함 |   |   |
[표 5. 매개변수]

{#LinterCheckAN-getTypeName__table_ckd_hxt_4pb} {#LinterCheckAN-getTypeName__table_dkd_hxt_4pb__entry__2}

| 유형 | 설명 |
|-|-|
| 문자열 | 액세스한 노드의 유형 이름입니다. 예를 들어, 소스의 함수 호출은 유형 이름이 `CALL`인 노드로 토큰화됩니다. |
[표 6. 반환]

{#LinterCheckAN-getTypeName__table_dkd_hxt_4pb}  
다음 예제에서는 린터 검사에서 결과 API [incrementWithNode()](https://servicenow-prod.fluidtopics.net/mRt8HgcgQz_MtJnCcjI2vw#Findings-incrementWithNode_O "현재 발견 결과가 Linter 검사에서 가져온 경우 이 메서드는 현재 발견 횟수를 늘리고 동시에 Linter 노드 객체를 발견 결과에 전달합니다.") 메서드를 사용합니다. [린터 검사 양식](https://www.servicenow.com/docs/access?context=hc-linter-check&version=australia&pubname=australia-platform-administration&ft:locale=en-US)의 스크립트 필드에서 이 방법을 사용합니다.

    (function(engine) {
      engine.rootNode.visit(function(node) {
        if (node.getTypeName() === "NAME" &&
            node.getNameIdentifier() === "soughtFunction" &&
            node.getParent().getTypeName() === "CALL") {
          engine.finding.incrementWithNode(node);
        } 
      });
    })(engine);

{#LinterCheckAN-getTypeName__cBlock-instScan-linter-increment}

## LinterCheckAstNode - visit(함수 callbackFunction) {#ariaid-title5}

이 노드에서 시작하여 하위 트리의 각 노드에 액세스하고 각 노드에서 지정된 콜백 함수를 실행합니다.
{#LinterCheckAN-visit_F__table_vjz_t4s_spb__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 콜백함수 | 함수 | 이 노드의 하위 트리에 있는 각 노드에서 실행할 콜백 함수입니다. 이 콜백 함수는 노드를 방문할 노드인 매개변수로 사용합니다. |
[표 7. 매개변수]

{#LinterCheckAN-visit_F__table_vjz_t4s_spb} {#LinterCheckAN-visit_F__table_qky_bxs_spb__entry__2}

| 유형 | 설명 |
|-|-|
| 안 함 |   |
[표 8. 반환]

{#LinterCheckAN-visit_F__table_qky_bxs_spb}  
다음 예제에서는 린터 검사에서 결과 API [incrementWithNode()](https://servicenow-prod.fluidtopics.net/mRt8HgcgQz_MtJnCcjI2vw#Findings-incrementWithNode_O "현재 발견 결과가 Linter 검사에서 가져온 경우 이 메서드는 현재 발견 횟수를 늘리고 동시에 Linter 노드 객체를 발견 결과에 전달합니다.") 메서드를 사용합니다. [린터 검사 양식](https://www.servicenow.com/docs/access?context=hc-linter-check&version=australia&pubname=australia-platform-administration&ft:locale=en-US)의 스크립트 필드에서 이 방법을 사용합니다.

    (function(engine) {
      engine.rootNode.visit(function(node) {
        if (node.getTypeName() === "NAME" &&
            node.getNameIdentifier() === "soughtFunction" &&
            node.getParent().getTypeName() === "CALL") {
          engine.finding.incrementWithNode(node);
        } 
      });
    })(engine);

{#LinterCheckAN-visit_F__cBlock-instScan-linter-increment}

