Original English Text
The central data structure used by the internal representation is the
tree
. These nodes, while all of the C type tree
, are of
many varieties. A tree
is a pointer type, but the object to
which it points may be of a variety of types. From this point forward,
we will refer to trees in ordinary type, rather than in this
font
, except when talking about the actuAl C type tree
.
Korean Translation
tree
는 내부 표현으로서 사용하는 중심적인 데이터
구조다. 이 노드들은 C 타입뿐만 아니라 매우 다양한 것이
있다. tree
는 포인터 타입이지만 그것이 가리키는 대상은
매우 다양한 형태일 것이다. 이러한 관점에서 보면 우리는 실제 C 타입의
tree
를 얘기할 때를 제외하고는 tree
보다는 평범하게 트리라고 지칭할 것이다.
Comments from the BMTP Team
Original English Text
You can tell what kind of node a particular tree is by using the
TREE_CODE
macro. Many, many macros take a trees as input and
return trees as output. However, most macros require a certain kinds of
tree node as input. In other words, there is a type-system for trees,
but it is not reflected in the C type-system.
Korean Translation
당신은 TREE_CODE
매크로를 사용하게 되는 특정한 트리의
노드 종류를 말할 수 있다. 많은 매크로는 입력으로서 트리를 받고,
출력으로서 트리를 리턴한다. 그러나 대부분의 매크로는 입력으로서 특정한
종류의 트리 노드를 필요로 한다. 다시 말해, C 타입 시스템에선 반영되지 않는, 트리들에 대한 타입 시스템이 존재한다는 것이다.
Comments from the BMTP Team
Original English Text
For safety, it is useful to configure G++ with --enable-checking
.
Although this results in a significant performance penalty (since all
tree types are checked at run-time), and is therefore inappropriate in a
release version, it is extremely helpful during the development process.
Korean Translation
안정성을 위해 G++를 --enable-checking
과 함께 구성해 보는 -->
--것은 유용할 것이다. 그러나 이것은 눈에 띄는(significant) 성능 저하를 -->
--초래하는데(모든 트리 타입을 런타임에 체크하기 때문에), 이로 인해 -->
--배포 버전 과정에선 적당하지 않고, 개발 과정에서 사용하는 것이 상당히
--도움이 될 것이다.
Comments from the BMTP Team
Original English Text
Many macros behave as predicates. Many, although not all, of these
predicates end in `_P'. Do not rely on the result type of these
macros being of any particular type. You may, however, rely on the fact
that the type can be compared to 0
, so that statements like
if (TEST_P (t) && !TEST_P (y)) x = 1;
and
int i = (TEST_P (t) != 0);
are legal. Macros that return int
values now may be changed to
return tree
values, or other pointers in the future. Even those
that continue to return int
may return multiple non-zero codes
where previously they returned only zero and one. Therefore, you should
not write code like
if (TEST_P (t) == 1)
as this code is not guaranteed to work correctly in the future.
Korean Translation
많은 매크로가 술어(predicate)처럼 행동한다. 전부는 아니지만, 많은
술어가 `_P'로 끝난다. 어떤 특정한 타입으로서 이 매크로의
결과값에 의존해서는 안 된다. 하지만 타입이 0
과 비교될 수
있다는 사실은 믿을 만하다. 따라서 다음 두 문장은 문제가 없다.
if (TEST_P (t) && !TEST_P (y)) x = 1;
int i = (TEST_P (t) != 0);
int
값을 리턴하는 매크로는 tree
값이나 다른
포인터들을 리턴하는 것으로 바뀔 수도 있다. 심지어 int
값을 계속 리턴하는 매크로라도 0과 1만을 리턴하던 곳에 다수의 0이 아닌
코드를 리턴할 수도 있다. 따라서 다음과 같은 코드를 작성해서는 안
된다.
if (TEST_P (t) == 1)
이 코드는 정확하게 동작한다는 보장이 없기 때문이다.
Comments from the BMTP Team
Original English Text
You should not take the address of values returned by the macros or
functions described here. In particular, no guarantee is given that the
values are lvalues.
Korean Translation
여기서 언급된 매크로나 함수들에 의해 리턴된 값의 주소를 받아서는 않된다. 특히 왼쪽값(lvalue)들에 대해선 어떠한 보장도 주어지지 않는다.
Comments from the BMTP Team
Original English Text
In general, the names of macros are all in uppercase, while the names of
functions are entirely in lower case. There are rare exceptions to this
rule. You should assume that any macro or function whose name is made
up entirely of uppercase letters may evaluate its arguments more than
once. You may assume that a macro or function whose name is made up
entirely of lowercase letters will evaluate its arguments only once.
Korean Translation
일반적으로 매크로의 이름은 모두 대문자이고, 반면 함수의 이름은
전체적으로 소문자다. 이 규칙에 예외인 것은 극히 드물다. 전체가
대문자로만 이루어진 매크로나 함수는 아마도 그것의 인자들을 한번 이상
평가하리라는 것을 예상해야 한다. 또한 전체가 소문자로만 이루어진
매크로나 함수는 그것의 인자들을 오직 한번만 평가한다는 것을 예상해야 할 것이다.
Comments from the BMTP Team
Original English Text
The error_mark_node
is a special tree. Its tree code is
ERROR_MARK
, but since there is only ever one node with that code,
the usual practice is to compare the tree against
error_mark_node
. (This test is just a test for pointer
equality.) If an error has occurred during front-end processing the
flag errorcount
will be set. If the front-end has encountered
code it cannot handle, it will issue a message to the user and set
sorrycount
. When these flags are set, any macro or function
which normally returns a tree of a particular kind may instead return
the error_mark_node
. Thus, if you intend to do any processing of
erroneous code, you must be prepared to deal with the
error_mark_node
.
Korean Translation
error_mark_node
는 특별한 트리다. 그것의 트리 코드는
ERROR_MARK
다. 그러나 거기에는 이 코드와 함께 오직 하나의
노드가 있기 때문에 일반적인 관행은 error_mark_node
에
대하여 트리를 비교하는 것이다. 이 테스트는 단지 포인터 동등에 대한
테스트일 뿐이다. 만약 전위처리 과정(front-end processing) 중에 에러가
발생한다면 errorcount
플래그가 세팅될 것이다. 만약
전위처리 과정에서 다룰 수 없는 코드를 만났을 경우 사용자에게 메시지를
보내고 sorrycount
를 세팅할 것이다. 이 플래그들이
세팅됐을 때, 특정한 종류의 트리를 평범하게 리턴하는 어떤 매크로나
함수는 아마도 error_mark_node
를 대신 리턴할
것이다. 그러므로 에러가 발생할 가능성이 있는 어떤 과정을 처리하려 한다면 error_mark_node
와 함께 다루어질 수 있도록 준비해야만 한다.
Comments from the BMTP Team
Original English Text
Occasionally, a particular tree slot (like an operand to an expression,
or a particular field in a declaration) will be referred to as
"reserved for the back-end." These slots are used to store RTL when
the tree is converted to RTL for use by the GCC back-end. However, if
that process is not taking place (e.g., if the front-end is being hooked
up to an intelligent editor), then those slots may be used by the
back-end presently in use.
Korean Translation
이따금 특정한 트리 슬롯(표현식에서 피연산자나 선언부에서 특정한
필드)은 '후위(back-end
)'에 의해 예약된 것으로서 언급될
것이다. 이 슬롯들은 트리가 GCC 후위에 의해 RTL로 변환될 때 RTL을
저장하기 위해 사용된다. 그러나 만약 그 프로세스가 저장할 곳을 가지지
못한다면(e.g., if the front-end is being hooked up to an intelligent editor) 이 슬롯들은 현재 사용중인 후위에 의해 쓰여질 것이다.
Comments from the BMTP Team
Original English Text
If you encounter situations that do not match this documentation, such
as tree nodes of types not mentioned here, or macros documented to
return entities of a particular kind that instead return entities of
some different kind, you have found a bug, either in the front-end or in
the documentation. Please report these bugs as you would any other
bug.
Korean Translation
여기서 언급되지 않은 타입의 트리 노드나 특정한 종류의 집합들을 리턴받기로한 매크로가 대신 어떤 다른 종류의 집합들을 리턴받을 때와 같은, 이 문서와 일치하지 않는 상황을 만나게 된다면, 버그를 찾은 것이다. 다른 버그들을 대하듯이 이 버그들을 리포트해주길 바란다.
Comments from the BMTP Team
이 절은 아직 완성되지 않았다.
Original English Text
An IDENTIFIER_NODE
represents a slightly more general concept
that the standard C or C++ concept of identifier. In particular, an
IDENTIFIER_NODE
may contain a `$', or other extraordinary
characters.
Korean Translation
IDENTIFIER_NODE
는 표준 C나 C++의 식별자(identifier) 개념보다 좀 더 일반적인 개념을 표현한다. 특히 IDENTIFIER
는 `$' 또는 다른 특정한 문자들을 포함할 수도 있다.
Original English Text
There are never two distinct IDENTIFIER_NODE
s representing the
same identifier. Therefore, you may use pointer equality to compare
IDENTIFIER_NODE
s, rather than using a routine like
strcmp
.
Korean Translation
같은 식별자를 나타내는 두 개의 구별되는 IDENTIFIER_NODE
는
결코 없다. 그러므로 IDENTIFIER_NODE
들을 비교하기 위해
strcmp
같은 함수를 사용하기보다는 포인터의 동등 여부(pointer equality)를 사용하는 것이 바람직하다.
You can use the following macros to access identifiers:
Korean Translation
식별자들을 접근하기 위해 다음과 같은 매크로들을 사용할 수 있다.
IDENTIFIER_POINTER
char*
. This string is always NUL
-terminated, and contains
no embedded NUL
characters.
Korean Translation
char*
를 나타내는 식별자에 의해 표현되는 문자열. 이 문자열은 항상 NUL
로 끝나고 더 이상 어떤 NUL
문자들도 덫붙여지지 않는다. 틺�
IDENTIFIER_LENGTH
IDENTIFIER_POINTER
, not
including the trailing NUL
. This value of
IDENTIFIER_POINTER (x)
is always the same as strlen
(IDENTIFIER_POINTER (x))
.
Korean Translation
IDENTIFIER_POINTER
에 의해 리턴되는 문자열의 길이(따라오는
NUL
은 포함되지 않는다). IDENTIFIER_POINTER
(x)
의 값은 strlen (IDENTIFIER_POINTER (x))
와 항상 같다.
IDENTIFIER_OPNAME_P
IDENTIFIER_POINTER
or the
IDENTIFIER_LENGTH
.
Korean Translation
식별자가 오버로드된 연산자의 이름을 표현한다면 참의 값을 가지는
매크로. 이 경우 IDENTIFIER_POINTER
나
IDENTIFIER_LENGTH
의 내용에 의존해서는 안 된다.
IDENTIFIER_TYPENAME_P
TREE_TYPE
of
the IDENTIFIER_NODE
holds the type to which the conversion
operator converts.
Korean Translation
식별자가 사용자 정의된 변환 연산자의 이름을 표현할 때 참의 값을 가지는 매크로. 이 경우 IDENTIFIER_NODE
의 TREE_TYPE
은 변환 연산자가 변환한 것의 타입이다.틺
Original English Text
Two common container data structures can be represented directly with
tree nodes. A TREE_LIST
is a singly linked list containing two
trees per node. These are the TREE_PURPOSE
and TREE_VALUE
of each node. (Often, the TREE_PURPOSE
contains some kind of
tag, or additional information, while the TREE_VALUE
contains the
majority of the payload. In other cases, the TREE_PURPOSE
is
simply NULL_TREE
, while in still others both the
TREE_PURPOSE
and TREE_VALUE
are of equal stature.) Given
one TREE_LIST
node, the next node is found by following the
TREE_CHAIN
. If the TREE_CHAIN
is NULL_TREE
, then
you have reached the end of the list.
Korean Translation
두 개의 일반적인 컨테이너(container) 데이터 구조는 트리 노드들과 함께
바로 나타낼 수 있다. TREE_LIST
는 노드당 트리 두 개를
포함하는 단일 연결 리스트다. 여기에는 각 노드의
TREE_PURPOSE
와 TREE_VALUE
가 있다(종종
TREE_PURPOSE
는 어떤 종류의 태그나 추가 정보가 있는 반면
TREE_VALUE
는 주요 부분의 대부분을 포함한다.�다른 경우
TREE_PURPOSE
가 단순히 NULL_TREE
일 때
TREE_PURPOSE
와 TREE_VALUE
는 같은 상태에
있다). 주어진 하나의 TREE_LIST
노드에 대해 그 다음 노드는 TREE_CHAIN
에 의해 찾을 수 있다. 만약 TREE_CHAIN
이 NULL_TREE
이면 리스트의 끝에 다다른 것이다.
Original English Text
A TREE_VEC
is a simple vector. The TREE_VEC_LENGTH
is an
integer (not a tree) giving the number of nodes in the vector. The
nodes themselves are accessed using the TREE_VEC_ELT
macro, which
takes two arguments. The first is the TREE_VEC
in question; the
second is an integer indicating which element in the vector is desired.
The elements are indexed from zero.
Korean Translation
TREE_VEC
는 단순히 하나의
벡터다. TREE_VEC_LENGTH
는 벡터 안에서 노드들의 개수를
가지는 정수값이다(트리가 아니다). 그 노드들은 두 개의 인자가 있는
TREE_VEC_ELT
매크로를 사용하여 자신을 참조할 수 있다. 그
중 첫번째는 TREE_VEC
이고 두번째는 벡터 안에서 요구되는 요소들을 가리키는 정수값이다. 그 요소들은 0부터 인덱스된다.