SitePoint Sponsor |
|
User Tag List
Results 1 to 17 of 17
Thread: Parsing???
-
Mar 25, 2001, 15:35 #1
What the heck does it mean? LOL! This is probably a seriously newbie question, but I really don't know.
-
Mar 25, 2001, 15:54 #2
- Join Date
- Jul 1999
- Location
- Lancashire, UK
- Posts
- 8,277
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
From ZBWEBOPEDIA.
To PARSE:
In linguistics, to divide language into small components that can be analyzed. For example, parsing this sentence would involve dividing it into words and phrases and identifying the type of each component (e.g., verb, adjective, or noun).
Parsing is a very important part of many computer science disciplines. For example, compilers must parse source code to be able to translate it into object code. Likewise, any application that processes complex commands must be able to parse the commands. This includes virtually all end-user applications.
Parsing is often divided into lexical analysis and semantic parsing. Lexical analysis concentrates on dividing strings into components, called tokens, based on punctuation and other keys. Semantic parsing then attempts to determine the meaning of the string.
-
Mar 25, 2001, 15:57 #3
- Join Date
- May 2000
- Location
- Duluth, MN USA
- Posts
- 166
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
It means to interpert or process. for example, when you fill in a contact form and submit it, the form is read by a script, and the results are put into some format so they are meaningful and then delivered wherever they need to be delivered. The act of the script reading the input from the form and then sending some output is parsing.
Does that make some sense?
--BillLake Superior Smokin' Brews Make It Different: Brew Your Own!
L'Etoile du Nord Web Development Providing Real Direction in a Virtual World
MSN IM: smokinbrews-AT-hotmail-DOT-com
Brewin', Vintin' & Smokin' Forums Moderator
-
Mar 25, 2001, 17:38 #4
- Join Date
- Aug 2000
- Location
- Silicon Valley
- Posts
- 2,241
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I've just done one CS assignment, write a simple compiler, so I know by heart what is parsing and how painful it is to actually implement it!
But if anyone is interested in seeing the code (open source), here it is:
http://son.cubedom.com/SL.cup- Son Nguyen
AdSpeed.com - Ad Serving and Ad Management Made Easy
-
Mar 25, 2001, 22:00 #5
I have a decent idea of what it is now...but I am still not sure...Nicky, your definition made the most sense. But, can you help me apply it to a situation, for example the form example...I am constantly hearing webmasters talking about parsing files, but I never know why. Why would you want to parse a file? *just confused self even more*
-
Mar 25, 2001, 22:45 #6
- Join Date
- Jul 2000
- Location
- 80,000 feet below the surface
- Posts
- 1,442
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Real life analogy required here.
It's much like a person (the parser) reading an instruction manual (the code), and then performing the instructions in the manual to produce a new object, new application, create a new process, etc. (interpreting the code/executing all the functions/converting all the object code).
Is that nice and clear?
-
Mar 25, 2001, 22:59 #7Originally posted by BC
Real life analogy required here.
It's much like a person (the parser) reading an instruction manual (the code), and then performing the instructions in the manual to produce a new object, new application, create a new process, etc. (interpreting the code/executing all the functions/converting all the object code).
Is that nice and clear?
So, isn't the code always being parsed?
-
Mar 25, 2001, 23:02 #8
- Join Date
- Jul 2000
- Location
- 80,000 feet below the surface
- Posts
- 1,442
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You can say that. All code in different forms or fashions are being parsed by something (whether it's a compiler, parser or another thing).
e.g. A browser parses HTML and JavaScript to display text and images on your monitor screen
-
Mar 25, 2001, 23:28 #9Originally posted by BC
You can say that. All code in different forms or fashions are being parsed by something (whether it's a compiler, parser or another thing).
e.g. A browser parses HTML and JavaScript to display text and images on your monitor screen
But why do webmasters always say they are going to parse a file? Do they want to check it out or something?
-
Mar 25, 2001, 23:40 #10
- Join Date
- Jul 2000
- Location
- 80,000 feet below the surface
- Posts
- 1,442
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Because the term 'parse' in web development has more relevance to server-side languages like ASP, PHP, etc. where parsing is an integral part of each language. You'll hardly ever hear people saying 'I need to parse my HTML file to return some results' but you'll hear plenty of web developers grumbling 'We need to parse the PHP code and return a new set of values that we can then insert into the MySQL DB...' etc. etc.
-
Mar 26, 2001, 07:55 #11
- Join Date
- Dec 2000
- Location
- gibraltar ... for now...
- Posts
- 60
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
???
As far as I know..
it means seperate..
but that being said, like everything else there are a whole bunch of implications to that
to parse or not to parse.. that is the question
-
Mar 26, 2001, 09:14 #12
- Join Date
- Jun 2000
- Location
- Sydney, Australia
- Posts
- 3,798
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Here are some contexts to which parsing applies in web programming.
1) When you process form input (ie, user supplied text that is returned from a form in a html page) in a script you need to parse the text for a number of reasons.
1.1) If you are going to save that string in a database you need to parse the string and escape any characters that are going to mess up the SQL syntax ' " \ these three characters will all corrupt an SQL string.
1.2) For security you may need to parse the string to make sure that the user is not using your script as a malicious back door to the system.
1.3) You may want to transform the user input from ASCII to html which would involve parsing the string and replacing carridge returns for <BR> tags.
1.4) You may be capturing an email address from the user and want to do some simple validation to make sure that it is in a legal format xxx@xxx.xxx
2) As already discussed, a compiler must parse the source code so as to acertain its symbolic meaning in order to compile machine instructions (object/machine code). Most compilers will parse the source code before attempting to compile it. Its sort of like the compiler checks the code for "puncuation" erros. Thus programmers are often having to debugg their code because the compiler couldn't make sence of the code when it parsed it. This is usually due to the programmer making syntax errors.
3) Yes - the web is full of parsingThere is a lot of parsing going on in generating dynamic web pages. The script has to be parsed, interpreted and executed on the server. The result is a stream of text that gets sent to the client which the browser must then parse as HTML in order to render the page for the user. If you come to web programming from a more traditional programming background - this is quite noticable. Almost everything is a string at some stage (whether it be variables imbedded into url using the get method, form data sent as a string using the post data).
-
Mar 27, 2001, 16:41 #13Originally posted by freakysid
Here are some contexts to which parsing applies in web programming.
1) When you process form input (ie, user supplied text that is returned from a form in a html page) in a script you need to parse the text for a number of reasons.
1.1) If you are going to save that string in a database you need to parse the string and escape any characters that are going to mess up the SQL syntax ' " \ these three characters will all corrupt an SQL string.
1.2) For security you may need to parse the string to make sure that the user is not using your script as a malicious back door to the system.
1.3) You may want to transform the user input from ASCII to html which would involve parsing the string and replacing carridge returns for <BR> tags.
1.4) You may be capturing an email address from the user and want to do some simple validation to make sure that it is in a legal format xxx@xxx.xxx
2) As already discussed, a compiler must parse the source code so as to acertain its symbolic meaning in order to compile machine instructions (object/machine code). Most compilers will parse the source code before attempting to compile it. Its sort of like the compiler checks the code for "puncuation" erros. Thus programmers are often having to debugg their code because the compiler couldn't make sence of the code when it parsed it. This is usually due to the programmer making syntax errors.
3) Yes - the web is full of parsingThere is a lot of parsing going on in generating dynamic web pages. The script has to be parsed, interpreted and executed on the server. The result is a stream of text that gets sent to the client which the browser must then parse as HTML in order to render the page for the user. If you come to web programming from a more traditional programming background - this is quite noticable. Almost everything is a string at some stage (whether it be variables imbedded into url using the get method, form data sent as a string using the post data).
-
Mar 27, 2001, 18:34 #14
-
Mar 27, 2001, 19:08 #15
- Join Date
- Aug 2000
- Location
- Silicon Valley
- Posts
- 2,241
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Totally agree with Nicky
We, webmasters, need to use "big" words.- Son Nguyen
AdSpeed.com - Ad Serving and Ad Management Made Easy
-
Mar 29, 2001, 08:40 #16
- Join Date
- Mar 2001
- Location
- cambridge, MA
- Posts
- 122
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Wow - I finally understand this now!
-
Mar 29, 2001, 16:21 #17Originally posted by Lor
Wow - I finally understand this now!
Bookmarks