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
Korean Translation
Korean Translation
Korean Translation
½Äº°ÀÚµéÀ» Á¢±ÙÇϱâ À§ÇØ ´ÙÀ½°ú °°Àº ¸ÅÅ©·ÎµéÀ» »ç¿ëÇÒ ¼ö ÀÖ´Ù.
IDENTIFIER_POINTER
char*
. This string is always NUL
-terminated, and contains
no embedded NUL
characters.
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))
.
IDENTIFIER_POINTER
¿¡ ÀÇÇØ ¸®ÅϵǴ ¹®ÀÚ¿ÀÇ ±æÀÌ(µû¶ó¿À´Â
NUL
Àº Æ÷ÇÔµÇÁö ¾Ê´Â´Ù). IDENTIFIER_POINTER
(x)
ÀÇ °ªÀº strlen (IDENTIFIER_POINTER (x))
¿Í Ç×»ó °°´Ù.
IDENTIFIER_OPNAME_P
IDENTIFIER_POINTER
or the
IDENTIFIER_LENGTH
.
½Äº°ÀÚ°¡ ¿À¹ö·ÎµåµÈ ¿¬»êÀÚÀÇ À̸§À» Ç¥ÇöÇÑ´Ù¸é ÂüÀÇ °ªÀ» °¡Áö´Â
¸ÅÅ©·Î. ÀÌ °æ¿ì 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ºÎÅÍ À妽ºµÈ´Ù.