0% found this document useful (0 votes)
15K views124 pages

Report

The project HTML DEBUGGER has been carried out by the student of 8th semester Charu with the help of other team members Gurpreet and Sheetal under the guidance of Computer Department. The report covers all the aspects of the work done (including H / W and S / W, Coding etc.) the project is complete in all respects. It shall be possible for the next batch of the students to take up further work after consulting it.

Uploaded by

hitesh miglani
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15K views124 pages

Report

The project HTML DEBUGGER has been carried out by the student of 8th semester Charu with the help of other team members Gurpreet and Sheetal under the guidance of Computer Department. The report covers all the aspects of the work done (including H / W and S / W, Coding etc.) the project is complete in all respects. It shall be possible for the next batch of the students to take up further work after consulting it.

Uploaded by

hitesh miglani
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 124

HTML DEBUGGER

Submitted in partial fulfillment of the requirements


for the award of the degree of

BACHELOR OF ENGINEERING
IN
COMPUTER SCIENCE ENGINEERING

Supervisor :- Submitted to:-


Ms. Kiran Mr. Pankaj Gupta
Lecturer Assistant Professor &
Computer Science Head Of Department,
Engineering Computer Science
Engineering

Submitted by :-
Charu : 114/CS/05 (CS3)
Gurpreet : 120/CS/05 (CS3)
Sheetal : 149/CS/05 (CS3)

Vaish College Of Engineering, Rohtak


Maharishi Dayanand University, Rohtak
May 2009
ACKNOWLEDEMENT

Preservation, inspiration and motivation have always played a key role in the success of

any venture. In the present world of cut throat competition project is likely a bridge

between theoretical and practical working, willingly we have prepared this particular

project.

First of all we would like to thank the supreme power, the almighty God who is obviously

the one who has always directed us to work on the right path of our life. With his grace

this project could become a reality.

Any accomplishment requires the effort of many people and this work is not different.

We wish to acknowledge our gratitude to Ms. Kiran, Lecturer, Computer Science

Engineering for her valuable guidance, full cooperation and expert advice to complete

our project. Then, we would like to extend our sincere thanks to Mr. Pankaj Gupta,

Assistant Professor & Head of Department, Computer Science Engineering for his

regular counseling, keen interest and constant encouragement.

We sincerely thank to all the faculty members and the staff associated for their support

given to us time to time. Also, we would like to thank to all our friends and family

members for their support given to us time to time.

(CHARU, 114/CS/05, [email protected])

(GURPREET, 120/CS/05, [email protected])

(SHEETAL, 149/CS/05, [email protected])


CERTIFICATE

It is to certify that the project HTML DEBUGGER has been carried out by the student of

8th semester Charu with the help of other team members Gurpreet and Sheetal under the

guidance of Computer Department. The report covers all the aspects of the work done

(including H/W & S/W, Coding etc.).

The project is complete in all respects. It shall be possible for the next batch of the

students to take up further work after consulting it.

(Signature)/Date
(Ms. Kiran)
(Computer Department)
CERTIFICATE

It is to certify that the project HTML DEBUGGER has been carried out by the student of

8th semester Charu with the help of other team members Gurpreet and Sheetal under the

guidance of Computer Department. The report covers all the aspects of the work done

(including H/W & S/W, Coding etc.).

The project is complete in all respects. It shall be possible for the next batch of the

Students to take up further work after consulting it.

(Signature)/Date
(Mr. Pankaj Gupta)
(Head of Computer
Department)
TABLE OF CONTENTS

Page No.

1. ABSTRACT 1–2

2. INTRODUCTION/ BACKGROUND 3–5

3. NEED ANALYSIS 6 – 10

4. OBJECTIVES/ METHODOLOGIES/ SPECIFICATIONS 11 – 18

5. DETAILS

A) SOFTWARE USED 19 – 24

B) FLOWCHART OF HTML DEBUGGER 25 – 27

C) MODULES/ INTERFACES 28 – 35

D) CODING 36 – 88

E) ACCEPTANCE TESTING 89 – 95

F) OUTPUTS 96 – 112

6. LIMITATIONS 113

7. FALL OUTS OF THE PROJECT 114

8. SUGGESTIONS FOR FUTURE WORK 115

9. CONCLUSIONS 116

10. REFERENCES 117

11. GLOSSARY 118


CHAPTER 1: ABSTRACT

HTML DEBUGGER mainly include three functions:-

A) EDITING
B) COMPILING/ DEBUGGING
C) EXECUTING

A) EDITING:-
Editing is the process of preparing language, images, sound,
video, or film through correction, condensation, organization, and
other modifications in various media. A person who edits is
called an editor. In a sense, the editing process originates with
the idea for the work itself and continues in the relationship
between the author and the editor. Editing is, therefore, also a
practice that includes creative skills, human relations, and a precise
set of method. There are various levels of editorial positions in
publishing.

B) COMPILING:-

A compiler is a computer program (or set of programs)that


transform source code written in a computer language (the source
language)into another computer language (the target language, often
having a binary form known as object code). The most common
reason for wanting to transform source code is to create an
executable program. The name "compiler" is primarily used for
programs that translate source code from a high-level programming
language to a lower level language (e.g., assembly language or
machine code).

C) EXECUTING:-
Execution in computer and software engineering is the process by
which a computer or a virtual machine carries out the instructions
of a computer program. The instructions in the program trigger
sequences of simple actions on the executing machine. Those
actions produce effects according to the semantics of the
instructions in the program. The term run is used almost
synonymously. The context in which execution takes place is crucial.
Very few programs are executed on a bare machine. Programs usually
contain implicit and explicit assumptions about resources available
at the time of execution. Most programs are executed with the
support of an operating system and run-time libraries specific to the
source language that provide crucial services not supplied directly
by the computer itself . This supportive environment, for instance,
usually decouples a program from direct manipulation of the
computer peripherals, providing more general, abstract services instead.
CHAPTER 2 : INTRODUCTION

Web developers locate and eliminate website errors analyzing http


headers, query strings, cookies, redirections, authorization headers,
POST parameters and error codes. For each web page analyze the
number of produced http requests and responses, its size, downloading
time and speed.

Software developers analyze all http requests sent by own programs


(C#, Java, VB, C++, Delphi, etc) and server responses. Analyze each
http request and response produced by a web browser add-on, ActiveX
component or Java applet.

System and network administrators analyze all outgoing http


requests from your computers. Analyze each http request/response
header and content data to see what information is sent by programs to
the Internet.

HTML Debugger Pro Key Features :-

 Full support of both 32-Bit and 64-Bit applications.


 Decoding of HTTPS/SSL connections and gzip/chunked
content.
 Support of Dial-up modem, DSL/ISDN/Cable/LAN
connections.
 Support of Internet Explorer, Mozilla Firefox, Opera and
Google Chrome.
DEBUGGER :-

A debugger is a computer program that is used to test and debug other


programs. The code to be examined might alternatively be running on
an instruction set simulator (ISS), a technique that allows great power
in its ability to halt when specific conditions are encountered but which
will typically be much slower than executing the code directly on the
appropriate processor.

When the program crashes, the debugger shows the position in the
original code if it is a source-level debugger or symbolic debugger,
commonly seen in integrates development environments. If it is a low-
level debugger or a machine-language debugger it shows the line in
the disassembly. (A "crash" happens when the program cannot continue
because of a programming bug. For example, perhaps the program tried
to use an instruction not available on the current version of the CPU or
attempted access to unavailable or protected memory.)

Typically, debuggers also offer more sophisticated functions such as


running a program step by step (single-stepping), stopping (breaking)
(pausing the program to examine the current state) at some kind of
event by means of breakpoint, and tracking the values of some
variables. Some debuggers have the ability to modify the state of the
program while it is running, rather than merely to observe it.

The importance of a good debugger cannot be overstated. Indeed, the


existence and quality of such a tool for a given language and platform
can often be the deciding factor in its use, even if another
language/platform is better-suited to the task. However, it is also
important to note that software can (and often does) behave differently
running under a debugger than normally, due to the inevitable changes
the presence of a debugger will make to a software program's internal
timing. As a result, even with a good debugging tool, it is often very
difficult to track down runtime problems in complex multi-threaded or
distributed systems.

The same functionality which makes a debugger useful for eliminating

bugs allows it to be used as a software cracking tool to evade copy

protection, digital rights management, and other software protection

features.

Most mainstream debugging engines, such as gdb and dbx provide

console-based command line interfaces. Debugger front-ends are

popular extensions to debugger engines that provide IDE integration,

animation, and visualization features.

Hardware support for debugging :-

Most modern microprocessors have at least one of these features in their


CPU design to make debugging easier:

• Hardware support for single-stepping a program, such as the trap flag.


• An instruction set that meets the Popek and Goldberg virtualization
requirements makes it easier to write debugger software that runs on the
same CPU as the software being debugged; such a CPU can execute the
inner loops of the program under test at full speed, and still remain
under the control of the debugger.
• In-System Programming allows an external hardware debugger to re-
program a system under test (for example, adding or removing
instruction breakpoints)
• Hardware support for data breakpoints, such as page fault hardware
CHAPTER 3: NEED ANALYSIS

Web masters and developers gather around for the greatest collection of Free
java scripts, PHP scripts, CGI scripts, and VB script - all in one location.

 HTML is scripting language. The W3C HTML standard includes support


for client-side scripting.
 Even if there are errors in the HTML code , without compiling it shows
output in the web browser.
 This is the disadvantage in this HTML so, there is need for a debugger
to compile all errors and show correct web page.

We Develop editors in our PROJECT by taking idea from following EDITORS:

EDITPLUS
EditPlus is a text editor, HTML editor and programmer’s editor for
Windows. While it can serve as a good Notepad replacement, it also
offers many powerful features for Web page authors and programmers.
EditPlus is a 32-bit text editor for the Microsoft Windows operating
system, developed by Sangil Kim of ES-Computing. The editor
contains tools for programmers, including syntax highlighting (and
support for custom syntax files), file type conversions, line ending
conversion (between Linux, Windows and Mac styles), regular
expressions for search-and-replace, keystroke recording, full support
for Unicode editing, customizable keyboard shortcuts, auto-completion,
code folding, and more. Files can be browsed and edited in tabs, and an
internal file browser is implemented in the software.
The FRONTPAGE Editor

The Microsoft FrontPage Editor is a tool for creating, designing, and


editing World Wide Web pages. As you add text, images, tables, form
fields, and other elements to your page, the FrontPage Editor displays
them as they would appear in a Web browser.You do not need to learn
HTML to use the FrontPage Editor because it creates all the HTML
code for you.

The FrontPage Editor generates all the popular HTML tags, including
extensions such as cascading style sheets, frames, and ActiveX Controls

If you want to edit the HTML code directly, you can use the FrontPage
Editor’s HTML view. In this view, you can enter text, edit HTML tags,
and use standard word-processing commands such as cutting, pasting,
and find and replace. Although it is a powerful tool, the FrontPage
Editor is easy to use because of its familiar, word-processor interface.

Here are some of the key features of the FrontPage Editor:

• You can create new HTML pages based on page wizards and templates.
The FrontPage Editor offers many choices of page formats, and you can
create your own templates.
• You can apply one of the many FrontPage themes, created by
professional designers, to give your pages a dynamic, colorful
appearance. You can also add and design borders for your pages and
insert navigation bars, which guide your users around your Web site.
• You can open any HTML file in the FrontPage Editor and all the HTML
tags on the page are preserved. You can also open files of many popular
types, and the FrontPage Editor converts them to HTML. Some of the
file types you can open are Microsoft Word 2.0 and 6.0, Microsoft
Word 6.0 for MS-DOS, Microsoft Word 95 and 97, Microsoft Excel 4.0
and 5.0, Microsoft Excel 95 and 97 WordPerfect 6.x.
• You can insert text in all HTML styles, create multilevel lists, change
text size and color, and apply formatting such as centring a heading or
making text italic. Using cascading style sheet support, you can control
margins, line spacing, colors, fonts faces and sizes.
• You can create forms containing text fields, check boxes, radio buttons,
drop-down lists, and push buttons. When you create a form, the default
FrontPage form handler automatically saves form information to a file
or sends it to an e-mail address. You can select from a set of FrontPage
form handlers or add you own custom form handler to a form.
• Using the FrontPage table-editing commands, you can create a table,
insert rows and columns, align them, and create background colors,
using a point-and-click interface.
• You can create new frames pages, edit the appearance of your frames,
and assign initial pages to each frame, all using a point-and click
interface. FrontPage displays your frames pages in WYSIWYG style
and generates the HTML.
EXCEL SHEET OF HTML TAGS

NAME OF ATTRIBUTES
TAG TYPE 1 2 3 4 5 6 7 8
Html close
Head close
Title close
Left Right
Body close Bgcolor text Background link vlink alink Margin Margin
Font close Size Face color
Basefont close Size Face color
B close
I close
U close
P close align
HR close align width size shade
Br open
LI open
OL close start type
UL close type
DL close
DT open
DD open
center close
Cell Cell
Table close align Bgcolor Border Height width padding spacing
TR close align valign Bgcolor
TH close align valign Bgcolor
TD close
A close href name title Alt
img open src align border height width alt
H1 close
H2 close
H3 close
H4 close
H5 close
H6 close
EM close
HR open align noshade size width
comment open
small close
big close
STRIKE close
TT close
SB close
ST close
Address close
Strong close
Menu close
DIR close
Caption close
Base open HREF
Link open HREF REL REV
Pre close
Cite close

CHAPTER 4: OBJECTIVES
There are three main objectives:-

EDITING:-

Editing is the process of preparing language, images, sound,


video, or film through correction, condensation, organization, and
other modifications in various media. A person who edits is
called an editor. In a sense, the editing process originates with
the idea for the work itself and continues in the relationship
between the author and the editor. Editing is, therefore, also a
practice that includes creative skills, human relations, and a precise
set of method. There are various levels of editorial positions in
publishing. Typically, one finds junior editorial assistants reporting
to the senior-level editorial staff and directors who report to senior
executive editors. Senior executive editors are responsible for
developing a product to its final release. The smaller the
publication, the more these roles run together. In particular, the
substantive editor and copy editor often overlap: fact-checking and
rewriting can be the responsibility of either’s.
The top editor sometimes has the title executive editor or editor-
in-chief . This person is generally responsible for the content of
the publication. The exception is that newspapers that are large
enough usually have a separate editor for the editorials and
opinion pages in order to have a complete separation of its news
reporting and its editorial content. The executive editor sets the
publication standards for performance, as well as for motivating
and developing the staff. The executive editor is also responsible
for developing and maintaining the publication budget. In concert
with the publisher and the operating committee, the executive
editor is responsible for strategic and operational planning.
Technical editing involves reviewing text written on a technical
topic, and identifying errors related to the use of language in
general or adherence to a specific style guide. This activity
ensures that documentation is of good quality. In large companies,
experienced writers are dedicated to the technical editing function;
in organizations that cannot afford dedicated editors, experienced
writers typically peer-edit text produced by their relatively less
experienced colleagues.

FUNCTIONS INCLUDED IN EDITING:

1. NEW
2. OPEN
3. SAVE
4. SAVE AS
5. FILE

NEW

Opens a new document. If you use the keyboard combination


indicated on the right a blank document opens immediately.
Selecting the New menu item with your cursor gives the
opportunity to open a large number of types of documents.

OPEN

Opens a previously saved document. Open a document is the


same as clicking on the yellow folder with a forward arrow. It
allows you to browse for a document type that you want to
open. You can have multiple documents open at the same time.

SAVE
Saves the active document with its current file name, location and
format. Save allows you to update changes you are making to the
document and stores it on the hard drive so that you won’t lose
your work that has been completed if there is a power
interruption or other system malfunction – computers can
malfunction, and usually do so at the most inconvenient times.

SAVE AS

Saves by opening a window which gives the opportunity to


change the file name, location or format. Save As allows you to
tell Word the name of your document and the folder that you
want to store it in. It also allows you to select different formats
so that you can save a copy of your Word document.

FILE

The File Menu contains the functions that are most commonly
used to open, save, rename, print, and close files. (Although there
is no separate "rename" function available, you can rename a file
by choosing the Save As… menu item and giving the

file a different name before you save it.)

COMPILING:-

A compiler is a computer program (or set of programs) that


transforms source code written in a computer language (the source
language) into another computer language (the target language,
often having a binary form known as object code). The most
common reason for wanting to transform source code is to create
an executable program. The name "compiler" is primarily used for
programs that translate source code from a high-level programming
language to a lower level language (e.g., assembly language or
machine code). A program that translates from a low level
language to a higher level one is a decompiler. A program that
translates between high-level languages is usually called a
language translator, source to source translator, or language
converter. A language rewriter is usually a program that translates
the form of expressions without a change of language. A compiler
is likely to perform many or all of the following operations:
lexical analysis, preprocessing, parsing, semantic analysis, code
generation, and code optimization. A compiler for a relatively
simple language written by one person might be a single,
monolithic piece of software. When the source language is large
and complex, and high quality output is required the design may
be split into a number of relatively independent phases. Having
separate phases means development can be parceled up into small
parts and given to different people. It also becomes much easier
to replace a single phase by an improved one , or to insert new
phases later (e.g., additional optimizations).

The division of the compilation processes into phases was


championed by the (PQCC) at Carnegie Mellon University. This
project introduced the terms front end, middle end, and back end
.Splitting a compiler up into small programs is a technique used
by researchers interested in producing provably correct compilers.
Proving the correctness of a set of small programs often requires
less effort than proving the correctness of a larger, single,
equivalent program One classification of compilers is by the
platform on which their generated code executes. This is known
as the target platform .A native or hosted compiler is one whose
output is intended to directly run on the same type of computer

and operating system that the compiler itself runs on. The output
of a cross compiler is designed to run on a different platform.
Cross compilers are often used when developing software for
embedded systems that are not intended to support a software
development environment. The output of a compiler that produces
code for (VM) may or may not be executed on the same
platform as the compiler that produced it. For this reason such
compilers are not usually classified as native or cross compilers.

FUNCTIONS INCLUDED IN COMPILING ARE :-

1. TAG CHECK :-

To check whether tag is between open angular bracket or close angular


bracket e.g. <HTML>.

2. TAG ORDER CHECK :-

In this we will check the order of tags i.e. first HTML will come then
HEAD then TITLE then BODY and so on.

3 .BODY TAG CHECK :-

In this we will check whether we have used empty and container tags in
<BODY>.

4. ATTRIBUTE TAG CHECK :-

In this we have check whether a particular attribute belongs to a


particular tag and check whether the range of values are not undefined.

5. FRAMESET TAG CHECK :-

In this we have check that frameset and body can’t come together.

EXECUTING:-
Execution in computer and software engineering is the process by
which a computer or a virtual machine carries out the instructions
of a computer program. The instructions in the program trigger
sequences of simple actions on the executing machine. Those
actions produce effects according to the semantics of the
instructions in the program. The term run is used almost
synonymously. The context in which execution takes place is
crucial. Very few programs are executed on a bare machine.
Programs usually contain implicit and explicit assumptions about
resources available at the time of execution. Most programs are
executed with the support of an operating system and run-time
libraries specific to the source language that provide crucial
services not supplied directly by the computer itself . This
supportive environment, for instance, usually decouples a program
from direct manipulation of the computer peripherals, providing
more general, abstract services instead.

In Project we performed two types of BROWSING:-

a) INTERNAL

