cssparser.h revision 5a08d0e3bae5d6dcf0b2d76da6a707bc8e02826f
#ifndef __CSSPARSER_H__
#define __CSSPARSER_H__
/**
* Phoebe DOM Implementation.
*
* This is a C++ approximation of the W3C DOM model, which follows
* fairly closely the specifications in the various .idl files, copies of
* which are provided for reference. Most important is this one:
*
*
* Authors:
* Bob Jamison
*
* Copyright (C) 2005-2008 Bob Jamison
*
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "dom.h"
#include "css.h"
{
{
{
{
{
/**
*
*/
{}
/**
*
*/
{}
/**
*
*/
/**
*
*/
long parselen;
/**
*
*/
#ifdef G_GNUC_PRINTF
#endif
;
/**
* Get the character at the given location in the buffer.
* Return 0 if out-of-bounds
*/
/**
* Test if the given substring exists at the given position
* in parsebuf. Use get() in case of out-of-bounds
*/
/**
* Skip over whitespace
* Return new position
*/
/**
* Get the word at the current position. Return the new
* position if successful, the current position if no word,
* -1 if error.
*/
/**
* Get a number at the current position
* Return the new position if a proper number, else the original pos
*/
/**
* Assume that we are starting on a quote. Ends on the char
* after the final '"'
*/
/**
* Not in api. replaces URI return by lexer
*/
/**
* Skip to the next rule
*/
//#########################################################################
//# P R O D U C T I O N S
//#########################################################################
/**
* stylesheet
* : [ CHARSET_SYM S* STRING S* ';' ]?
* [S|CDO|CDC]* [ import [S|CDO|CDC]* ]*
* [ [ ruleset | media | page ] [S|CDO|CDC]* ]*
* ;
*/
int getStyleSheet(int p0);
/**
* import
* : IMPORT_SYM S*
* [STRING|URI] S* [ medium [ COMMA S* medium]* ]? ';' S*
* ;
*/
/**
* media
* : MEDIA_SYM S* medium [ COMMA S* medium ]* LBRACE S* ruleset* '}' S*
* ;
*/
/**
* medium
* : IDENT S*
* ;
*/
/**
* page
* : PAGE_SYM S* pseudo_page? S*
* LBRACE S* declaration [ ';' S* declaration ]* '}' S*
* ;
*/
/**
* pseudo_page
* : ':' IDENT
* ;
*/
int getPseudoPage(int p0);
/**
* ruleset
* : selector [ COMMA S* selector ]*
* LBRACE S* declaration [ ';' S* declaration ]* '}' S*
* ;
*/
int getRuleSet(int p0);
/**
* selector
* : simple_selector [ combinator simple_selector ]*
* ;
*/
int getSelector(int p0);
/**
* simple_selector
* : element_name [ HASH | class | attrib | pseudo ]*
* | [ HASH | class | attrib | pseudo ]+
* ;
*/
int getSimpleSelector(int p0);
/**
* declaration
* : property ':' S* expr prio?
* | {empty}
* ;
*/
/**
* prio
* : IMPORTANT_SYM S*
* ;
*/
/**
* expr
* : term [ operator term ]*
* ;
*/
/**
* term
* : unary_operator?
* [ NUMBER S* | PERCENTAGE S* | LENGTH S* | EMS S* | EXS S* | ANGLE S* |
* TIME S* | FREQ S* | function ]
* | STRING S* | IDENT S* | URI S* | hexcolor
* ;
*/
/**
* function
* : FUNCTION S* expr ')' S*
* ;
*/
int getFunction(int p0);
/**
* There is a constraint on the color that it must
* have either 3 or 6 hex-digits (i.e., [0-9a-fA-F])
* after the "#"; e.g., "#000" is OK, but "#abcd" is not.
*
* hexcolor
* : HASH S*
* ;
*/
int getHexColor(int p0);
int lastPosition;
/**
* Get the column and row number of the given character position.
* Also gets the last-occuring newline before the position
*/
};
} // namespace css
} // namespace dom
} // namespace w3c
} // namespace org
#endif /* __CSSPARSER_H__ */
//#########################################################################
//# E N D O F F I L E
//#########################################################################