Index: uspace/app/sbi/src/lex.c
===================================================================
--- uspace/app/sbi/src/lex.c	(revision 1faa99588d67fde7acd1feca06054788f42aff4e)
+++ uspace/app/sbi/src/lex.c	(revision 1ebc1a62b0e759c001488fc0e221be6347082167)
@@ -145,5 +145,11 @@
 };
 
-/** Print lclass value. */
+/** Print lclass value.
+ *
+ * Prints lclass (lexical element class) value in human-readable form
+ * (for debugging).
+ *
+ * @param lclass	Lclass value for display.
+ */
 void lclass_print(lclass_t lclass)
 {
@@ -184,5 +190,10 @@
 }
 
-/** Print lexical element. */
+/** Print lexical element.
+ *
+ * Prints lexical element in human-readable form (for debugging).
+ *
+ * @param lem		Lexical element for display.
+ */
 void lem_print(lem_t *lem)
 {
@@ -203,5 +214,10 @@
 }
 
-/** Print lem coordinates. */
+/** Print lem coordinates.
+ *
+ * Print the coordinates (line number, column number) of a lexical element.
+ *
+ * @param lem		Lexical element for coordinate printing.
+ */
 void lem_print_coords(lem_t *lem)
 {
@@ -209,5 +225,9 @@
 }
 
-/** Initialize lexer instance. */
+/** Initialize lexer instance.
+ *
+ * @param lex		Lexer object to initialize.
+ * @param input		Input to associate with lexer.
+ */
 void lex_init(lex_t *lex, struct input *input)
 {
@@ -229,5 +249,7 @@
 /** Advance to next lexical element.
  *
- * The new element be read in lazily then it is actually accessed.
+ * The new element is read in lazily then it is actually accessed.
+ *
+ * @param lex		Lexer object.
  */
 void lex_next(lex_t *lex)
@@ -243,4 +265,6 @@
  *
  * The returned pointer is invalidated by next call to lex_next()
+ *
+ * @param lex		Lexer object.
  */
 lem_t *lex_get_current(lex_t *lex)
@@ -250,5 +274,8 @@
 }
 
-/** Read in the current lexical element (unless already read in). */
+/** Read in the current lexical element (unless already read in).
+ *
+ * @param lex		Lexer object.
+ */
 static void lex_touch(lex_t *lex)
 {
@@ -267,5 +294,12 @@
 /** Try reading next lexical element.
  *
- * @return @c b_true on success or @c b_false if it needs restarting.
+ * Attemps to read the next lexical element. In some cases (such as a comment)
+ * this function will need to give it another try and returns @c b_false
+ * in such case.
+ *
+ * @param lex		Lexer object.
+ * @return		@c b_true on success or @c b_false if it needs
+ *			restarting. On success the lem is stored to
+ *			the current lem in @a lex.
  */
 static bool_t lex_read_try(lex_t *lex)
@@ -369,5 +403,11 @@
 }
 
-/** Lex a word (identifier or keyword). */
+/** Lex a word (identifier or keyword).
+ *
+ * Read in a word. This may later turn out to be a keyword or a regular
+ * identifier. It is stored in the current lem in @a lex.
+ *
+ * @param lex		Lexer object.
+ */
 static void lex_word(lex_t *lex)
 {
@@ -409,5 +449,10 @@
 }
 
-/** Lex a numeric literal. */
+/** Lex a numeric literal.
+ *
+ * Reads in a numeric literal and stores it in the current lem in @a lex.
+ *
+ * @param lex		Lexer object.
+ */
 static void lex_number(lex_t *lex)
 {
@@ -429,5 +474,10 @@
 }
 
-/** Lex a string literal. */
+/** Lex a string literal.
+ *
+ * Reads in a string literal and stores it in the current lem in @a lex.
+ *
+ * @param lex		Lexer object.
+ */
 static void lex_string(lex_t *lex)
 {
@@ -461,5 +511,10 @@
 }
 
-/** Lex a single-line comment. */
+/** Lex a single-line comment.
+ *
+ * This does not produce any lem. The comment is just skipped.
+ *
+ * @param lex		Lexer object.
+ */
 static void lex_skip_comment(lex_t *lex)
 {
@@ -475,5 +530,10 @@
 }
 
-/** Skip whitespace characters. */
+/** Skip whitespace characters.
+ *
+ * This does not produce any lem. The whitespace is just skipped.
+ *
+ * @param lex		Lexer object.
+ */
 static void lex_skip_ws(lex_t *lex)
 {
@@ -485,6 +545,8 @@
 	while (b_true) {
 		while (*bp == ' ' || *bp == '\t') {
-			if (*bp == '\t')
+			if (*bp == '\t') {
+				/* XXX This is too simplifed. */
 				lex->col_adj += (TAB_WIDTH - 1);
+			}
 			++bp;
 		}
@@ -507,5 +569,9 @@
 }
 
-/** Determine if character can start a word. */
+/** Determine if character can start a word.
+ *
+ * @param c 	Character.
+ * @return	@c b_true if @a c can start a word, @c b_false otherwise.
+ */
 static bool_t is_wstart(char c)
 {
@@ -514,5 +580,10 @@
 }
 
-/** Determine if character can continue a word. */
+/** Determine if character can continue a word.
+ *
+ * @param c 	Character.
+ * @return	@c b_true if @a c can start continue word, @c b_false
+ *		otherwise.
+ */
 static bool_t is_wcont(char c)
 {
@@ -520,4 +591,9 @@
 }
 
+/** Determine if character is a numeric digit.
+ *
+ * @param c 	Character.
+ * @return	@c b_true if @a c is a numeric digit, @c b_false otherwise.
+ */
 static bool_t is_digit(char c)
 {
@@ -525,4 +601,9 @@
 }
 
+/** Determine numeric value of digit character.
+ *
+ * @param c 	Character, must be a valid decimal digit.
+ * @return	Value of the digit (0-9).
+ */
 static int digit_value(char c)
 {
