Поиск:

Ответ в темуСоздание новой темы Создание опроса
> ВНИМАНИЕ! Подсветка синтаксиса на форуме. Финальный релиз. Всем сюда! 
:(
    Опции темы
sergejzr
Дата 25.12.2004, 19:41 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Un salsero
Group Icon


Профиль
Группа: Админ
Сообщений: 13285
Регистрация: 10.2.2004
Где: Германия г .Ганновер

Репутация: 35
Всего: 360



Если @ не используется в других контекстах, то исправил smile


--------------------
PM WWW IM ICQ Skype GTalk Jabber AOL YIM MSN   Вверх
Cheba
Дата 25.12.2004, 23:20 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


pointless one
***


Профиль
Группа: Vingrad developer
Сообщений: 1777
Регистрация: 27.11.2003
Где: /dev/null

Репутация: 5
Всего: 62



sergej.z, а оно используется. smile
PM MAIL ICQ   Вверх
sergejzr
Дата 25.12.2004, 23:24 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Un salsero
Group Icon


Профиль
Группа: Админ
Сообщений: 13285
Регистрация: 10.2.2004
Где: Германия г .Ганновер

Репутация: 35
Всего: 360



В каких?


--------------------
PM WWW IM ICQ Skype GTalk Jabber AOL YIM MSN   Вверх
Cheba
Дата 26.12.2004, 18:53 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


pointless one
***


Профиль
Группа: Vingrad developer
Сообщений: 1777
Регистрация: 27.11.2003
Где: /dev/null

Репутация: 5
Всего: 62



Цитата(Delphi)
Labels

Labels are used in built-in assembly statements as they are in the Delphi language--by writing the label and a colon before a statement. There is no limit to a label's length. As in Delphi, labels must be declared in a label declaration part in the block containing the asm statement. The one exception to this rule is local labels.

Local labels are labels that start with an at-sign (@). They consist of an at-sign followed by one or more letters, digits, underscores, or at-signs. Use of local labels is restricted to asm statements, and the scope of a local label extends from the asm reserved word to the end of the asm statement that contains it. A local label doesn't have to be declared.


Цитата(Delphi)
The @ operator

The @ operator returns the address of a variable, or of a function, procedure, or method; that is, @ constructs a pointer to its operand. For more information about pointers, see Pointers and pointer types. The following rules apply to @.

If X is a variable, @X returns the address of X. (Special rules apply when X is a procedural variable; see Procedural types in statements and expressions.) The type of @X is Pointer if the default {$T-} compiler directive is in effect. In the {$T+} state, @X is of type ^T, where T is the type of X (This distinction is important for assignment compatibility, see "Assignment-compatibility" on page 5-36).

If F is a routine (a function or procedure), @F returns F's entry point. The type of @F is always Pointer.
When @ is applied to a method defined in a class, the method identifier must be qualified with the class name. For example,

Код
@TMyClass.DoSomething

points to the DoSomething method of TMyClass. For more information about classes and methods, see Classes and objects.

Note 
When using the @ operator, it is not possible to take the address of an interface method as the address is not known at compile time and cannot be extracted at runtime.


Цитата(Delphi)
Procedural types in statements and expressions

When a procedural variable is on the left side of an assignment statement, the compiler expects a procedural value on the right. The assignment makes the variable on the left a pointer to the function or procedure indicated on the right. In other contexts, however, using a procedural variable results in a call to the referenced procedure or function. You can even use a procedural variable to pass parameters:

Код
var
 F: function(X: Integer): Integer;
 I: Integer;
function SomeFunction(X: Integer): Integer;
...
F := SomeFunction;  // assign SomeFunction to F
I := F(4);          // call function; assign result to I

In assignment statements, the type of the variable on the left determines the interpretation of procedure or method pointers on the right. For example,

Код
var
 F, G: function: Integer;
 I: Integer;
function SomeFunction: Integer;
...
F := SomeFunction;  // assign SomeFunction to F
G := F;             // copy F to G
I := G;             // call function; assign result to I

The first statement assigns a procedural value to F. The second statement copies that value to another variable. The third statement makes a call to the referenced function and assigns the result to I. Because I is an integer variable, not a procedural one, the last assignment actually calls the function (which returns an integer).

In some situations it is less clear how a procedural variable should be interpreted. Consider the statement

Код
if F = MyFunction then ...;

In this case, the occurrence of F results in a function call; the compiler calls the function pointed to by F, then calls the function MyFunction, then compares the results. The rule is that whenever a procedural variable occurs within an expression, it represents a call to the referenced procedure or function. In a case where F references a procedure (which doesn't return a value), or where F references a function that requires parameters, the previous statement causes a compilation error. To compare the procedural value of F with MyFunction, use

Код
if @F = @MyFunction then ...;

@F converts F into an untyped pointer variable that contains an address, and @MyFunction returns the address of MyFunction.

To get the memory address of a procedural variable (rather than the address stored in it), use @@. For example, @@F returns the address of F.

The @ operator can also be used to assign an untyped pointer value to a procedural variable. For example,

Код
var StrComp: function(Str1, Str2: PChar): Integer;
...
@StrComp := GetProcAddress(KernelHandle, 'lstrcmpi');

calls the GetProcAddress function and points StrComp to the result.

Any procedural variable can hold the value nil, which means that it points to nothing. But attempting to call a nil-valued procedural variable is an error. To test whether a procedural variable is assigned, use the standard function Assigned:

Код
if Assigned(OnClick) then OnClick(X);


Цитата(Symbols)
Код
Symbol    Value                    Class              Type
@Result   Result variable offset   Memory reference   Size of type

PM MAIL ICQ   Вверх
p0s0l
Дата 26.12.2004, 19:31 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Г-н Посол
****


Профиль
Группа: Экс. модератор
Сообщений: 3668
Регистрация: 13.7.2003
Где: 58°38' с.ш. 4 9°41' в.д.

Репутация: 1
Всего: 112



Подсветка асма и дельфи - это разные вещи, друг на друга не влияют...
@ используется для получения указателя на процедуру, переменную и т.д. в Pascal-коде...
Но тут проблема была в asm-части, где @ используется для меток.
Вместо оператора @ в asm-коде используется оператор offset.
Единственное исключение - @Result...
Но ради этого что-то мудрить - не стоит, т.к. @Result редко используется, да и не больно вид испортится... Зато подсветка меток - это удобно...
...
Хотя если подумать, это может даже и удобнее smile. Ведь по-смыслу @Result - это тоже метка smile, которая автоматически присутствует в функциях. Т.е. можно сделать jmp @Result, call [@Result], mov eax, [@Result] и т.д... Всё пучком короче smile

Цитата(sergej @ 25.12.2004, 19:41)
Если @ не используется в других контекстах, то исправил
Сейчас всё круто! Молодец! smile




Это сообщение отредактировал(а) p0s0l - 26.12.2004, 19:41


--------------------
С уважением, г-н Посол.
PM   Вверх
sergejzr
Дата 29.12.2004, 14:47 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Un salsero
Group Icon


Профиль
Группа: Админ
Сообщений: 13285
Регистрация: 10.2.2004
Где: Германия г .Ганновер

Репутация: 35
Всего: 360



Дорогие друзья подсветки!

Благодаря работам dm9, подсветка ХТМЛ и CSS теперь полностью поддерживается. Огромная ему благодарность!
А также:
В связи с проведёнными оптимизациями кода, он не только сократился по обьёму на 7,5 кБ (теперь 30 кБ) , но и величилась скорость самой подсветки. (Напомним, что подсвечиваются 15 различных языков)
Вот пример:
"старая"
"новая"

На данный момент Cashey и -Mikle- ведут работы над SQL и VB. После их заключения подсветку можно будет обновлять.

Поможем же им в этом деле smile

Cheba, спасибо smile


--------------------
PM WWW IM ICQ Skype GTalk Jabber AOL YIM MSN   Вверх
The MASTER
Дата 28.2.2005, 22:21 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Old master)
**


Профиль
Группа: Участник
Сообщений: 862
Регистрация: 19.7.2004
Где: Санкт-Петербург

Репутация: 1
Всего: 5



Код

ShellExecute(handle, 'open', pchar('regedit'), nil, nil, sw_shownormal);

PM MAIL WWW ICQ   Вверх
Ответ в темуСоздание новой темы Создание опроса
0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей)
0 Пользователей:
« Предыдущая тема | Обсуждение форума | Следующая тема »


 




[ Время генерации скрипта: 0.0622 ]   [ Использовано запросов: 22 ]   [ GZIP включён ]


Реклама на сайте     Информационное спонсорство

 
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности     Powered by Invision Power Board(R) 1.3 © 2003  IPS, Inc.