b) EXTERNAL

INTERNAL BROWSER:-

In this type , we have perform all functions same as in real web


browser. A web browser is a software application which enables a
user to display and interact with text, images, videos, music,
games and other information typically located on a web page at a
website on the WWW or a local area network. Text and images
on a web page can contain hyperlinks to other web pages at the
same or different website. Web browsers allow a user to quickly
and easily access information provided on many web pages at
many web sites by traversing these links. Although browsers are
typically used to access the World Wide Web, they can also be
used to access information provided by web servers in private
networks or content in Web system.

The purpose of a web browser is to display web pages to the


user. This process begins when the user inputs a Uniform Resource
Identifier (URI), for example http://en.wikipedia.org/, into the
browser. The prefix of the URI determines how the URI will be
interpreted. The most commonly used kind of URI starts with
http: and identifies content to be retrieved over HTTP. Many
browsers also support a variety of other prefixes, such as https:
for HTTPS, ftp: for the File Transfer Protocol, and file: for local
files. Prefixes that the web browser cannot directly handle are
often handed off to another application entirely. For example,
mailto: URIs are usually passed into the user's default e-mail
application, and news: URIs are passed to the user's default
newsgroup reader.

EXTERNAL BROWSER:-

In this type , we have shown output in web browser like


INTERNET EXPLORER. Internet Explorer was first released as
part of the add-on package Plus! For Windows 95 in 1995. Later
versions were available as free downloads, or in service packs,
and included in the OEM service releases of Windows 95 and
later versions of Windows. Internet Explorer was first released as
part of the add-on package Plus! for Windows 95 in 1995. Later
versions were available as free downloads, or in service packs, and
included in the OEM service releases of Windows 95 and later
versions of Windows.
Other versions available since the late 1990s include an embedded
OEM version called Internet Explorer for Windows CE (IE CE)
available for WinCE based platforms and is currently based on
IE6. Internet Explorer for Pocket PC, later rebranded for was
also developed, and remain in development alongside the more
advanced desktop versions Internet Explore has been designed to
view a broad range of web pages and to provide certain features
within the operating system, including Microsoft Update. During
the heyday of the historic browser wars, Internet Explorer
superseded Netscape only when it caught up technologically to
support the progressive features of the time.

CHAPTER 5 : DETAILS
CHAPTER 5.A : SOFTWARE USED
.NET
The Microsoft .NET Framework is a software framework
available with several Microsoft Windows operating systems. It
includes a large library of coded solutions to prevent common
programming problems and a virtual machine that manages the
execution of programs written specifically for the frame work. The
.NET Framework is akey Microsoft offering and is intended to be
used by most new applications created for the Windows platform.
The framework's Base Class Library provides a large range of
features including user interface, data and data access, data base
connectivity, cryptography, web application development, numeric
algorithms, and network communications. The class library is used
by programmers, who combine it with their own code to produce
applications. Programs written for the .NET Framework execute in
a software environment that manages the program's runtime
requirements. Also part of the .NET Framework, this runtime
environment is known as the Common Language Runtime. The
CLR provides the appearance of an application virtual machine so
that programmers need not consider the capabilities of the specific
CPU that will execute the program. The CLR also provides other
important services such as security, memory management, and
exception handling. The class library and the CLR together
constitute the .NET Framework. Version 3.0 of the .NET
Framework is included with Windows Server 2008 and Windows
Vista. The current version of the framework can also be installed
on Windows and the Windows Server 2003 family of operating
systems. A reduced "Compact" version of the .NET Framework is
also available on Windows Mobile platforms, including smart
phones.

FEATURES OF .NET :-
1. Interoperability:-
Because interaction between new and older applications is commonly
required, the .NET Framework provides means to access functionality
that is implemented in programs that execute outside the .NET
environment. Access to COM components is provided in the
System.Runtime.InteropServices and System.EnterpriseServices
namespaces of the framework; access to other functionality is provided
using the P/Invoke feature.

2. Common Runtime Engine:-


The Common Language Runtime (CLR) is the virtual machine
component of the .NET framework. All .NET programs execute under
the supervision of the CLR, guaranteeing certain properties and
behaviors in the areas of memory management, security, and
exception handling.

3. Language Independence :-
The .NET Framework introduces a Common Type System, or CTS. The
CTS specification defines all possible data types and programming
constructs supported by the CLR and how they may or may not interact
with each other. Because of this feature, the .NET Framework supports
the exchange of instances of types between programs written in any of
the .NET languages. This is discussed in more detail in Microsoft .NET
Technology.

4. Base Class Library :-


The Base Class Library (BCL), part of the Framework Class Library
(FCL), is a library of functionality available to all languages using the
.NET Framework. The BCL provides classes which encapsulate a
number of common functions, including file reading and writing,
graphic rendering, database interaction and XML document
manipulation.

5. Simplified Deployment :-
The .NET framework includes design features and tools that help
manage the installation of computer software to ensure that it does not
interfere with previously installed software, and that it conforms to
security requirements.

6. Security:-
The design is meant to address some of the vulnerabilities, such as
buffer overflows, that have been exploited by malicious software.
Additionally, .NET provides a common security model for all
applications.

7. Portability:-
The design of the .NET Framework allows it to theoretically be
platform agnostic, and Thus cross-platform compatible. That is, a
program written to use the framework should run without change on
any type of system for which the framework is implemented.
Microsoft's commercial implementations of the framework cover
Windows, Windows CE, and the Xbox 360. In addition, Microsoft
submits the specifications for the Common Language Infrastructure
(which includes the core class libraries, Common Type and the
Common Intermediate Language), the C# language, and the C++/CLI
to both ECMA and the ISO, making them available as open standards.
This makes it possible for third parties to create compatible
implementations of the framework and its languages on other platforms.

NET Framework 2.0


Released with Visual Studio 2005, Microsoft SQL Server 2005, and
BizTalk 2006.The 2.0 Redistributable Package can be downloaded for
free from Microsoft, and was published on 22 January 2006. The 2.0
Software Development Kit (SDK) can be downloaded for free from
Microsoft. It is included as part of Visual Studio 2005 and Microsoft
SQL Server 2005.

Version 2.0 without any Service Pack is the last version with support
for Windows 98 and Windows Me. Version 2.0 with Service Pack 1 is
the last version with official support for Windows 2000 although there
have been some unofficial workarounds published online to use a
subset of the functionality from Version 3.5 in Windows 2000.[17]
Version 2.0 with Service Pack 2 requires Windows XP or Windows
Server 2003. It shipped with Windows Server 2003 R2 (not installed by
default).

C#.NET

C# .NET is simple, modern, safe and objects oriented Language.

 It combines the feature of VB.NET and JAVA.NET.


 With VB.NET, we can create web application using the shared web
forms Designer.
 VB.NET has powerful window based application.
 We can extract rules of JAVA.NET (coding part).
 JAVA.NET package provides special I/O routines for networks, allowing
HTTP requests, as well as other common transactions.

SYSTEM LIBRARIES USED:-

1. System:-
A string is a sequential collection of Unicode characters that is used
.NET Development.NET Framework 3.5.NET Framework Class
Library System Namespace. It is also provide OutOfMemoryException,
FormatException, BadImageFormatException in .NET Framework
3.5.NET Framework Class Library System Namespace
OutOfMemoryException.

2. System.Collections:-

It is DataEntryStructure i.e IDictionaryEnumerator. Entry method


returns an instance of this type data in .NET Framework 3.5.NET
Framework Class Library System.Collections Namespace.

3. System.Data:-

This represents the view of data whose property value type is system
.string in .NET Framework 3.5.NET Framework Class Library
System.Collections Namespace.

4. System.Drawing:-

It is IconClass which represents a Windows icon, which is a small


bitmap image used to show colors, font etc. for the .NET
Development.NET Framework 3.5.NET Framework Class Library
System. Drawing Namespace.

5. System.Text:-
It is StringBuilderClass which represents a string-like object whose
value is a mutable in .NET Framework 3.5.NET Framework Class
Library System.Text Namespace StringBuilder Class.

6. System.Window.FORM:-

It is a DataTemplate Class to specify the visualization of your data


