/*\v1 \centerline{\huge\bf File testfile.l} \section{Block comment examples} */ /*\b <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<***********************>>>>>>>>>>>>>>>>>>>>>>>> <* filenamex : testfile.l *> <* purpose : this is a little lex file as an example for a simple *> <* iiiiiiiii : converter using the position macros. Only a few *> <* mmmmmmmmm : basic conversions are implemented; all fonts etc. are *> <* : hard-coded. You may use this file as example for use *> <* : of the position macros or as starting point for an own *> <* : converter project. *> <<<<<<<<<<<<<<<<<<<<<<<<<<<<***********************>>>>>>>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> */ /**************************************************************************\b * filename : testfile.l (using the block comment mode) * * purpose : this is a little lex file as an example for a simple * * jjjjjjjjjj : converter using the position macros. Only a few basic iii * * aaaaaaaaaa : conversions are implemented; all fonts etc are hardcoded. * * xxxxxxxxxx : You may use this file as example for use of the position_ * * iiiiiiiiii : or as starting point for an own converter project. * * vvvvvvvvvv : Note: vertical alignment of the colon depends here not on * * uuuuuuuuuu : the number of blanks before the colon; also the star at__ * * mmmmmmmmmm : line end is aligned even with a single blank. * **************************************************************************/ /************************************************************************** * filename : testfile.l (using the normal comment mode) * * purpose : this is a test for the normal comment mode. * * vvvvvvvvvv : Note: vertical alignment of the colon in this example de- * * uuuuuuuuuu : pends on the number of blanks before the colon; also the_ * * mmmmmmmmmm : star at line end is not aligned with a single blank. * **************************************************************************/ /*\v1 \section{Handling of overlong Lines:} \subsection{Preprocessor Statements} */ #define DUMMY1 stmt_without_blanks();stmt();stmt();stmt();stmt();stmt();stmt();stmt();stmt();stmt();stmt();stmt();stmt();stmt();stmt();stmt();stmt();stmt();stmt();stmt();stmt();stmt();stmt();stmt();stmt();stmt();stmt();stmt();stmt();stmt(); #define DUMMY2 stmt_with_blanks(); stmt(); stmt(); stmt(); stmt(); stmt(); stmt(); stmt(); stmt(); stmt(); stmt(); stmt(); stmt(); stmt(); stmt(); stmt(); stmt(); stmt(); stmt(); stmt(); stmt(); stmt(); stmt(); stmt(); stmt(); /*\v1 \subsection{General Statements} */ dummy_statement(); dummy_statement(); dummy_statement(); dummy_statement(); dummy_statement(); dummy_statement(); dummy_statement(); dummy_statement(); dummy_statement(); dummy_statement(); dummy_statement(); dummy_statement(); dummy_statement(); dummy_statement(); this_is(not(fine));because(we/you(also?grrrrrrr:better_for_us));didnt(include);any_spaces(into(this_line)/but(it));seems_to_be(no(problem));this_is(notatall(fine));because(we/you(also));didnt(include)||insert_any_spaces(into(this_line)/but(it));seems_to_be(no(problem)); /*\v1 \subsection{Strings} */ "this is a very long string this is a very long string this is a very long string this is a very long string this is a very long string this is a very long string this is a very long string this is a very long string this is a very long string" "this is a very long string this is a very long string this is a very long string this is a very long string this is a very long string this is a very long string this is a very long string\ this is a very long string this is a very long string this is a very long string this is a very long string this is a very long string this is a very long string this is a very long string\ this is a very long string this is a very long string this is a very long string this is a very long string this is a very long string this is a very long string this is a very long string\ this is a very long string this is a very long string this is a very long string this is a very long string this is a very long string this is a very long string this is a very long string" "another_string_with_\n_another_string_with_\n_another_string_with_\n_another_string_with_\n_another_string_with_\n_another_string_with_\n_another_string_with_\n_another_string_with_\n_another_string_with_\n" /*\v1 \subsection{Comments} */ /*this is a very long comment this is a very long comment this is a very long comment this is a very long comment this is a very long comment this is a very long comment this is a very long comment this is a very long comment */ MMMMMMMMM(); /* NOTE: This comment start at the same ASCII position as the last one; but the LaTeX position is shifted right because the MMMMMMMM characters need a lot of space. The continuation lines are aligned to the comment start in both cases. */ stmt(); /* Again the same ASCII position this is a very long comment this is a very long comment this is a very long comment this is a very long comment this is a very long comment this is a very long comment this is a very long comment */ for(ptr=buffer;*ptr++;)stmt(ptr,var); // this is a very long comment this is a very long comment this is a very long comment this is a very long comment this is a very long comment this is a very long comment this is a very long comment for(ptr=buffer;*ptr++;)stmt(ptr,var); /* this comment starts at ASCII position > 50; the indentation of continuation lines is taken from the code instead of the comment start */ stmt(); /* 1 This is a test for line breaking in a long multi-line comment. We need some more text so here is some more nonsense. We need some more text so here is some more nonsense. We need some more text so here is some more nonsense. * 2 This is a test for line breaking in a long multi-line comment. We need some more text so here is some more nonsense. We need some more text so here is some more nonsense. We need some more text so here is some more nonsense. * 3 This is a test for line breaking in a long multi-line comment. We need some more text so here is some more nonsense. We need some more text so here is some more nonsense. We need some more text so here is some more nonsense. * 4 This is a test for line breaking in a long multi-line comment. We need some more text so here is some more nonsense. We need some more text so here is some more nonsense. We need some more text so here is some more nonsense. */ stmt(); /* 1 This is a test for line breaking in a long multi-line comment. We need some more text so here is some more nonsense. We need some more text so here is some more nonsense. We need some more text so here is some more nonsense. * 2 This is a test for line breaking in a long multi-line comment. We need some more text so here is some more nonsense. We need some more text so here is some more nonsense. We need some more text so here is some more nonsense. * 3 This is a test for line breaking in a long multi-line comment. We need some more text so here is some more nonsense. We need some more text so here is some more nonsense. We need some more text so here is some more nonsense. * 4 This is a test for line breaking in a long multi-line comment. We need some more text so here is some more nonsense. We need some more text so here is some more nonsense. We need some more text so here is some more nonsense. */ MMMMMMM(); /* 1 This is a test for line breaking in a long multi-line comment. We need some more text so here is some more nonsense. We need some more text so here is some more nonsense. We need some more text so here is some more nonsense. * 2 This is a test for line breaking in a long multi-line comment. We need some more text so here is some more nonsense. We need some more text so here is some more nonsense. We need some more text so here is some more nonsense. * 3 This is a test for line breaking in a long multi-line comment. We need some more text so here is some more nonsense. We need some more text so here is some more nonsense. We need some more text so here is some more nonsense. * 4 This is a test for line breaking in a long multi-line comment. We need some more text so here is some more nonsense. We need some more text so here is some more nonsense. We need some more text so here is some more nonsense. *5 This is a test for line breaking in a long multi-line comment. We need some more text so here is some more nonsense. We need some more text so here is some more nonsense. We need some more text so here is some more nonsense. */ stmt(); /*\f this is a special form of comment (fill comment): * for the continuation lines of the source text * the newline characters and the leading blanks and * * are replaced by a single blank; so linebreaking is done * by the TeX macros. @ * To force a linebreak, put a blank and a single @ character * to the end of the line, as above. * @ * To insert a blank line into the output, you may use the syntax as in the * last source line (only a @ character after the star). * If you insert just a blank line, this is preserved too; * the indentation does not change (as in this example). * * Finally you could use this form, with only a star in the comment. * The star is left in the output, as it should be. ;-))) */ MMMM(); /*\f This comment starts at the same ASCII position as the comment * above; but the MMMM() characters need much more place in the output. * The new indentation is preserved for all special cases again: * * This is a special form of comment (fill comment): * for the continuation lines of the source text * the newline characters and the leading blanks and * * are replaced by a single blank; so linebreaking is done * by the TeX macros. @ * To force a linebreak, put a blank and a single @ character * to the end of the line, as above. * @ * To insert a blank line into the output, you may use the syntax as in the * last source line (only a @ character after the star). * If you insert just a blank line, this is preserved too; * the indentation does not change (as in this example). * * Finally you could use this form, with only a star in the comment. * The star is left in the output, as it should be. ;-))) */ iiii(); /*\f This is again another form of the fill comment; the leading stars are omitted in the input; but they are written in the output. @ Line breaking works just as in the standard form of fill comments (with stars). Blank lines work as in the standard form, as you can see here. */ stmt(); //\f This is a little example/demo for a fill comment // for the C++/Java language (we need some more text here // to get the line full). @ // The syntax is just the same as in C comments, only // the comment start uses //\f instead of the C comment start. // To get an "empty" line insert a commented out line // or a line containing just a @ after the comment characters. // The comment characters are written in this case; a completely // empty line requires a new fill comment start. // // Blank lines are not allowed in this form of comment; if you insert // a blank line, the fill comment is ended (as after this line). // Here is again a normal C++ comment. The indentation changed slightly because the previous comment position was forced by the stmt() (there is only one blank after the statement). We need again some more text to show that normal linebreaking is in effect. // Here begins a new comment line; the fill comment was terminated by the empty line. stmt(); /* iiiiiiiiiiiiii this is just a reference to show the effect of the \jmpo and \xnjo macro */ MMMMMMM(); /* iiiiiiiiiiii this is just a reference to show the effect of the \jmpo and \xnjo macro */ stmt(); /*\f iiiiiiiiiiii this is a fill comment again: the blanks are replaced by fix space, (\xnjo macro) * instead of using the \jmpo macro to jump to a specific position, as is done in the normal * comments above */ /*\v1 \section{Deklarations} */ i = 3; j = 4; veryvery_long_var = 5; /* with Tab: the = character is aligned with the others */ veryvery_long_var = 5; /* with Blank: no alignment, because only one blank before the = */ /*\v1 \section{Embedded \LaTeX{} comments} */ dummy_statement(); /*\a $ \sum_{n=0}^N g_n(x) = \int_a^b f(x) \,\mbox{d}x = \int\limits_a^b f(x) \,\mbox{d}x = \oint_c^d F(z) \,\mbox{d}z $ */ dummy_statement(); /*\v1 this is a \emph{verbatim}-comment; it appears \textbf{without} comment characters! */ xxx(); //\a Again an {\em embedded} \LaTeX\ comment, using C++ comment: $\sum_{n=0}^N g_n(x) = \oint_c^d F(z) \,\mbox{d}z$ /*\v1 \section{LEX Rules} */ [#$%{}_&] fprintf(yyout,"\\%c",*yytext); LEN(2); /* | */ \\ fprintf(yyout,"$\\backslash$"); LEN(12); /* | */ \^ fprintf(yyout,"$\\hat{~}$"); LEN(9); /* | */ [<>] fprintf(yyout,"$%c$",*yytext); LEN(3); /* | */ \<{2,9} fprintf(yyout,"\\mlt{%d}",yyleng); LEN(7); /* | */ \>{2,9} fprintf(yyout,"\\mgt{%d}",yyleng); LEN(7); /* | */ \\{2,} fprintf(yyout,"\\bs{%d}",yyleng); LEN(6); /* | */ /*\v1 \section{Omitting Code} */ /*\o+*/ these+lines+ will+be+omitted- from^output(); /*\o-*/ /*\o1*/ these+lines+ will+be+omitted- from^output(); /*\o2q*/ these+lines+ will+be+omitted- from^output(); /*\o3*/ some_code(); some_code(); /* Note: * Comments are recognized * even if they begin in the * omitted text! */ /*\o3q*/ some_code(); some_code(); /* Note: * Comments are recognized * even if they begin in the * omitted text! */ /* NOTE: The following omit statement has no '\o-'; it ends at end of the file. */ /*\o+*/ some_code(); some_code(); /* Note: * Comments are recognized * even if they begin in the * omitted text! */