Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
лекции 2005 / P8 / CSS учебник.doc
Скачиваний:
19
Добавлен:
16.04.2013
Размер:
468.99 Кб
Скачать

Ident {nmstrt}{nmchar}*

name {nmchar}+

d [0-9]

notnm [^-a-z0-9\\]|{latin1}

w [ \t\n]*

num {d}+|{d}*\.{d}+

string \"({stringchar}|\')*\"|\'({stringchar}|\")*\'

%x COMMENT

%s AFTER_IDENT

%%

"/*" {BEGIN(COMMENT);}

<COMMENT>"*/" {BEGIN(0);}

<COMMENT>\n {/* ignore */}

<COMMENT>. {/* ignore */}

@import {BEGIN(0); return IMPORT_SYM;}

"!"{w}important {BEGIN(0); return IMPORTANT_SYM;}

{ident} {BEGIN(AFTER_IDENT); return IDENT;}

{string} {BEGIN(0); return STRING;}

{num} {BEGIN(0); return NUMBER;}

{num}"%" {BEGIN(0); return PERCENTAGE;}

{num}pt/{notnm} {BEGIN(0); return LENGTH;}

{num}mm/{notnm} {BEGIN(0); return LENGTH;}

{num}cm/{notnm} {BEGIN(0); return LENGTH;}

{num}pc/{notnm} {BEGIN(0); return LENGTH;}

{num}in/{notnm} {BEGIN(0); return LENGTH;}

{num}px/{notnm} {BEGIN(0); return LENGTH;}

{num}em/{notnm} {BEGIN(0); return EMS;}

{num}ex/{notnm} {BEGIN(0); return EXS;}

<AFTER_IDENT>":"link {return LINK_PSCLASS_AFTER_IDENT;}

<AFTER_IDENT>":"visited {return VISITED_PSCLASS_AFTER_IDENT;}

<AFTER_IDENT>":"active {return ACTIVE_PSCLASS_AFTER_IDENT;}

<AFTER_IDENT>":"first-line {return FIRST_LINE_AFTER_IDENT;}

<AFTER_IDENT>":"first-letter {return FIRST_LETTER_AFTER_IDENT;}

<AFTER_IDENT>"#"{name} {return HASH_AFTER_IDENT;}

<AFTER_IDENT>"."{name} {return CLASS_AFTER_IDENT;}

":"link {BEGIN(AFTER_IDENT); return LINK_PSCLASS;}

":"visited {BEGIN(AFTER_IDENT); return VISITED_PSCLASS;}

":"active {BEGIN(AFTER_IDENT); return ACTIVE_PSCLASS;}

":"first-line {BEGIN(AFTER_IDENT); return FIRST_LINE;}

":"first-letter {BEGIN(AFTER_IDENT); return FIRST_LETTER;}

"#"{name} {BEGIN(AFTER_IDENT); return HASH;}

"."{name} {BEGIN(AFTER_IDENT); return CLASS;}

url\({w}{string}{w}\) |

url\({w}([^ \n\'\")]|\\\ |\\\'|\\\"|\\\))+{w}\) {BEGIN(0); return URL;}

rgb\({w}{num}%?{w}\,{w}{num}%?{w}\,{w}{num}%?{w}\) {BEGIN(0); return RGB;}

[-/+{};,#:] {BEGIN(0); return *yytext;}

[ \t]+ {BEGIN(0); /* ignore whitespace */}

\n {BEGIN(0); /* ignore whitespace */}

\<\!\-\- {BEGIN(0); return CDO;}

\-\-\> {BEGIN(0); return CDC;}

. {fprintf(stderr, "%d: Illegal character (%d)\n",

lineno, *yytext);}

Appendix c: Encoding

(This appendix is informative, not normative)

HTML documents may contain any of the about 30,000 different characters defined by Unicode. Many documents only need a few hundred. Many fonts also only contain just a few hundred glyphs. In combination with section 5.2, this appendix explains how the characters in the document and the glyphs in a font are matched.

Тут вы можете оставить комментарий к выбранному абзацу или сообщить об ошибке.

Оставленные комментарии видны всем.