objects on the window form by using .NET Framework 3.5.NET
Framework Class Library System.Windows Namespace DataTemplate
Class.

CHAPTER 5.B : FLOWCHART OF HTML DEBUGGER


DESIGNING
In designing phase, we have to propose a design which we want
for our project. As in requirement analysis, we have stated that our
software will perform three main functions i.e. EDITING,
COMPILING/DEBUGGING, and EXECUTING.

These functions can be performed in the way as shown in the


design view as:-

The designing of all the three functions is shown as :-

1) EDITING :-

2) COMPILING/ DEBUGGING :-
3) EXECUTING :-

CHAPTER 5.C : MODULES


We have used various modules in our project :-

1) TAG CHECK :-
In this module, we have checked whether the tag is in between
the open angular brackets and close angular brackets. And also in
this we will check the double entry of tags i.e. basic tags like
<HTML>, <HEAD>, <BODY>, <TITLE> should come once.

We have check this tag by first initializing a variable status by


zero and then reading the whole text (which the user has written)
word by word. If the open angular bracket has come then
increment the status by one. If the status value is more than one
on reading the whole tag then there is an error because there is
more than one open angular bracket. The error will be shown in
RED color and its description will be given in the ERROR LIST.
On clicking that description, cursor will be placed in the line
which has error. In the end status will again be decremented by
one so that we can check all tags.

In the same way, error for more than one close angular bracket
is detected. In this we will see that if the close angular bracket
has come then decrement the status by one. If the status value is
less than one on reading the whole tag then there is an error
because there is more than one close angular bracket. The error
will be shown in RED color and its description will be given in
the ERROR LIST. On clicking that description, cursor will be
placed in the line which has error. In the end status will again be
incremented by one so that we can check all tags.

2) TAG ORDER CHECK :-


In this module, we have checked that the container tags (tags
which include both an on and off tag ) are closed in correct
sequence or not. For example if <HTML> is first written and then
<HEAD> is written, then firstly head will be closed i.e. </HEAD>
and then html will be closed i.e. </HTML>.

To check this first of all we have taken a stack of desired size.


Then we read a tag one by one in the whole text written by user.
If we have found a container tag in its on state then we
increment the stack by one and put it in the top of the stack. But
if we have found an empty tag then we will not put it in the
stack.

Now if we have found the off state of the container tag then we
will check it with the top of the stack. If they are matched then
we will decrement the top of the stack. But if they are not
matched then there is an error of wrong order of the tags in our
text.

3) BODY TAG CHECK :-


In this module we have checked that there will be no tag
between off state of BODY and off state of HTML i.e. there will
be no tag between </BODY> and </HTML>. This means that if
we write any tag between these two tags then there will be error
in the text.

To check this firstly we have read whole text until we have


found on state of body. This is so because there can be the case
that user has used FRAMESET instead of BODY. As BODY and
FRAMESET can’t come together, so we have firstly read whole
text to find whether BODY tag is used in the text or not. If we
have found the on state of the BODY then we will read the text
until we found off state of the BODY tag.

Then we will break the loop and check that just the next tag of
it is </HTML> i.e. off sate of HTML tag. If it is so then there
will be no error in the text written by the user otherwise there
will be an error.

4) POSITION CHECK :-
In this module we have checked that first and last tags in the
text must be the on and off states of HTML. This means that
first tag in the user text must be <HTML> and last tag in the
user text must be </HTML>.

To check this first of all we have taken a variable strstatus and


initialize it with zero. We have read the whole text until we
found first open angular bracket (i.e. <) and increment the strstatus
by one.

If strstatus is one and the tag is <HTML> then there is no error


otherwise there is an error of HTML must be the first tag. Now
to check that last tag is off state of HTML, we read whole text
and check that last tag in the text is </HTML>. If it is so then
there is no error otherwise there is an error.

5) ATTRIBUTE TAG CHECK :-


In this module we have checked that whether a particular
attribute belongs to a particular tag and check that whether the
value of attribute is defined or not. This means in that we will
check whether the attribute written in the text is predefined or
user defined. If user defined then there is an error in the text
else not. Similarly if the values of the attribute are undefined or
user defined then also there will be an error in the text.

To check the first case i.e. whether a particular attribute belongs


to the tag or not, we will first take the array of attributes which
are predefined. Then we will read whole text and check that
attributes which we are finding along are matching in the array
of attributes. If they are not in the array of attributes then there
will be an error that the attribute doesn’t exist and hence it is
user defined. Otherwise there will be no error.

To check the second case i.e. the range of values of attribute,


there are two cases :-
a) In which the range of value is in integer form
b) In which the range of value is in specified string form

To check the first case let us take an example that range of


value of SIZE of FONT must be in between 1 to 9. For
checking that we will first read the value of SIZE attribute and
then check whether it is between 1 and 9. If it is so then there
is not an error otherwise there is an error.

To check second case let us take an example that ALIGN


attribute of P (paragraph) tag must be -: RIGHT, LEFT, and
CENTER.
For this we will first take an array in which there are three
fields i.e. RIGHT, LEFT, CENTER. We will first read the value
of ALIGN attribute and then check whether it matches in the
array. If it is so then there is not an error otherwise there is an
error that value of ALIGN is undefined.
6) FRAMESET TAG CHECK :-
In this module we have checked that FRAMESET and BODY
don’t come together. This means that we can either create web
page with writing text in the BODY part or we can combine two
documents of HTML into one by using FRAME and FRAMESET
which will show two web pages side by side in one web page.

To check this there are two cases :-

a) Firstly we read text until we find <FRAMESET> and then we


search for on and off states of BODY tag i.e. <BODY> and
</BODY>. If we found that then there is an error in the text
that states BODY and FRAMESET can’t come together. If we
haven’t found then there is no error.
b) Firstly we read text until we find <BODY> and then we
search for on and off states of FRAMESET tag i.e.
<FRAMESET> and </FRAMESET> and also search for
<FRAME> tag. If we found that then there is an error in the
text that states BODY and FRAMESET can’t come together.
If we haven’t found then there is no error.

APPROACH USED

We mainly used the approach for String matching or pattern matching


in our project.As we are dealing with syntax and semantic rules of
HTML ,it is required to read whole document and to check if a
particular tag , attribute etc. exists or not.
To perform this task efficiently ,we are using STRING OR PATTERN
MATCHING ALGORITHM i.e. KMP ALGORITHM

KMP stands for Knuth–Morris–Pratt. The KMP or string searching


algorithm searches for occurrences of a "word" W within a main "text
string" S by employing the observation that when a mismatch occurs,
the word itself embodies sufficient information to determine where the
next match could begin, thus bypassing re-examination of previously
matched characters. The algorithm was conceived by Donald Knuth and
Vaughan Pratt and independently by J. H. Morris in1977, but the three
published it jointly.

Description and pseudo code for the search algorithm

The above example contains all the elements of the algorithm. For the
moment, we assume the existence of a "partial match" table T,
described below which indicates where we need to look for the start of
a new match in the event that the current one ends in a mismatch. The
entries of T are constructed so that if we have a match starting at S[m]
that fails when comparing S[m + i] to W[i], then the next possible
match will start at index m + i - T[i] in S (that is, T[i] is the amount of
"backtracking" we need to do after a mismatch).

This has two implications: first, T[0] = -1, which indicates that if W[0]
is a mismatch, we cannot backtrack and must simply check the next
character; and second, although the next possible match will begin at
index m + i - T[i], as in the example above, we need not actually check
any of the T[i] characters after that, so that we continue searching from
W[T[i]].

The following is a sample pseudocode implementation of the KMP


search algorithm:-
algorithm kmp_search:

input:
an array of characters, S (the text to be searched)
an array of characters, W (the word sought)

output:
an integer (the zero-based position in S at which W is found)

define variables:
an integer, m ← 0 (the beginning of the current match in S)
an integer, i ← 0 (the position of the current character in W)
an array of integers, T (the table, computed elsewhere)

while m + i is less than the length of S, do:


if W[i] = S[m + i],
let i ← i + 1
if i equals the length of W,
return m
otherwise,
let m ← m + i - T[i],
if i is greater than 0,
let i ← T[i]
(if we reach here, we have searched all of S unsuccessfully )
return the length of S

SCHEDULE CHART
MODULE NAME START DATE COMPLETION BY
DATE

1. TAG CHECK 20.2.09 24.2.09 Charu and


MODULE Sheetal

2. TAG ORDER 26.2.09 1.3.09 Gurpreet and


CHECK MODULE Charu

3. BODY TAG CHECK 2.3.09 12.3.09 Sheetal and


MODULE Gurpreet

4. POSITION CHECK 14.3.09 27.3.09 Charu and


MODULE Gurpreet

5. ATTRIBUTE TAG 28.3.09 4.4.09 Gurpreet


CHECK MODULE and
Sheetal
6. FRAMESET TAG 6.4.09 12.4.09
CHECK MODULE Charu and
Sheetal

CHAPTER 5.D : CODING


There are various modules used in our project. These are named
previously in the design phase and now they will be discussed
here in detail either on the basis of coding or on the basis of
their functionality.

