SmartComments            package:R.utils            R Documentation

_A_b_s_t_r_a_c_t _c_l_a_s_s _S_m_a_r_t_C_o_m_m_e_n_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     Package:  R.utils 
      *Class SmartComments*

     'Object'
      '~~|'
      '~~+--'_'SmartComments'_

     *Directly known subclasses:*
      LComments, VComments

     public abstract static class *SmartComments*
      extends Object

     Abstract class SmartComments.

_U_s_a_g_e:

     SmartComments(letter=NA, ...)

_A_r_g_u_m_e_n_t_s:

  letter: A single 'character'.

     ...: Not used.

_D_e_t_a_i_l_s:

     A "smart" source-code comment is an R comment, which start with a
     '#', but is followed by a single letter, then a single symbol and
     a second '#' and then an option character string, and there must
     not be any code before the comment on the same line. In summary, a
     smart comment line has format: '<white spaces>#<letter><symbol>#
     <some text>'.

     Example code with two smart comments (VComments):


        x <- 2
        #V1# threshold=-1
        #Vc# A v-comment log message
        cat("Hello world")

     which after compilation becomes


        x <- 2
        verbose <- Verbose(threshold=-1)
        if (verbose) { cat(verbose, "A v-comment log message"); }
        cat("Hello world")


_F_i_e_l_d_s _a_n_d _M_e_t_h_o_d_s:

     *Methods:*

         'compile'         Preprocess a vector of code lines.
         'convertComment'  Converts a single smart comment to R code.
         'parse'           Parses one single smart comment.
         'reset'           Resets a SmartComments compiler.
         'validate'        Validates the compiled lines.

     *Methods inherited from Object*:
      $, $<-, [[, [[<-, as.character, attach, attachLocally, clone,
     detach, equals, extend, finalize, getFields, getInstanciationTime,
     getStaticInstance, hasField, hashCode, ll, load, objectSize,
     print, save

_A_u_t_h_o_r(_s):

     Henrik Bengtsson (<URL: http://www.braju.com/R/>)

_S_e_e _A_l_s_o:

     'VComments'.

