TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: ALL
from: JARI LAAKSONEN
date: 1997-03-28 21:57:00
subject: 02/11 Comment utilities for Java

========== CSplit: Version 2.0 ==========
========== CSplit: Begin part 2/11 ==========
                    // Print the previous newline.
                    print ('\n');
                    nl = false;
                }
                break;
            }
            break;
        case CPState.StarInCComment:
            switch (theEvent)
            {
            case CPEvent.FOUND_SLASH:       // End of C comment.
                checkHtmlChar();
                rc = false;
                print ("");
                slashPrinted = false;       // clear flag.
                break;
            }
            break;
        case CPState.StarInCppComment:
            if (theEvent == CPEvent.FOUND_NL)
            {
                slashPrinted = false;       // clear flag.
            }
            break;
        case CPState.InCppComment:
            if (theEvent == CPEvent.FOUND_NL)
            {
                print ("");
                slashPrinted = false;       // clear flag.
            }
            break;
        }
        if (rc)
            checkHtmlChar();
    }
}
public class C2Html
{
    static final String STR_VERSION = "1.0";
    public static void main (String args[])
    {
        C2HtmlConverter obj = new C2HtmlConverter();
        int argc = args.length;
        if (! obj.init (argc, args))
        {
            System.err.println ("USAGE: C2Html InFile [OutFile]");
        }
        else
        {
            String str;
            str =
            "\n" +
            "\n" +
            "Source file: " + args[0] + " \n" +
            "\n";
            obj.print (str);
            obj.run();
            obj.print (
                "\n" +
                "\n"
            );
            obj.unInit();
        }
    }
}
========== CSplit: End file C2Html.java ==========
========== CSplit: Begin file CommentParser.java ==========
/**
 * CommentParser.java
 *
 * ver. 1.0, 22 Mar 1997
 *
 * Public domain by:
 *   Jari Laaksonen
 *   Arkkitehdinkatu 30 A 2
 *   FIN-33720 Tampere
 *   FINLAND
 *
 *   Fidonet : 2:221/360.20
 *   Internet: jla@to.icl.fi
 */
import java.io.*;
/**
 *  class CPState contains State constants and toString method
 *  that can be used for logging purposes.
 */
class CPState
{
    /**
     * State constants.
     */
    static final int NormalInput        = 0;
    static final int InsideString       = 1;
    static final int InsideChar         = 2;
    static final int BeginComment       = 3;
    static final int InsideEscape       = 4;
    static final int InCppComment       = 5;
    static final int InCComment         = 6;
    static final int StarInCppComment   = 7;
    static final int StarInCComment     = 8;
    private int itsValue = NormalInput;
    //==================================================================
    /**
     *
     */
    public CPState (int v)
    {
        itsValue = v;
    }
    //==================================================================
    /**
     *
     */
    public String toString()
    {
        String str;
        switch (itsValue)
        {
        case NormalInput:       str = "NormalInput";          break;
        case InsideString:      str = "InsideString";         break;
        case InsideChar:        str = "InsideChar";           break;
        case BeginComment:      str = "BeginComment";         break;
        case InsideEscape:      str = "InsideEscape";         break;
        case InCppComment:      str = "InCppComment";         break;
        case InCComment:        str = "InCComment";           break;
        case StarInCppComment:  str = "StarInCppComment";     break;
========== CSplit: End part 2/11 crc: 7dba ==========
        // Albert                      email: jla@to.icl.fi
--- GoldED/2 2.50+
---------------
* Origin: Albert's Point/2 in Finland, Europe (2:221/360.20)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.