CODING OF FORM 1 (EDITOR)


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace HTML_DEBUGGER
{
public partial class Form1 : Form
{
String filename = "";
int compilestatus = 0;
string[] opentags ={ "<BR>", "<LI>", "<DD>", "<IMG>",
"<DT>","<!-->" ,"<HR>","<BASE>","<INPUT>","<FRAME>"};
string[] closetags ={ "<HTML>", "<BODY>", "<TITLE>",
"<P>", "<FONT>", "<HEAD>", "<BASEFONT>", "<B>", "<I>",
"<U>", "<OL>", "<UL>", "<DL>", "<CENTER>", "<TABLE>",
"<TR>", "<TH>", "<TD>", "<A>", "<H1>", "<H2>", "<H3>", "<H4>",
"<H5>", "<H6>", "</HTML>", "</BODY>", "</TITLE>", "</P>",
"</FONT>", "</HEAD>", "</BASEFONT>", "</B>", "</I>", "</U>",
"</OL>", "</UL>", "</DL>", "</CENTER>", "</TABLE>", "</TR>",
"</TH>", "</TD>", "</A>", "</H1>", "</H2>", "</H3>", "</H4>",
"</H5>", "</H6>"
,"<FRAMESET>","</FRAMESET>","<FORM>","</FORM>","<IMG
>","</IMG>","<STRIKE>","</STRIKE>","<TT>","</TT>","<EM>","
</EM>","<STRONG>","</STRONG>","<META>","</META>","<ST
RIKE>","</STRIKE>"};
string[] singletags ={ "<HTML>", "<HEAD>", "<TITLE>",
"<BODY>", "</HTML>", "</HEAD>", "</TITLE>", "</BODY>"};
string[,] attrib = new string[20,10];

bool checkTags(string Text)


{
string str = "";
int status = 0;
for (int i = 0; i < Text.Length; i++)
{
str = Text.Substring(i, 1);
if (str == "<")
{
status++;

if (status > 1)
{
richTextBox1.SelectionStart = i;
richTextBox1.SelectionLength = 1;
richTextBox1.SelectionColor = Color.Red;
if (errorlist.Items.IndexOf(lineno(richTextBox1.Text,
i).ToString() + " Error for more than one < or tag is not in between
angular brackets") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
i).ToString() + " Error for more than one < or tag is not in between
angular brackets");
status--;
compilestatus = 1;
}

}
if (str == ">")
{
status--;

if (status < 0)
{
richTextBox1.SelectionStart = i;
richTextBox1.SelectionLength = 1;
richTextBox1.SelectionColor = Color.Red;
if (errorlist.Items.IndexOf(lineno(richTextBox1.Text,
i).ToString() + " Error for more than one > or tag is not in between
angular brackets ") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
i).ToString() + " Error for more than one > or tag is not in between
angular brackets ");
compilestatus = 1;
status++;
}

}
return true;
}
int closetagindex(string Tag)
{
for (int i = 0; i < closetags.Length; i++)
{
if (closetags[i] == Tag)
return i;

}
return -1;
}
int opentagindex(string Tag)
{
for (int i = 0; i < opentags.Length; i++)
{
if (opentags[i] == Tag)
return i;

}
return -1;
}
public bool tagcheck(string Text)
{

string str1 = "";


for (int i = 0; i < Text.Length; i++)
{
if (Text.Substring(i, 1) == "<")
{
str1 = "";
int j = i;

while ((Text.Substring(j, 1) != ">") && (Text.Substring(j,


1) != " ") && (Text.Substring(j + 1, 1) != "<"))
{
str1 += Text.Substring(j, 1);
j++;

if (j == Text.Length)
break;
}
str1 += ">";
if (closetagindex(str1) == -1 && opentagindex(str1) == -1)
{
richTextBox1.SelectionStart = j - str1.Length + 1;
richTextBox1.SelectionLength = str1.Length;
richTextBox1.SelectionColor = Color.Red;
if (errorlist.Items.IndexOf(lineno(richTextBox1.Text, j -
str1.Length + 2).ToString() + " Error-- this tag doesn't exist ") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text, j-
str1.Length + 2).ToString() + " Error-- this tag doesn't exist ");
compilestatus = 1;

}
}
}
return true;
}
void tagordercheck(string Text)
{
string str = "";
int status = 0;

string[] tagstack = new string[100];


int top = -1;

string str1 = "";


for (int i = 0; i < Text.Length; i++)
{
if (Text.Substring(i, 1) == "<")
{
str1 = "";
int j = i;

while ((Text.Substring(j, 1) != ">") && (Text.Substring(j,


1) != " ") && (Text.Substring(j + 1, 1) != "<"))
{
str1 += Text.Substring(j, 1);
j++;

if (j == Text.Length)
break;
}
str1 += ">";
string tag1;
if (closetagindex(str1) != -1)
if ((str1.IndexOf("/") == -1))
{
top++;
tagstack[top] = str1;

}
else
{
tag1 = str1.ToString().Replace("/", "");

if (top>=0&&tag1 == tagstack[top])
{
top--;
}
else
{
richTextBox1.SelectionStart = i;
richTextBox1.SelectionLength = tag1.Length + 1;
richTextBox1.SelectionColor = Color.Red;
if
(errorlist.Items.IndexOf(lineno(richTextBox1.Text, i).ToString() + "
Error-- Tag order is Wrong") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
i).ToString() + " Error-- Tag order is Wrong");
compilestatus = 1;
}
}

}
}
}

int checksingletags(string Tag)


{
for (int i = 0; i < singletags.Length; i++)
{
if (singletags[i] == Tag)

return i;

}
return -1;
}
void singleentrytags(string Text)
{
int[,] countsingletag = new int[singletags.Length, 2];
string str1 = "";
for (int i = 0; i < Text.Length; i++)
{
if (Text.Substring(i, 1) == "<")
{
str1 = "";
int j = i;

while ((Text.Substring(j, 1) != ">") && (Text.Substring(j,


1) != " ") && (Text.Substring(j + 1, 1) != "<"))
{
str1 += Text.Substring(j, 1);
j++;

if (j == Text.Length)
break;
}
str1 += ">";

if (checksingletags(str1) != -1)
{
countsingletag[checksingletags(str1), 0]++;
countsingletag[checksingletags(str1), 1] = i;
}

for (int j1 = 0; j1 < countsingletag.Length / 2; j1++)


{
if (countsingletag[j1, 0] > 1)
{
richTextBox1.SelectionStart = countsingletag[j1,
1]+1;
richTextBox1.SelectionColor = Color.Red;
richTextBox1.SelectionLength =
singletags[j1].Length;
if (errorlist.Items.IndexOf(lineno(richTextBox1.Text,
countsingletag[j1, 1]+1).ToString() + " Error--This tag can't come more
than one time") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
countsingletag[j1, 1]+1).ToString() + " Error--This tag can't come more
than one time");
compilestatus = 1;

}
}
}
}
}
int strstatuss = 0;

void positioncheck(string Text)


{
string str1 = "";

for (int i = 0; i < Text.Length; i++)


{
if (Text.Substring(i, 1) == "<")
{
str1 = "";
int j = i;
if(strstatuss!=99)
strstatuss++;
while ((Text.Substring(j, 1) != ">") && (Text.Substring(j,
1) != " ") && (Text.Substring(j + 1, 1) != "<"))
{
str1 += Text.Substring(j, 1);
j++;

if (j == Text.Length)
break;
}
str1 += ">";
}
if (str1 == "<HTML>")
strstatuss = 99;
if (strstatuss != 99)
{

if (str1 != "<HTML>"&&str1!="<!-->")
{
richTextBox1.SelectionStart = i;
richTextBox1.SelectionLength = str1.Length;
richTextBox1.SelectionColor = Color.Red;
if (errorlist.Items.IndexOf(lineno(richTextBox1.Text,
i).ToString() + " Error--<HTML> must be the first tag") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
i).ToString() + " Error--<HTML> must be the first tag");
compilestatus = 1;
}
}
}
if (str1 !="</HTML>"&& str1!="<!-->")
{
richTextBox1.SelectionStart = richTextBox1.Text.Length -
str1.Length;
richTextBox1.SelectionLength = str1.Length - 1;
richTextBox1.SelectionColor = Color.Red;
if (errorlist.Items.IndexOf(lineno(richTextBox1.Text,
richTextBox1.Text.Length - str1.Length).ToString() + " Error--
</HTML> must be the last tag") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
richTextBox1.Text.Length - str1.Length).ToString() + " Error--
</HTML> must be the last tag");
compilestatus = 1;
}

int strstatus = 0;
int i, j, Stat;

void commenttag(string Text)


{
string str1 = "";

for (int i = 0; i < Text.Length; i++)


{
if (Text.Substring(i, 1) == "<")
{
str1 = "";
j = i;
strstatus++;
while ((Text.Substring(j, 1) != ">") && (Text.Substring(j,
1) != " ") && (Text.Substring(j + 1, 1) != "<"))
{
if (Text.Substring(j, 1) == "\n")
break;
str1 += Text.Substring(j, 1);
j++;

if (j == Text.Length)
break;
}

if(str1=="<!--")
{
Stat=0;
for(j=i;j<(Text.Length)-3;j++)
{
if(Text.Substring(j,3)=="-->")
{
Stat=1;
break;
}

}
if(Stat==0)
{
richTextBox1.SelectionStart = i;
richTextBox1.SelectionLength = str1.Length;
richTextBox1.SelectionColor = Color.Red;
if (errorlist.Items.IndexOf(lineno(richTextBox1.Text,
i).ToString() + " Error of comment tag") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
i).ToString() + " Error of comment tag");
compilestatus = 1;
}
i = j + 1;

}
}
}
}
void frameset(string Text)
{
int i = 0;
int j = 0;

if (Text.IndexOf("<FRAMESET>") != -1)
{
i = Text.IndexOf("<FRAMESET>");
if (Text.IndexOf("<BODY>") != -1)
{
richTextBox1.SelectionStart = i;
richTextBox1.SelectionLength="<FRAMESET>".Length;
richTextBox1.SelectionColor = Color.Red;
if (errorlist.Items.IndexOf(lineno(richTextBox1.Text,
i).ToString() + " Error-- BODY and FRAMESET can't come together")
== -1)
errorlist.Items.Add(lineno(richTextBox1.Text, i).ToString()
+ " Error-- BODY and FRAMESET can't come together");
compilestatus = 1;
}
if (Text.IndexOf("</BODY>") != -1)
{
richTextBox1.SelectionStart = i;
richTextBox1.SelectionLength = "<FRAMESET>".Length;
;
richTextBox1.SelectionColor = Color.Red;
if (errorlist.Items.IndexOf(lineno(richTextBox1.Text,
i).ToString() + " Error-- BODY and FRAMESET can't come together")
== -1)
errorlist.Items.Add(lineno(richTextBox1.Text, i).ToString()
+ " Error-- BODY and FRAMESET can't come together");
compilestatus = 1;
}
}
if (Text.IndexOf("<BODY>") != -1)
{
j = Text.IndexOf("<BODY>");
if (Text.IndexOf("<FRAMESET>") != -1)
{
richTextBox1.SelectionStart = j;
richTextBox1.SelectionLength = "<BODY>".Length;
richTextBox1.SelectionColor = Color.Red;
if (errorlist.Items.IndexOf(lineno(richTextBox1.Text,
j).ToString() + " Error-- BODY and FRAMESET can't come together")
== -1)
errorlist.Items.Add(lineno(richTextBox1.Text, j).ToString()
+ " Error-- BODY and FRAMESET can't come together");
compilestatus = 1;
}
if (Text.IndexOf("</FRAMESET>") != -1)
{
richTextBox1.SelectionStart = j;
richTextBox1.SelectionLength = "<BODY>".Length;
richTextBox1.SelectionColor = Color.Red;
if (errorlist.Items.IndexOf(lineno(richTextBox1.Text,
j).ToString() + " Error-- BODY and FRAMESET can't come together")
== -1)
errorlist.Items.Add(lineno(richTextBox1.Text, j).ToString()
+ " Error-- BODY and FRAMESET can't come together");
compilestatus = 1;
}
if (Text.IndexOf("<FRAME>") != -1)
{
richTextBox1.SelectionStart = j;
richTextBox1.SelectionLength = "<BODY>".Length;
richTextBox1.SelectionColor = Color.Red;
if (errorlist.Items.IndexOf(lineno(richTextBox1.Text,
j).ToString() + " Error-- BODY and FRAME can't come together") ==
-1)
errorlist.Items.Add(lineno(richTextBox1.Text, j).ToString()
+ " Error-- BODY and FRAME can't come together");
compilestatus = 1;
}
}
}
void metatag(string Text)
{

int i=0, j=0, k=0, l=0;


i = Text.IndexOf("<HEAD>");
j = Text.IndexOf("<META");
k = Text.IndexOf("</META>");
l = Text.IndexOf("</HEAD>");
if (j == -1 || k == -1 || l == -1 || i == -1) return;
if (j < i || k < i)
{
richTextBox1.SelectionStart = j;
richTextBox1.SelectionLength = "<META".Length;
richTextBox1.SelectionColor = Color.Red;
if (errorlist.Items.IndexOf(lineno(richTextBox1.Text,
j).ToString() + " Error-- <META> tag always come inside <HEAD>
element") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
j).ToString() + " Error-- <META> tag always come inside <HEAD>
element");
compilestatus = 1;
}
if (j > l || k > l)
{
richTextBox1.SelectionStart = j;
richTextBox1.SelectionLength = "<META".Length;
richTextBox1.SelectionColor = Color.Red;
if (errorlist.Items.IndexOf(lineno(richTextBox1.Text,
j).ToString() + " Error-- <META> tag always come inside <HEAD>
element") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
j).ToString() + " Error-- <META> tag always come inside <HEAD>
element");
compilestatus = 1;
}
}
void bodytagcheck(string Text)
{
string str1 = "";
int j = 0;

for (int i = 0; i < Text.Length; i++)


{
if (Text.Substring(i, 1) == "<")
{
str1 = "";
j = i;

while ((Text.Substring(j, 1) != ">") && (Text.Substring(j,


1) != " ") && (Text.Substring(j + 1, 1) != "<"))
{
str1 += Text.Substring(j, 1);
j++;

if (j == Text.Length)
break;
}
str1 += ">";
if (str1 == "<BODY>")
break;

}
}
if (str1 == "<BODY>")
{
string str2 = "";
for (int i = 0; i < Text.Length; i++)
{
if (Text.Substring(i, 1) == "<")
{
str2 = "";
j = i;

while ((Text.Substring(j, 1) != ">") &&


(Text.Substring(j, 1) != " ") && (Text.Substring(j + 1, 1) != "<"))
{
str2 += Text.Substring(j, 1);
j++;

if (j == Text.Length)
break;
}
str2 += ">";
if (str2 == "</BODY>")
break;
}
}
if (str2 == "</BODY>")
{
string str3 = "";
for (int i = j; i < Text.Length; i++)
{
if (Text.Substring(i, 1) == "<")
{
str3 = "";
j = i;

while ((Text.Substring(j, 1) != ">") &&


(Text.Substring(j, 1) != " ") && (Text.Substring(j + 1, 1) != "<"))
{
str3 += Text.Substring(j, 1);
j++;

if (j == Text.Length)
break;
}
str3 += ">";
}

if (str2 == "</BODY>" && str3 != "</HTML>" &&


str3.Trim() != "")
{
richTextBox1.SelectionStart = j-str3.Length;
richTextBox1.SelectionLength = str3.Length ;
richTextBox1.SelectionColor = Color.Red;
if
(errorlist.Items.IndexOf(lineno(richTextBox1.Text, j -
str3.Length).ToString() + " Error-- </HTML> must end after
</BODY>") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text, j-
str3.Length).ToString() + " Error-- </HTML> must end after
</BODY>");
compilestatus = 1;

}
}
}
}
}
string[] attribute = new string[20];
int l = 0;
void attributetag(string Text)
{

string str1 = "";


for (int i = 0; i < Text.Length; i++)
{
if (Text.Substring(i, 1) == "<")
{
str1 = "";
j = i;
l = 0;
while ((Text.Substring(j, 1) != ">") && (Text.Substring(j,
1) != " ") && (Text.Substring(j + 1, 1) != "<"))
{
str1 += Text.Substring(j, 1);
j++;

if (j == Text.Length)
break;
}
if (Text.Substring(j, 1) == " ")
{
attribute[l] = "";
for (int k = j; k < Text.Length; k++)
{
if (Text.Substring(k, 1) == ">")
break;
attribute[l] += Text.Substring(k, 1);

if (Text.Substring(k, 1) == "=")
{
l++;
attribute[l] = "";
for (; Text.Substring(k, 1) != " "; k++)
{
if (Text.Substring(k, 1) == ">")
{
k = k - 1;
break;
}
if (k == Text.Length)
break;

}
}
}
}

str1 += ">";
//MessageBox.Show(str1);
if (attributetagindex(str1) != -1)
{
int r = attributetagindex(str1);
for (int l1 = 0; l1 < l; l1++)
{
attribute[l1] = attribute[l1].Substring(0,
attribute[l1].Length - 1);
attribute[l1] = attribute[l1].Replace("\"", "");

if ((attributeindex(attribute[l1].Trim(), r)) == -1)


{
richTextBox1.SelectionStart = i;
int i1 = 0;
for (i1 = i; richTextBox1.Text.Substring(i1, 1) !=
">"; i1++)
{

if (i1 == richTextBox1.Text.Length) break;


}
richTextBox1.SelectionLength = (i1 - i) + 1;
richTextBox1.SelectionColor = Color.Red;
if
(errorlist.Items.IndexOf(lineno(richTextBox1.Text, i+1).ToString() + "
Error-- This attribute doesn't exist") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
i+1).ToString() + " Error-- This attribute doesn't exist");
compilestatus = 1;
}
else if (attribute[l1].Trim() == "SIZE" && (str1 ==
"<FONT>" || str1 == "<BASEFONT>"))
{
int j1, k1;
j1 = richTextBox1.Find("SIZE", i,
RichTextBoxFinds.None);
j1 = richTextBox1.Find("=", j1,
RichTextBoxFinds.None) + 1;
for (k1 = j1; Text.Substring(k1, 1) != ">" &&
Text.Substring(k1, 1) != " "; k1++)
{}
string str2 = Text.Substring(j1, k1 - j1);
MessageBox.Show(str2);
if (Int32.Parse(str2) <= 0 || Int32.Parse(str2) >= 9)
{
richTextBox1.SelectionStart = j1;
richTextBox1.SelectionLength = str2.Length;
richTextBox1.SelectionColor = Color.Red;
if
(errorlist.Items.IndexOf(lineno(richTextBox1.Text, j1).ToString() + "
Error-- Range of SIZE must be in Between 0 to 9 ") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
j1).ToString() + " Error-- Range of SIZE must be in Between 0 to 9 ");
compilestatus = 1;
}

}
else if (attribute[l1].Trim() == "VALIGN" && (str1
== "<TH>" || str1 == "<TR>"))
{
int j1, k1;
string[] valignattrib = { "TOP", "CENTER",
"BOTTOM" };
j1 = richTextBox1.Find("VALIGN", i,
RichTextBoxFinds.None);
j1 = richTextBox1.Find("=", j1,
RichTextBoxFinds.None) + 1;
for (k1 = j1; Text.Substring(k1, 1) != ">" &&
Text.Substring(k1, 1) != " "; k1++)
{}
string str2 = Text.Substring(j1, k1 - j1);
MessageBox.Show(str2);
int x = 0;
for (x = 0; x < valignattrib.Length; x++)
{
if (valignattrib[x] == str2)
break;

if (x == valignattrib.Length)
{
richTextBox1.SelectionStart = j1;
richTextBox1.SelectionLength = str2.Length;
richTextBox1.SelectionColor = Color.Red;
if
(errorlist.Items.IndexOf(lineno(richTextBox1.Text, j1).ToString() + "
Error-- The value of VALIGN is undefined ") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
j1).ToString() + " Error-- The value of VALIGN is undefined ");
compilestatus = 1;
}
}

else if (attribute[l1].Trim() == "BGCOLOR" && (str1


== "<BODY>" || str1 == "<TR>" || str1 == "<TH>" || str1 ==
"<TABLE>"))
{
int j1, k1;
string[] bgcolorattrib = { "RED", "YELLOW",
"GREEN", "PINK", "BLUE", "BLACK", "WHITE", "CYAN",
"MAGENTA", "SKYBLUE", "ORANGE", "GREY", "BROWN",
"MAROON", "PURPLE", "SILVER", "GOLD", "SKIN",
"MUSTARD",
"#000000","#FF0000","#00FF00","#0000FF","#FFFF00","#FFFFFF","
#00FFFF","#FF00FF","#C0C0C0" };
j1 = richTextBox1.Find("BGCOLOR", i,
RichTextBoxFinds.None);
j1 = richTextBox1.Find("=", j1,
RichTextBoxFinds.None) + 1;
for (k1 = j1; Text.Substring(k1, 1) != ">" &&
Text.Substring(k1, 1) != " "; k1++)
{}
string str2 = Text.Substring(j1, k1 - j1);
MessageBox.Show(str2);
int x = 0;
for (x = 0; x < bgcolorattrib.Length; x++)
{
if (bgcolorattrib[x] == str2)
break;

}
if (x == bgcolorattrib.Length)
{
richTextBox1.SelectionStart = j1;
richTextBox1.SelectionLength = str2.Length;
richTextBox1.SelectionColor = Color.Red;
if
(errorlist.Items.IndexOf(lineno(richTextBox1.Text, j1).ToString() + "
Error-- The value of BGCOLOR is undefined ") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
j1).ToString() + " Error-- The value of BGCOLOR is undefined ");
compilestatus = 1;
}
}

else if (attribute[l1].Trim() == "COLOR" && (str1 ==


"<BASEFONT>" || str1 == "<FONT>" ))
{
int j1, k1;
string[] colorattrib = { "RED", "YELLOW",
"GREEN", "PINK", "BLUE", "BLACK", "WHITE", "CYAN",
"MAGENTA", "SKYBLUE", "ORANGE", "GREY", "BROWN",
"MAROON", "PURPLE", "SILVER", "GOLD", "SKIN",
"MUSTARD", "#000000", "#FF0000", "#00FF00", "#0000FF",
"#FFFF00", "#FFFFFF", "#00FFFF", "#FF00FF", "#C0C0C0" };
j1 = richTextBox1.Find("COLOR", i,
RichTextBoxFinds.None);
j1 = richTextBox1.Find("=", j1,
RichTextBoxFinds.None) + 1;
for (k1 = j1; Text.Substring(k1, 1) != ">" &&
Text.Substring(k1, 1) != " "; k1++)
{}
string str2 = Text.Substring(j1, k1 - j1);
MessageBox.Show(str2);
int x = 0;
for (x = 0; x < colorattrib.Length; x++)
{
if (colorattrib[x] == str2)
break;

}
if (x == colorattrib.Length)
{
richTextBox1.SelectionStart = j1;
richTextBox1.SelectionLength = str2.Length;
richTextBox1.SelectionColor = Color.Red;
if
(errorlist.Items.IndexOf(lineno(richTextBox1.Text, j1).ToString() + "
Error-- The value of COLOR is undefined ") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
j1).ToString() + " Error-- The value of COLOR is undefined ");
compilestatus = 1;
}
}
else if (attribute[l1].Trim() == "LEFTMARGIN" &&
(str1 == "<BODY>"))
{
int j1, k1;
j1 = richTextBox1.Find("LEFTMARGIN", i,
RichTextBoxFinds.None);
j1 = richTextBox1.Find("=", j1,
RichTextBoxFinds.None) + 1;
for (k1 = j1; Text.Substring(k1, 1) != ">" &&
Text.Substring(k1, 1) != " "; k1++)
{}
string str2 = Text.Substring(j1, k1 - j1);
MessageBox.Show(str2);
if (Int32.Parse(str2) <= 1 || Int32.Parse(str2) >= 3)
{
richTextBox1.SelectionStart = j1;
richTextBox1.SelectionLength = str2.Length;
richTextBox1.SelectionColor = Color.Red;
if
(errorlist.Items.IndexOf(lineno(richTextBox1.Text, j1).ToString() + "
Error-- Range of LEFTMARGIN must be in Between 1 to 3 ") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
j1).ToString() + " Error-- Range of LEFTMARGIN must be in Between
1 to 3 ");
compilestatus = 1;
}
}
else if (attribute[l1].Trim() == "RIGHTMARGIN"
&& (str1 == "<BODY>"))
{
int j1, k1;
j1 = richTextBox1.Find("RIGHTMARGIN", i,
RichTextBoxFinds.None);
j1 = richTextBox1.Find("=", j1,
RichTextBoxFinds.None) + 1;
for (k1 = j1; Text.Substring(k1, 1) != ">" &&
Text.Substring(k1, 1) != " "; k1++)
{}
string str2 = Text.Substring(j1, k1 - j1);
MessageBox.Show(str2);
if (Int32.Parse(str2) <= 1 || Int32.Parse(str2) >= 3)
{
richTextBox1.SelectionStart = j1;
richTextBox1.SelectionLength = str2.Length;
richTextBox1.SelectionColor = Color.Red;
if
(errorlist.Items.IndexOf(lineno(richTextBox1.Text, j1).ToString() + "
Error-- Range of RIGHTMARGIN must be in Between 1 to 3 ") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
j1).ToString() + " Error-- Range of RIGHTMARGIN must be in
Between 1 to 3 ");
compilestatus = 1;
}

}
else if (attribute[l1].Trim() == "HEIGHT" && (str1
== "<TABLE>" || str1 == "<IMG>"))
{
int j1, k1;
j1 = richTextBox1.Find("HEIGHT", i,
RichTextBoxFinds.None);
j1 = richTextBox1.Find("=", j1,
RichTextBoxFinds.None) + 1;
for (k1 = j1; Text.Substring(k1, 1) != ">" &&
Text.Substring(k1, 1) != " "; k1++)
{}
string str2 = Text.Substring(j1, k1 - j1);
MessageBox.Show(str2);
if (Int32.Parse(str2) <= 1 || Int32.Parse(str2) >= 6)
{
richTextBox1.SelectionStart = j1;
richTextBox1.SelectionLength = str2.Length;
richTextBox1.SelectionColor = Color.Red;
if
(errorlist.Items.IndexOf(lineno(richTextBox1.Text, j1).ToString() + "
Error-- Range of HEIGHT must be in Between 1 to 6 ") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
j1).ToString() + " Error-- Range of HEIGHT must be in Between 1 to 6
");
compilestatus = 1;
}
}

else if (attribute[l1].Trim() == "WIDTH" && (str1 ==


"<TABLE>" || str1 == "<IMG>"))
{
int j1, k1;
j1 = richTextBox1.Find("WIDTH", i,
RichTextBoxFinds.None);
j1 = richTextBox1.Find("=", j1,
RichTextBoxFinds.None) + 1;
for (k1 = j1; Text.Substring(k1, 1) != ">" &&
Text.Substring(k1, 1) != " "; k1++)
{}
string str2 = Text.Substring(j1, k1 - j1);
MessageBox.Show(str2);
if (Int32.Parse(str2) <= 1 || Int32.Parse(str2) >= 6)
{
richTextBox1.SelectionStart = j1;
richTextBox1.SelectionLength = str2.Length;
richTextBox1.SelectionColor = Color.Red;
if
(errorlist.Items.IndexOf(lineno(richTextBox1.Text, j1).ToString() + "
Error-- Range of WIDTH must be in Between 1 to 6 ") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
j1).ToString() + " Error-- Range of WIDTH must be in Between 1 to 6
");
compilestatus = 1;
}
}
else if (attribute[l1].Trim() == "FACE" && (str1 ==
"<BASEFONT>" || str1 == "<FONT>"))
{
int j1, k1;
string[] faceattrib = { "B", "I", "U", "ARIAL",
"TIMESNEWROMAN", "VERDANA", "ARIALBLACK",
"COURIERNEW", "MONOTYPECORSIVA" };
j1 = richTextBox1.Find("FACE", i,
RichTextBoxFinds.None);
j1 = richTextBox1.Find("=", j1,
RichTextBoxFinds.None) + 1;
for (k1 = j1; Text.Substring(k1, 1) != ">" &&
Text.Substring(k1, 1) != " "; k1++)
{}
string str2 = Text.Substring(j1, k1 - j1);
MessageBox.Show(str2);
int x = 0;
for (x = 0; x < faceattrib.Length; x++)
{
if (faceattrib[x] == str2)
break;

if (x == faceattrib.Length)
{
richTextBox1.SelectionStart = j1;
richTextBox1.SelectionLength = str2.Length;
richTextBox1.SelectionColor = Color.Red;
if
(errorlist.Items.IndexOf(lineno(richTextBox1.Text, j1).ToString() + "
Error-- The value of FACE is undefined ") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
j1).ToString() + " Error-- The value of FACE is undefined ");
compilestatus = 1;
}
}

else if (attribute[l1].Trim() == "ALIGN" && (str1 ==


"<P>" || str1 == "<HR>" || str1 == "<TABLE>" || str1 == "<TR>" || str1
== "<TH>" || str1 == "<IMG>"))
{
int j1, k1;
string[] alignattrib = { "CENTER", "LEFT",
"RIGHT" };
j1 = richTextBox1.Find("ALIGN", i,
RichTextBoxFinds.None);
j1 = richTextBox1.Find("=", j1,
RichTextBoxFinds.None) + 1;
for (k1 = j1; Text.Substring(k1, 1) != ">" &&
Text.Substring(k1, 1) != " "; k1++)
{}
string str2 = Text.Substring(j1, k1 - j1);
MessageBox.Show(str2);
int x = 0;
for (x = 0; x < alignattrib.Length; x++)
{
if (alignattrib[x] == str2)
break;

if (x == alignattrib.Length)
{
richTextBox1.SelectionStart = j1;
richTextBox1.SelectionLength = str2.Length;
richTextBox1.SelectionColor = Color.Red;
if
(errorlist.Items.IndexOf(lineno(richTextBox1.Text, j1).ToString() + "
Error-- The value of ALIGN is undefined ") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
j1).ToString() + " Error-- The value of ALIGN is undefined ");
compilestatus = 1;
}
}
else if (attribute[l1].Trim() == "START" && (str1 ==
"<OL>"))
{
int j1, k1;
j1 = richTextBox1.Find("START", i,
RichTextBoxFinds.None);
j1 = richTextBox1.Find("=", j1,
RichTextBoxFinds.None) + 1;
for (k1 = j1; Text.Substring(k1, 1) != ">" &&
Text.Substring(k1, 1) != " "; k1++)
{}
string str2 = Text.Substring(j1, k1 - j1);
MessageBox.Show(str2);
if (Int32.Parse(str2) < 1)
{
richTextBox1.SelectionStart = j1;
richTextBox1.SelectionLength = str2.Length;
richTextBox1.SelectionColor = Color.Red;
if
(errorlist.Items.IndexOf(lineno(richTextBox1.Text, j1).ToString() + "
Error-- Value of START must be greater than 1 ") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
j1).ToString() + " Error-- Value of START must be greater than 1 ");
compilestatus = 1;
}
}
else if (attribute[l1].Trim() == "TYPE" && (str1 ==
"<OL>"))
{
int j1, k1;
string[] typeattrib = { "1", "I", "i", "A", "a" };
j1 = richTextBox1.Find("TYPE", i,
RichTextBoxFinds.None);
j1 = richTextBox1.Find("=", j1,
RichTextBoxFinds.None) + 1;
for (k1 = j1; Text.Substring(k1, 1) != ">" &&
Text.Substring(k1, 1) != " "; k1++)
{}
string str2 = Text.Substring(j1, k1 - j1);
MessageBox.Show(str2);
int x = 0;
for (x = 0; x < typeattrib.Length; x++)
{
if (typeattrib[x] == str2)
break;

if (x == typeattrib.Length)
{
richTextBox1.SelectionStart = j1;
richTextBox1.SelectionLength = str2.Length;
richTextBox1.SelectionColor = Color.Red;
if
(errorlist.Items.IndexOf(lineno(richTextBox1.Text, j1).ToString() + "
Error-- The value of TYPE is undefined ") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
j1).ToString() + " Error-- The value of TYPE is undefined ");
compilestatus = 1;
}
}
else if (attribute[l1].Trim() == "TYPE" && (str1 ==
"<UL>"))
{
int j1, k1;
string[] typeattrib = { "CIRCLE", "DISC",
"SQUARE" };
j1 = richTextBox1.Find("TYPE", i,
RichTextBoxFinds.None);
j1 = richTextBox1.Find("=", j1,
RichTextBoxFinds.None) + 1;
for (k1 = j1; Text.Substring(k1, 1) != ">" &&
Text.Substring(k1, 1) != " "; k1++)
{}
string str2 = Text.Substring(j1, k1 - j1);
MessageBox.Show(str2);
int x = 0;
for (x = 0; x < typeattrib.Length; x++)
{
if (typeattrib[x] == str2)
break;

if (x == typeattrib.Length)
{
richTextBox1.SelectionStart = j1;
richTextBox1.SelectionLength = str2.Length;
richTextBox1.SelectionColor = Color.Red;
if
(errorlist.Items.IndexOf(lineno(richTextBox1.Text, j1).ToString() + "
Error-- The value of TYPE is undefined ") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
j1).ToString() + " Error-- The value of TYPE is undefined ");
compilestatus = 1;
}
}

else if (attribute[l1].Trim() == "CELLSPACING" &&


(str1 == "<TABLE>"))
{
int j1, k1;
j1 = richTextBox1.Find("CELLSPACING", i,
RichTextBoxFinds.None);
j1 = richTextBox1.Find("=", j1,
RichTextBoxFinds.None) + 1;
for (k1 = j1; Text.Substring(k1, 1) != ">" &&
Text.Substring(k1, 1) != " "; k1++)
{}
string str2 = Text.Substring(j1, k1 - j1);
MessageBox.Show(str2);
if (Int32.Parse(str2) <= 1 || Int32.Parse(str2) >= 3)
{
richTextBox1.SelectionStart = j1;
richTextBox1.SelectionLength = str2.Length;
richTextBox1.SelectionColor = Color.Red;
if
(errorlist.Items.IndexOf(lineno(richTextBox1.Text, j1).ToString() + "
Error-- Range of CELLSPACING must be in Between 1 to 3 ") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
j1).ToString() + " Error-- Range of CELLSPACING must be in
Between 1 to 3 ");
compilestatus = 1;
}

else if (attribute[l1].Trim() == "CELLPADDING" &&


(str1 == "<TABLE>"))
{
int j1, k1;
j1 = richTextBox1.Find("CELLPADDING", i,
RichTextBoxFinds.None);
j1 = richTextBox1.Find("=", j1,
RichTextBoxFinds.None) + 1;
for (k1 = j1; Text.Substring(k1, 1) != ">" &&
Text.Substring(k1, 1) != " "; k1++)
{}
string str2 = Text.Substring(j1, k1 - j1);
MessageBox.Show(str2);
if (Int32.Parse(str2) <= 1 || Int32.Parse(str2) >= 3)
{
richTextBox1.SelectionStart = j1;
richTextBox1.SelectionLength = str2.Length;
richTextBox1.SelectionColor = Color.Red;
if
(errorlist.Items.IndexOf(lineno(richTextBox1.Text, j1).ToString() + "
Error-- Range of CELLPADDING must be in Between 1 to 3 ") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
j1).ToString() + " Error-- Range of CELLPADDING must be in
Between 1 to 3 ");
compilestatus = 1;
}

else if (attribute[l1].Trim() == "BACKGROUND"


&& (str1 == "<TH>" || str1 == "<TR>"))
{
int j1, k1;
string[] backgroundattrib = { "D:'\'Documents and
Settings'\'All Users'\'Documents'\'My Pictures" };
j1 = richTextBox1.Find("BACKGROUND", i,
RichTextBoxFinds.None);
j1 = richTextBox1.Find("=", j1,
RichTextBoxFinds.None) + 1;
for (k1 = j1; Text.Substring(k1, 1) != ">" &&
Text.Substring(k1, 1) != " "; k1++)
{}
string str2 = Text.Substring(j1, k1 - j1);
MessageBox.Show(str2);
int x = 0;
for (x = 0; x < backgroundattrib.Length; x++)
{
if (backgroundattrib[x] == str2)
break;
}

if (x == backgroundattrib.Length)
{
richTextBox1.SelectionStart = j1;
richTextBox1.SelectionLength = str2.Length;
richTextBox1.SelectionColor = Color.Red;
if
(errorlist.Items.IndexOf(lineno(richTextBox1.Text, j1).ToString() + "
Error-- The value of BACKGROUND is undefined ") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
j1).ToString() + " Error-- The value of BACKGROUND is undefined
");
compilestatus = 1;
}
}

else if (attribute[l1].Trim() == "BORDER" && (str1


== "<TABLE>"))
{
int j1, k1;
j1 = richTextBox1.Find("BORDER", i,
RichTextBoxFinds.None);
j1 = richTextBox1.Find("=", j1,
RichTextBoxFinds.None) + 1;
for (k1 = j1; Text.Substring(k1, 1) != ">" &&
Text.Substring(k1, 1) != " "; k1++)
{}
string str2 = Text.Substring(j1, k1 - j1);
MessageBox.Show(str2);
if (Int32.Parse(str2) < 1 || Int32.Parse(str2) > 5)
{
richTextBox1.SelectionStart = j1;
richTextBox1.SelectionLength = str2.Length;
richTextBox1.SelectionColor = Color.Red;
if
(errorlist.Items.IndexOf(lineno(richTextBox1.Text, j1).ToString() + "
Error-- Range of BORDER must be in Between 1 to 5 ") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
j1).ToString() + " Error-- Range of BORDER must be in Between 1 to 5
");
compilestatus = 1;
}

}
else if (attribute[l1].Trim() == "COLS" && (str1 ==
"<FRAMESET>"))
{
int j1, k1;
j1 = richTextBox1.Find("COLS", i,
RichTextBoxFinds.None);
j1 = richTextBox1.Find("=", j1,
RichTextBoxFinds.None) + 1;
for (k1 = j1; Text.Substring(k1, 1) != ">" &&
Text.Substring(k1, 1) != " "; k1++)
{}
string str2 = Text.Substring(j1, k1 - j1);
MessageBox.Show(str2);
if (Int32.Parse(str2) > 100)
{
richTextBox1.SelectionStart = j1;
richTextBox1.SelectionLength = str2.Length;
richTextBox1.SelectionColor = Color.Red;
if
(errorlist.Items.IndexOf(lineno(richTextBox1.Text, j1).ToString() + "
Error-- Percentage of COLS must be less than or equal to 100% ") ==
-1)
errorlist.Items.Add(lineno(richTextBox1.Text,
j1).ToString() + " Error-- Percentage of COLS must be less than or
equal to 100% ");
compilestatus = 1;
}

}
else if (attribute[l1].Trim() == "ROWS" && (str1 ==
"<FRAMESET>"))
{
int j1, k1;
j1 = richTextBox1.Find("ROWS", i,
RichTextBoxFinds.None);
j1 = richTextBox1.Find("=", j1,
RichTextBoxFinds.None) + 1;
for (k1 = j1; Text.Substring(k1, 1) != ">" &&
Text.Substring(k1, 1) != " "; k1++)
{}
string str2 = Text.Substring(j1, k1 - j1);
MessageBox.Show(str2);
if (Int32.Parse(str2) > 100)
{
richTextBox1.SelectionStart = j1;
richTextBox1.SelectionLength = str2.Length;
richTextBox1.SelectionColor = Color.Red;
if
(errorlist.Items.IndexOf(lineno(richTextBox1.Text, j1).ToString() + "
Error-- Percentage of ROWS must be less than or equal to 100% ") ==
-1)
errorlist.Items.Add(lineno(richTextBox1.Text,
j1).ToString() + " Error-- Percentage of ROWS must be less than or
equal to 100% ");
compilestatus = 1;
}

}
else if (attribute[l1].Trim() == "METHOD" && (str1
== "<FORM>"))
{
int j1, k1;
string[] methodattrib = { "get", "set" };
j1 = richTextBox1.Find("METHOD", i,
RichTextBoxFinds.None);
j1 = richTextBox1.Find("=", j1,
RichTextBoxFinds.None) + 1;
for (k1 = j1; Text.Substring(k1, 1) != ">" &&
Text.Substring(k1, 1) != " "; k1++)
{}
string str2 = Text.Substring(j1, k1 - j1);
MessageBox.Show(str2);
int x = 0;
for (x = 0; x < methodattrib.Length; x++)
{
if (methodattrib[x] == str2)
break;

if (x == methodattrib.Length)
{
richTextBox1.SelectionStart = j1;
richTextBox1.SelectionLength = str2.Length;
richTextBox1.SelectionColor = Color.Red;
if
(errorlist.Items.IndexOf(lineno(richTextBox1.Text, j1).ToString() + "
Error-- The value of METHOD is undefined ") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
j1).ToString() + " Error-- The value of METHOD is undefined ");
compilestatus = 1;
}
}
else if (attribute[l1].Trim() == "TYPE" && (str1 ==
"<INPUT>"))
{
int j1, k1;
string[] typeattrib = { "RADIO", "CHECKBOX",
"SUBMIT", "TEXT" };
j1 = richTextBox1.Find("TYPE", i,
RichTextBoxFinds.None);
j1 = richTextBox1.Find("=", j1,
RichTextBoxFinds.None) + 1;
for (k1 = j1; Text.Substring(k1, 1) != ">" &&
Text.Substring(k1, 1) != " "; k1++)
{}
string str2 = Text.Substring(j1, k1 - j1);
MessageBox.Show(str2);
int x = 0;
for (x = 0; x < typeattrib.Length; x++)
{
if (typeattrib[x] == str2)
break;

if (x == typeattrib.Length)
{
richTextBox1.SelectionStart = j1;
richTextBox1.SelectionLength = str2.Length;
richTextBox1.SelectionColor = Color.Red;
if
(errorlist.Items.IndexOf(lineno(richTextBox1.Text, j1).ToString() + "
Error-- The value of TYPE is undefined ") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
j1).ToString() + " Error-- The value of TYPE is undefined ");
compilestatus = 1;
}
}
else if (attribute[l1].Trim() == "CHARSET" && (str1
== "<META>"))
{
int j1, k1;
string[] charsetattrib = { "CHARACTER",
"ENCODING" };
j1 = richTextBox1.Find("CHARSET", i,
RichTextBoxFinds.None);
j1 = richTextBox1.Find("=", j1,
RichTextBoxFinds.None) + 1;
for (k1 = j1; Text.Substring(k1, 1) != ">" &&
Text.Substring(k1, 1) != " "; k1++)
{}
string str2 = Text.Substring(j1, k1 - j1);
MessageBox.Show(str2);
int x = 0;
for (x = 0; x < charsetattrib.Length; x++)
{
if (charsetattrib[x] == str2)
break;

if (x == charsetattrib.Length)
{
richTextBox1.SelectionStart = j1;
richTextBox1.SelectionLength = str2.Length;
richTextBox1.SelectionColor = Color.Red;
if
(errorlist.Items.IndexOf(lineno(richTextBox1.Text, j1).ToString() + "
Error-- The value of CHARSET is undefined ") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
j1).ToString() + " Error-- The value of CHARSET is undefined ");
compilestatus = 1;
}
}
else if (attribute[l1].Trim() == "NAME" && (str1 ==
"<META>"))
{
int j1, k1;
string[] nameattrib = { "author", "description",
"keywords", "generator", "revised" };
j1 = richTextBox1.Find("NAME", i,
RichTextBoxFinds.None);
j1 = richTextBox1.Find("=", j1,
RichTextBoxFinds.None) + 1;
for (k1 = j1; Text.Substring(k1, 1) != ">" &&
Text.Substring(k1, 1) != " "; k1++)
{}
string str2 = Text.Substring(j1, k1 - j1);
MessageBox.Show(str2);
int x = 0;
for (x = 0; x < nameattrib.Length; x++)
{
if (nameattrib[x] == str2)
break;

if (x == nameattrib.Length)
{
richTextBox1.SelectionStart = j1;
richTextBox1.SelectionLength = str2.Length;
richTextBox1.SelectionColor = Color.Red;
if
(errorlist.Items.IndexOf(lineno(richTextBox1.Text, j1).ToString() + "
Error-- The value of NAME is undefined ") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
j1).ToString() + " Error-- The value of NAME is undefined ");
compilestatus = 1;
}
}
else if (attribute[l1].Trim() == "HTTP-EQUIV" &&
(str1 == "<META>"))
{
int j1, k1;
string[] httpattrib = { "content-type", "expires",
"refresh", "set-cookie" };
j1 = richTextBox1.Find("HTTP-EQUIV", i,
RichTextBoxFinds.None);
j1 = richTextBox1.Find("=", j1,
RichTextBoxFinds.None) + 1;
for (k1 = j1; Text.Substring(k1, 1) != ">" &&
Text.Substring(k1, 1) != " "; k1++)
{}
string str2 = Text.Substring(j1, k1 - j1);
MessageBox.Show(str2);
int x = 0;
for (x = 0; x < httpattrib.Length; x++)
{
if (httpattrib[x] == str2)
break;

if (x == httpattrib.Length)
{
richTextBox1.SelectionStart = j1;
richTextBox1.SelectionLength = str2.Length;
richTextBox1.SelectionColor = Color.Red;
if
(errorlist.Items.IndexOf(lineno(richTextBox1.Text, j1).ToString() + "
Error-- The value of HTTP-EQUIV is undefined ") == -1)
errorlist.Items.Add(lineno(richTextBox1.Text,
j1).ToString() + " Error-- The value of HTTP-EQUIV is undefined ");
compilestatus = 1;
}
}
}

}
}
}

for (int l1 = 0; l1 < l;l1++)


{
MessageBox.Show(attribute[l1]);
}
}
int attributetagindex(string Tag)
{
for (int i = 0; i < attribute.Length; i++)
{
if (attrib[i, 0] == Tag)
return i;

}
return -1;
}
void attributecheck(string Text)
{

}
int attributeindex(string attribute1, int r)
{
for (int i = 0; i < 10; i++)
{
if (attrib[r, i] == attribute1)
return i;
}
return -1;
}

public Form1()
{
this.Text = "untitled";
InitializeComponent();
}

private void fileToolStripMenuItem_Click(object sender,


EventArgs e)
{
}

private void Form1_Load(object sender, EventArgs e)


{
this.Text = "Untitled";
attrib[0, 0] = "<FONT>";
attrib[0, 1] = "FACE";
attrib[0, 2] = "SIZE";
attrib[0, 3] = "COLOR";
attrib[1, 0] = "<BODY>";
attrib[1, 1] = "BGCOLOR";
attrib[1, 2] = "BACKGROUND";
attrib[1, 3] = "TEXT";
attrib[1, 4] = "RIGHTMARGIN";
attrib[1, 5] = "LEFTMARGIN";
attrib[1, 6] = "LINK";
attrib[1, 7] = "VLINK";
attrib[1, 8] = "ALINK";
attrib[2,0] = "<BASEFONT>";
attrib[2, 1] = "SIZE";
attrib[2, 2] = "FACE";
attrib[2, 3] = "COLOR";
attrib[3, 0] = "<P>";
attrib[3, 1] = "ALIGN";
attrib[4, 0] = "<HR>";
attrib[4, 1] = "ALIGN";
attrib[4, 2] = "WIDTH";
attrib[4, 3] = "SIZE";
attrib[4, 4] = "NOSHADE";
attrib[5, 0] = "<OL>";
attrib[5, 1] = "START";
attrib[5, 2] = "TYPE";
attrib[6, 0] = "<UL>";
attrib[6, 1] = "TYPE";
attrib[7, 0] = "<TABLE>";
attrib[7, 1] = "ALIGN";
attrib[7, 2] = "BGCOLOR";
attrib[7, 3] = "HEIGHT";
attrib[7, 4] = "BORDER";
attrib[7, 5] = "WIDTH";
attrib[7, 6] = "CELLPADDING";
attrib[7, 7] = "CELLSPACING";
attrib[8, 0] = "<TR>";
attrib[8, 1] = "VALIGN";
attrib[8, 2] = "ALIGN";
attrib[8, 3] = "BGCOLOR";
attrib[9, 0] = "<TH>";
attrib[9, 1] = "VALIGN";
attrib[9, 2] = "ALIGN";
attrib[9, 3] = "BGCOLOR";
attrib[10, 0] = "<A>";
attrib[10, 1] = "HREF";
attrib[10, 2] = "NAME";
attrib[10, 3] = "TITLE";
attrib[10, 4] = "ALT";
attrib[11, 0] = "<IMG>";
attrib[11, 1] = "SRC";
attrib[11, 2] = "ALIGN";
attrib[11, 3] = "BORDER";
attrib[11, 4] = "WIDTH";
attrib[11, 5] = "HEIGHT";
attrib[11, 6] = "ALT";
attrib[12, 0] = "<FRAMESET>";
attrib[12, 1] = "COLS";
attrib[12, 2] = "ROWS";
attrib[13, 0] = "<BASE>";
attrib[13, 1] = "HREF";
attrib[13, 2] = "TARGET";
attrib[14, 0] = "<FORM>";
attrib[14, 1] = "NAME";
attrib[14, 2] = "ACTION";
attrib[14, 3] = "METHOD";
attrib[15, 0] = "<INPUT>";
attrib[15, 1] = "TYPE";
attrib[15, 2] = "NAME";
attrib[15, 3] = "VALUE";
attrib[16, 0] = "FRAME";
attrib[16, 1] = "SRC";
attrib[17, 0] = "META";
attrib[17, 1] = "NAME";
attrib[17, 2] = "CONTENT";
attrib[17, 3] = "HTTP-EQUIV";
attrib[16, 0] = "CHARSET";
attrib[16, 1] = "SCHEME";
}
private void menucompile_Click(object sender, EventArgs e)
{
compilestatus = 2;
errorlist.Items.Clear();
richTextBox1.SelectAll();
string s = richTextBox1.Text;
while (s.Replace(" ", " ") != s)
s = s.Replace(" ", " ");
richTextBox1.Text = s;

richTextBox1.SelectionColor = Color.Black;
checkTags(richTextBox1.Text);
tagcheck(richTextBox1.Text.ToUpper());
tagordercheck(richTextBox1.Text.ToUpper());
singleentrytags(richTextBox1.Text.ToUpper());
try
{
positioncheck(richTextBox1.Text.ToUpper());
frameset(richTextBox1.Text.ToUpper());
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
commenttag(richTextBox1.Text.ToUpper());
metatag(richTextBox1.Text.ToUpper());
bodytagcheck(richTextBox1.Text.ToUpper());
attributetag(richTextBox1.Text.ToUpper());
MessageBox.Show("Compiled");
}

private void menucopy_Click(object sender, EventArgs e)


{
richTextBox1.Copy();

private void menupaste_Click(object sender, EventArgs e)


{
richTextBox1.Paste();
}

private void menusave_Click(object sender, EventArgs e)


{
try
{
if (this.Text == "Untitled")
{
saveFileDialog1.Filter = "HTML Document|*.html";
saveFileDialog1.ShowDialog();
System.IO.StreamWriter sw = new
System.IO.StreamWriter(saveFileDialog1.FileName);
sw.WriteLine(richTextBox1.Text);
sw.Close();
// richTextBox1.SaveFile(saveFileDialog1.FileName);
this.Text = saveFileDialog1.FileName;
filename = saveFileDialog1.FileName;
savestatus = 1;
}
else
{
System.IO.StreamWriter sw = new
System.IO.StreamWriter(filename);
sw.WriteLine(richTextBox1.Text);
sw.Close();

// richTextBox1.SaveFile(this.Text);
// filename = openFileDialog1.FileName;
savestatus = 1;
}
}
catch (Exception x)
{
MessageBox.Show(x.Message);
}
}

private void menuopen_Click(object sender, EventArgs e)


{
try
{
openFileDialog1.Filter = "Html Documents|*.html";
openFileDialog1.ShowDialog();
System.IO.StreamReader sr = new
System.IO.StreamReader(openFileDialog1.FileName);
richTextBox1.Text=sr.ReadToEnd();
sr.Close();
//richTextBox1.LoadFile(openFileDialog1.FileName);
filename = openFileDialog1.FileName;
this.Text = openFileDialog1.FileName;
savestatus = 1;
}
catch (Exception x)
{
MessageBox.Show(x.Message);
}
}

private void colorToolStripMenuItem_Click(object sender,


EventArgs e)
{
colorDialog1.ShowDialog();
richTextBox1.SelectionColor = colorDialog1.Color;
}

private void menunew_Click(object sender, EventArgs e)


{
savestatus = 0;
try
{
if (this.Text == "untitled" &&
richTextBox1.Text.Trim().Length > 0)
{
DialogResult a;
a = MessageBox.Show("do u want to save");
if (a == DialogResult.Yes)
{
if (this.Text == "Untitled")
{
saveFileDialog1.Filter = "*.html";
saveFileDialog1.ShowDialog();
richTextBox1.SaveFile(saveFileDialog1.FileName);
this.Text = saveFileDialog1.FileName;
}
else
{
richTextBox1.SaveFile(this.Text);
}
}
else if (a == DialogResult.No)
{
richTextBox1.Text = "";
this.Text = "Untitled";

}
}
StringBuilder str = new StringBuilder();
str.Append("<HTML>\n");
str.Append("<HEAD>\n");
str.Append("<TITLE>\n");
str.Append("</TITLE>\n");
str.Append("</HEAD>\n");
str.Append("<BODY>\n");
str.Append("</BODY>\n");
str.Append("</HTML>\n");
richTextBox1.SelectedText = str.ToString();
}
catch(Exception x)
{
MessageBox.Show(x.Message);
}
}

private void menufont_Click_1(object sender, EventArgs e)


{
fontDialog1.ShowDialog();
richTextBox1.SelectionFont = fontDialog1.Font;
}

private void menusaveas_Click_1(object sender, EventArgs e)


{
try
{
if (this.Text == "Untitled")
{
saveFileDialog1.Filter = "HTML Document|*.html";
saveFileDialog1.ShowDialog();
System.IO.StreamWriter sw = new
System.IO.StreamWriter(saveFileDialog1.FileName);
sw.WriteLine(richTextBox1.Text);
sw.Close();

// richTextBox1.SaveFile(saveFileDialog1.FileName);
this.Text = saveFileDialog1.FileName;
filename = saveFileDialog1.FileName;
savestatus = 1;
}
}
catch (Exception x)
{
MessageBox.Show(x.Message);
}
}

private void menuexit_Click(object sender, EventArgs e)


{
Application.Exit();
}

private void listBox1_SelectedIndexChanged(object sender,


EventArgs e)
{
string str = errorlist.SelectedItem.ToString();
int line = Int32.Parse(str.Substring(0, str.IndexOf(" ")));
int count = 0,i=0;
for ( i = 0; i < richTextBox1.Text.Length; i++)
{

if (richTextBox1.Text.IndexOf((char)10, i) != -1)
{

count++;

if (count == line)
break;
i = richTextBox1.Text.IndexOf((char)10, i) + 1;

}
}
richTextBox1.SelectionStart = i;
richTextBox1.Focus();

}
public int lineno(string s,int pos)
{
int count = 0;
for (int i = 0; i <= pos; i++)
{

if (s.IndexOf((char)10, i) != -1 )
{
count++;
i = s.IndexOf((char)10, i) + 1;

}
}
return count;
}

private void menutoolbars_Click(object sender, EventArgs e)


{
toolStrip1.Visible = !toolStrip1.Visible;
}

private void menuStrip1_ItemClicked(object sender,


ToolStripItemClickedEventArgs e)
{

private void toolStrip1_ItemClicked(object sender,


ToolStripItemClickedEventArgs e)
{

private void toolStripButton3_Click(object sender, EventArgs e)


{
richTextBox1.SelectedText = "<IMG SRC= HEIGHT=
WIDTH= BORDER= ALT= ALIGN=CENTER>";
}

private void toolStripButton4_Click(object sender, EventArgs e)


{
StringBuilder str = new StringBuilder();
str.Append("<FONT BGCOLOR= SIZE= COLOR= >\n");
str.Append("</FONT>");
richTextBox1.SelectedText = str.ToString();
}

private void toolStripButton1_Click(object sender, EventArgs e)


{
richTextBox1.SelectedText = "<BR>";
}

private void toolStripButton2_Click(object sender, EventArgs e)


{
richTextBox1.SelectedText = "<HR>";
}

private void toolStripButton6_Click(object sender, EventArgs e)


{
StringBuilder str = new StringBuilder();
str.Append("<TABLE ALIGN=CENTER HEIGHT= WIDTH=
CELLSPACING= CELLPADDING= BORDER= BGCOLOR= >\n");
str.Append("</TABLE>");
richTextBox1.SelectedText = str.ToString();
}

private void toolStripButton8_Click(object sender, EventArgs e)


{
richTextBox1.SelectedText = "<CENTER>";
}

private void toolStripButton9_Click(object sender, EventArgs e)


{
StringBuilder str = new StringBuilder();
str.Append("<FORM NAME= ACTION= METHOD=get>\n");
str.Append("</FORM>");
richTextBox1.SelectedText = str.ToString();

private void toolStripButton5_Click(object sender, EventArgs e)


{
StringBuilder str = new StringBuilder();
str.Append("<A HREF= NAME= TITLE= ALT= >\n");
str.Append("</A>");
richTextBox1.SelectedText = str.ToString();
}
int savestatus = 0;
private void internalBrowserToolStripMenuItem_Click(object
sender, EventArgs e)
{

if (compilestatus == 2)
{
if (filename != ""&& savestatus==1)
{
Form2 f = new Form2(filename);
f.Show();

}
else
{
MessageBox.Show("firstly save the file");

}
}
else
{
MessageBox.Show("first compile the file");
}
}

private void menuundo_Click(object sender, EventArgs e)


{
richTextBox1.Undo();
}

private void menucut_Click(object sender, EventArgs e)


{
richTextBox1.Cut();
}

private void menuselectall_Click(object sender, EventArgs e)


{
richTextBox1.SelectionStart = 0;
richTextBox1.SelectionLength = richTextBox1.Text.Length;
}

private void menustatusbar_Click(object sender, EventArgs e)


{
statusStrip1.Visible = !statusStrip1.Visible;
}

private void externalBrowserToolStripMenuItem_Click(object


sender, EventArgs e)
{

if (compilestatus == 2)
{
try
{
System.Diagnostics.Process p = new
System.Diagnostics.Process();
p.StartInfo.FileName =
@"C:\progra~1\intern~1\IEXPLORE.EXE ";
p.StartInfo.Arguments = filename;
p.Start();
}
catch (Exception ex)
{}
}
else
{
MessageBox.Show("first compile the file");
}
}

private void toolcomment_Click(object sender, EventArgs e)


{
StringBuilder str = new StringBuilder();
str.Append("<!-- -->\n");
richTextBox1.SelectedText = str.ToString();
}

private void menunew_MouseMove(object sender,


MouseEventArgs e)
{
toolStripStatusLabel1.Text = "Create a new file";
}
private void menuopen_MouseMove(object sender,
MouseEventArgs e)
{
toolStripStatusLabel1.Text = "open file";
}

private void menusave_MouseMove(object sender,


MouseEventArgs e)
{
toolStripStatusLabel1.Text = "save file";
}

private void menusaveas_MouseMove(object sender,


MouseEventArgs e)
{
toolStripStatusLabel1.Text = "save file as";
}

private void menuexit_MouseMove(object sender,


MouseEventArgs e)
{
toolStripStatusLabel1.Text = "exit from form";
}

private void menuundo_MouseMove(object sender,


MouseEventArgs e)
{
toolStripStatusLabel1.Text = "Undo";
}

private void menucut_MouseMove(object sender,


MouseEventArgs e)
{
toolStripStatusLabel1.Text ="Cut contents";
}

private void menucopy_MouseMove(object sender,


MouseEventArgs e)
{
toolStripStatusLabel1.Text = "Copy contents";
}

private void menupaste_MouseMove(object sender,


MouseEventArgs e)
{
toolStripStatusLabel1.Text = "Paste contents ";

private void menuselectall_MouseMove(object sender,


MouseEventArgs e)
{
toolStripStatusLabel1.Text = "Select all contents ";

private void menucompile_MouseMove(object sender,


MouseEventArgs e)
{
toolStripStatusLabel1.Text = "Compile the file ";

private void
internalBrowserToolStripMenuItem_MouseMove(object sender,
MouseEventArgs e)
{
toolStripStatusLabel1.Text = "View in internal browser ";

private void
externalBrowserToolStripMenuItem_MouseMove(object sender,
MouseEventArgs e)
{
toolStripStatusLabel1.Text = "View in external browser ";

private void menutoolbars_MouseMove(object sender,


MouseEventArgs e)
{
toolStripStatusLabel1.Text = "Show toolbar ";

private void menustatusbar_MouseMove(object sender,


MouseEventArgs e)
{
toolStripStatusLabel1.Text = "Show statusbar ";

private void menufont_MouseMove(object sender,


MouseEventArgs e)
{
toolStripStatusLabel1.Text = "Show font window";

private void menucolor_MouseMove(object sender,


MouseEventArgs e)
{
toolStripStatusLabel1.Text = "Show color window ";

private void aboutToolStripMenuItem_Click(object sender,


EventArgs e)
{
AboutBox1 a=new AboutBox1();
a.Show();
}

private void aboutToolStripMenuItem_Click_1(object sender,


EventArgs e)
{
AboutBox1 a = new AboutBox1();
a.Show();
}
private void richTextBox1_TextChanged(object sender, EventArgs
e)
{
savestatus = 0;
}

private void formatToolStripMenuItem_Click(object sender,


EventArgs e)
{

}
}

CODING OF FORM 2 (INTERNAL BROWSER)

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace HTML_DEBUGGER
{
public partial class Form2 : Form
{
String filename;
public Form2()
{
InitializeComponent();
}
public Form2(String s)
{
filename = s;
InitializeComponent();
}

private void webBrowser1_DocumentCompleted(object sender,


WebBrowserDocumentCompletedEventArgs e)
{

private void Form2_Load(object sender, EventArgs e)


{
webBrowser1.Navigate(filename);
}

private void toolStripButton1_Click(object sender, EventArgs e)


{
webBrowser1.GoBack();
}

private void toolStripButton2_Click(object sender, EventArgs e)


{
webBrowser1.GoForward();
}

private void toolStripButton3_Click(object sender, EventArgs e)


{
webBrowser1.Stop();
}
private void toolStripButton4_Click(object sender, EventArgs e)
{
webBrowser1.Refresh();
}

private void toolStripButton5_Click(object sender, EventArgs e)


{
webBrowser1.GoHome();
}

private void toolStripButton6_Click(object sender, EventArgs e)


{
webBrowser1.GoSearch();
}
}
}

CODING OF FORM 3 (SPLASH SCREEN)

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace HTML_DEBUGGER
{
public partial class Form3 : Form
{
public Form3()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
Form1 f = new Form1();
f.Show();
this.Hide();
timer1.Stop();
//this.Close();
}
private void Form3_Load(object sender, EventArgs e)
{
timer1.Interval = 5000;
timer1.Start();
}
private void pictureBox1_Click(object sender, EventArgs e)
{
}
}
}

CODING OF FORM 4 (ABOUT BOX)

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using System.Reflection;

namespace HTML_DEBUGGER
{
partial class AboutBox1 : Form
{
public AboutBox1()
{
InitializeComponent();
}

#region Assembly Attribute Accessors

public string AssemblyTitle


{
get
{
if (attributes.Length > 0)
{
AssemblyTitleAttribute titleAttribute =
(AssemblyTitleAttribute)attributes[0];
if (titleAttribute.Title != "")
return titleAttribute.Title;
}
}
}

public string AssemblyVersion


{
get
{
return
Assembly.GetExecutingAssembly().GetName().Version.ToString();
}
}

public string AssemblyDescription


{
get
{
object[] attributes =
Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(Asse
mblyDescriptionAttribute), false);
if (attributes.Length == 0)
return "";
return
((AssemblyDescriptionAttribute)attributes[0]).Description;
}
}

public string AssemblyProduct


{
get
{
object[] attributes =
Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(Asse
mblyProductAttribute), false);
if (attributes.Length == 0)
return "";
return ((AssemblyProductAttribute)attributes[0]).Product;
}
}

public string AssemblyCopyright


{
get
{
object[] attributes =
Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(Asse
mblyCopyrightAttribute), false);
if (attributes.Length == 0)
return "";
return
((AssemblyCopyrightAttribute)attributes[0]).Copyright;
}
}

public string AssemblyCompany


{
get
{
object[] attributes =
Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(Asse
mblyCompanyAttribute), false);
if (attributes.Length == 0)
return "";
return ((AssemblyCompanyAttribute)attributes[0]).Company;
}
}
#endregion

private void okButton_Click(object sender, EventArgs e)


{
this.Close();
}

private void AboutBox1_Load(object sender, EventArgs e)


{

}
}
}

CHAPTER 5.E : ACCEPTANCE TESTING


Acceptance testing is black-box testing performed on a system (e.g.
software, lots of manufactured mechanical parts, or batches of chemical
products) prior to its delivery. It is also known as functional testing,
black-box testing, release acceptance, QA testing, application testing,
confidence testing, final testing, validation testing, or factory acceptance
testing.

In software development, acceptance testing by the system provider is


often distinguished from acceptance testing by the customer (the user or
client) prior to accepting transfer of ownership. In such environments,
acceptance testing performed by the customer is known as user
acceptance testing (UAT). This is also known as end-user testing, site
(acceptance) testing, or field (acceptance) testing.

Acceptance testing generally involves running a suite of tests on the


completed system. Each individual test, known as a case, exercises a
particular operating condition of the user's environment or feature of the
system, and will result in a pass or fail boolean outcome. There is
generally no degree of success or failure. The test environment is usually
designed to be identical, or as close as possible, to the anticipated user's
environment, including extremes of such. These test cases must each be
accompanied by test case input data or a formal description of the
operational activities (or both) to be performed—intended to thoroughly
exercise the specific case—and a formal description of the expected
results.

TEST CASES
1. TAG CHECK:-
To check whether tag is between open angular bracket or close angular
bracket eg. <HTML> if we not apply one of the open or close angular
bracket or make double entry of open/close bracket error is shown.

2. TAG ORDER CHECK:-


In this we will check the order of tags i.e. first HTML will come then
HEAD then TITLE then BODY and so on.
3. BODY TAG CHECK :-
In this we will check whether we have used empty and container tags in
<BODY>.If any tag which is not in the array of body tag we add inside
body it will show error.

4. ATTRIBUTE TAG CHECK :-


In this we have check whether a particular attribute belongs to a
particular tag and check whether the range of values are not undefined.

6. POSITION CHECK :-
In this test cases we checked that there must be no tag between
</BODY> and </HTML> , if any exist it show error as shown:-

7. FRAMESET TAG CHECK :-


In this we have check that frameset and body can’t come together.

CHAPTER 5.F : OUTPUTS


DESIGN OF FORM 1 (EDITOR)

FILE MENU OPTIONS


On clicking NEW option, the following code will appear :-
On clicking OPEN option, the following dialog box will appear
which ask us what file we want to open :-

On clicking SAVE option, the following dialog box will appear


which ask us where to save our file :-
On clicking SAVE AS, the following dialog box will appear
which will ask us where to save our file :-

On clicking EXIT we will come out of the project.


EDIT MENU OPTIONS :-

On clicking UNDO, the task which we have done previously is


undone.
On clicking CUT , the portion selected will be cut.
On clicking COPY, the portion selected will be copied.
On clicking PASTE, the portion cut or copied previously is now
pasted.

On clicking SELECT ALL, all the text portion which is written


is selected.
RUN MENU OPTIONS :-

On clicking COMPILE, the code will be compiled and a message


box will be appeared “COMPILED” :-
On clicking an error in the error list, the cursor will be placed in
the starting of the line consisting the error as shown :-

On clicking VIEW IN, two options will come :-


a) INTERNAL BROWSER
b) EXTERNAL BROWSER
On clicking INTERNAL BROWSER, the following window will
be appeared which will ask us to first compile the file :-

Now if we have compiled the file, then it will ask us to first


save the file as shown :-
Now on clicking INTERNAL BROWSER again, the new window
i.e. form2 will open in which we can see output as follows.

DESIGN OF FORM 2 (INTERNAL BROWSER)


Now on clicking EXTERNAL BROWSER, the same format will
appear i.e. first compile the file then save the file and then new
window i.e. INTERNET EXPLORER will open in which we can
see output as follows :-
VIEW MENU OPTIONS :-

On clicking TOOLBAR option, the toolbar will be made visible


or invisible to user :-

In this case the toolbar is made invisible to user.


On clicking STATUSBAR option, the statusbar will be made
visible or invisible to user :-

In this case also the status bar is made invisible to user.


FORMAT MENU OPTIONS :-

On clicking FONT option, the user will be able to select the font
of the text as shown :-
On clicking COLOR option, the user will be able to select the
color of the text as shown :-
TOOLBAR MENU OPTIONS :-
In this we have put some most commonly used tags such as
<BR>, <TABLE> etc. On clicking any of the tag, it will be
appeared in the text window with all its attributes and values of
some specified attributes :-
On clicking the <TABLE> attribute, the following code will
appear :-
DESIGN OF FORM 3 (SPLASH SCREEN)
DESIGN OF FORM 4 (ABOUT BOX)
CHAPTER 6 : LIMITATIONS

As we know that HTML is a scripting language. So, we can add any

kind of web pages- STATIC, DYNAMIC and ACTIVE . but here we

use only STATIC pages. As DYNAMIC pages are interactive and have

some links but we have not used any DYNAMIC page means no links

are added here. We have not used ACTIVE pages also means not used

any animations. Moreover we have not added any interaction with user.

This is the main limitation of the project- HTML DEBUGGER.


CHAPTER 7 : FALL OUTS OF THE PROJECT

HTML is HYPER TEXT MARKUP LANGUAGE. It is very simple

language and here we use simple coding. So, if a person is expert in

web designing or web development he or she can make simple website

and need not have any extra knowledge about it. User can compile the

errors and debug it and can see the output in the web browser.
CHAPTER 8 : SUGGESTION FOR FUTURE
WORK

We can extend our project by embedding PHP, JSP, PYTHON in

HTML. By following their syntax rules we can extend our project.

We can also extend our project by creating interactive and animated

web sites by using a combination of a static markup language (HTML),

a client-side scripting language (JAVA) , a presentation definition

language (CSS), and the Document Object Model.

We can extend our project by making pages a dynamic, colorful

appearance. We can also add and design borders for your pages and

insert navigation bars, which guide your users around your Web site.
CHAPTER 9 : CONCLUSION

HTML DEBUGGER can perform the following three functions.


a. EDITING
b. COMPILING
c. EXECUTING

Means here we have made the editor and menus in it like open,
save etc. now we can write simple code in HTML and put any
valid attribute and values of a particular tag, it first save the file,
then compile it and if errors come then debug it and after that it
show output in the browser-either in EXTERNAL BROWSER or
in INTERNAL BROWSER according to demand of user.
CHAPTER 10 : REFERENCES

1) http://www.wikipedia.com/editing.
2) http://www.w3schools.com/htmltags
3) http://www.wikipedia.com/compiling
4) http://www.wikipedia.com/kmpalgo
5) http://www.wikipedia.com/executing
6) http://www.msdnlibrary.com\_net system library - MSDN
Search.mht
7) Pankaj Jalote, AN INTEGRATED APPROCH TO SOFTWARE
PROJECT MANAGEMENT
8) Roger S. Pressman, SOFTWARE ENGINEERING
CHAPTER 11 : GLOSSARY

i. HTML :- An acronym for HyperText Markup


Language, is the predominant markup language for web
pages. It provides a means to describe the structure of
text-based information in a document.

ii. WWW :- The World Wide Web is an elaborate set of


interlinked hypertext documents accessed via the
Internet. With a Web browser, one can view Web pages
that may contain text, images, videos, and other
multimedia and navigate between them using
hyperlinks.

iii. CLR :- The Common Language Runtime is a core


component of Microsoft's .NET initiative. It is
Microsoft's implementation of the Common Language
Infrastructure (CLI) standard, which defines an
execution environment for program code.

iv. COM :- Component Object Model is an interface


standard for software componentry introduced by
Microsoft in 1993. It is used to enable interprocess
communication and dynamic object creation in a large
range of programming languages.

v. XML :- Extensible Markup Language is a general-


purpose specification for creating custom markup
languages.It is classified as an extensible language,
because it allows the user to define the mark-up
elements.

You might also like