#include "roast/lexical.hpp"
+//bracket
+
namespace roast
{
namespace css
using namespace ::roast::lexical;
using namespace ::roast::lexical::rule;
using namespace ::roast::lexical::rule::chars;
-
- typedef seq<
- unichar<'/'>,
- unichar<'*'>,
+
+ typedef unichar< '{' > left_brace, lbrace;
+ typedef unichar< '}' > right_brace, rbrace;
+
+ //////////////////////////////////////////////////
+
+ // comment_str
+ typedef get_string comment_str;
+
+ // comment
+ template <typename _CommentStr=comment_str>
+ struct comment : seq<
+ slash,aster,
+
+ _CommentStr,
- unichar<'*'>,
- unichar<'/'>
- > comment;
+ aster,slash
+ > {};
+
+ // block ({ ... })
+ template <typename _BlockInner=block_inner>
+ struct block : seq<
+ lbrace,
+
+ _BlockInner,
+
+ rbrace
+ > {};
+
+ // property
+ typedef get_string property;
+
+ // declaration (xxx:aaa)
+ template <typename _PropertyName=property, typename _Value=value>
+ struct declaration : seq< _PropertyName, colon, _Value >
+
+ // selector
+ typedef get_string selector;
+
+ // ruleset (xxx{ ... })
+ template <typename _BlockInner>
+ struct ruleset : seq<selector, block<_BlockInner> >{};
- typedef rule;
+ // total rule
+ typedef optional_repeat<ruleset> rule;
}
}
}