Редактирование: Простые типы данных
Внимание! Вы не авторизовались на сайте. Ваш IP-адрес будет публично видимым, если вы будете вносить любые правки. Если вы войдёте или создадите учётную запись, правки вместо этого будут связаны с вашим именем пользователя, а также у вас появятся другие преимущества.
Правка может быть отменена. Пожалуйста, просмотрите сравнение версий, чтобы убедиться, что это именно те изменения, которые вас интересуют, и нажмите «Записать страницу», чтобы изменения вступили в силу.
Текущая версия | Ваш текст | ||
Строка 1: | Строка 1: | ||
− | + | ||
− | + | BASETY := 'w' | 'l' | 's' | 'd' # Базовые типы | |
+ | |||
+ | EXTTY := BASETY | 'b' | 'h' # Расширенные типы | ||
Строка 6: | Строка 8: | ||
: <pre>The IL makes minimal use of types. By design, the types used are restricted to what is necessary for unambiguous compilation to machine code and C interfacing. Unlike LLVM, QBE is not using types as a means to safety; they are only here for semantic purposes.</pre> | : <pre>The IL makes minimal use of types. By design, the types used are restricted to what is necessary for unambiguous compilation to machine code and C interfacing. Unlike LLVM, QBE is not using types as a means to safety; they are only here for semantic purposes.</pre> | ||
− | Четыре базовых типа: w (word), l (long), s (single) и d (double), соответственно для 32-битных и 64-битных целых чисел, и 32-битных и 64-битных чисел с плавающей | + | Четыре базовых типа: w (word), l (long), s (single) и d (double), соответственно для 32-битных и 64-битных целых чисел, и 32-битных и 64-битных чисел с плавающей запятой номера. Типы указателей недоступны; указатели представляются целым типом, размерности которого достаточно, чтобы представлять все адреса памяти (например, l (long) на 64-разрядных архитектурах). Временные переменные в [[QBE | промежуточном языке]] могут иметь только базовый тип. |
: <pre>The four base types are w (word), l (long), s (single), and d (double), they stand respectively for 32-bit and 64-bit integers, and 32-bit and 64-bit floating-point numbers. There are no pointer types available; pointers are typed by an integer type sufficiently wide to represent all memory addresses (e.g., l on 64-bit architectures). Temporaries in the IL can only have a basic type.</pre> | : <pre>The four base types are w (word), l (long), s (single), and d (double), they stand respectively for 32-bit and 64-bit integers, and 32-bit and 64-bit floating-point numbers. There are no pointer types available; pointers are typed by an integer type sufficiently wide to represent all memory addresses (e.g., l on 64-bit architectures). Temporaries in the IL can only have a basic type.</pre> | ||
− | Расширенные типы содержат базовые типы плюс b (byte) и h (half word) соответственно для 8-битных и 16-битных целых чисел. Они используются в определениях | + | Расширенные типы содержат базовые типы плюс b (byte) и h (half word) соответственно для 8-битных и 16-битных целых чисел. Они используются в определениях Агрегированных типов и Данных. Для C-интерфейса [[QBE |промежуточный язык]] также предоставляет пользовательские агрегированные типы. Синтаксис, используемый для их обозначения <strong>: foo</strong>. Подробная информация об их определении приведена в разделе «Агрегированные типы». |
− | : <pre>Extended types contain base types plus b (byte) and h (half word), respectively for 8-bit and 16-bit integers. They are used in Aggregate Types and Data definitions. For C interfacing, the IL also provides user-defined aggregate types. The syntax used to designate them is :foo.</pre> | + | : <pre>Extended types contain base types plus b (byte) and h (half word), respectively for 8-bit and 16-bit integers. They are used in Aggregate Types and Data definitions. For C interfacing, the IL also provides user-defined aggregate types. The syntax used to designate them is :foo. Details about their definition are given in the Aggregate Types section.</pre> |
---- | ---- | ||
Источник: [https://c9x.me/compile/doc/il.html#Simple-Types c9x.me] | Источник: [https://c9x.me/compile/doc/il.html#Simple-Types c9x.me] |