Utils: (membind) Fix weird casting error when binding base-class members
[senf.git] / Utils / Console / Parse.hh
index 7afbaa1..4303fc2 100644 (file)
     returned as punctuation tokens
     
     <table class="senf">
-    <tr><td>/</td><td>path component separator</td></tr>
-    <tr><td>( )</td><td>argument grouping</td></tr>
-    <tr><td>{ }</td><td>directory grouping</td></tr>
-    <tr><td>;</td><td>command terminator</td></tr>
-    <tr><td>, =</td><td>punctuation tokens</td></tr>
+        <tr><td>#</td><td>Comments are marked with '#' and continue to the end of the line</td></tr>
+        <tr><td>/</td><td>path component separator</td></tr>
+        <tr><td>( )</td><td>argument grouping</td></tr>
+        <tr><td>{ }</td><td>directory grouping</td></tr>
+        <tr><td>;</td><td>command terminator</td></tr>
+        <tr><td>, =</td><td>punctuation tokens</td></tr>
     </table>
 
     \subsection console_basic Basic elements
 namespace senf {
 namespace console {
 
+    namespace detail { class FilePositionWithIndex; }
+
     namespace detail { struct ParserAccess; }
 
     /** \brief Single argument token
@@ -253,7 +256,10 @@ namespace console {
         };
         
         Token();                        ///< Create empty token
-        Token(TokenType type, std::string token); ///< Create token with given type and value
+        Token(TokenType type, std::string token); 
+                                        ///< Create token with given type and value
+        Token(TokenType type, std::string token, detail::FilePositionWithIndex const & pos); 
+                                        ///< Create token with given type and value
 
 
         std::string const & value() const; ///< String value of token
@@ -261,6 +267,10 @@ namespace console {
 
         TokenType type() const;         ///< Token type
 
+        unsigned line() const;          ///< Line number of token in source
+        unsigned column() const;        ///< Column number of token in source
+        unsigned index() const;         ///< Index (char count) of token in source
+
         bool is(unsigned tokens) const; ///< Check, whether tokens type matches \a tokens
                                         /**< \a tokens is a bit-mask of token types to check. */
 
@@ -272,6 +282,9 @@ namespace console {
     private:
         TokenType type_;
         std::string token_;
+        unsigned line_;
+        unsigned column_;
+        unsigned index_;
     };
 
     std::ostream & operator<<(std::ostream & os, Token const & token);