Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Extracting Javascript features
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Neha Jain  
View profile  
 More options Jul 3 2010, 10:38 am
From: Neha Jain <neha.hbti...@gmail.com>
Date: Sat, 3 Jul 2010 20:08:06 +0530
Local: Sat, Jul 3 2010 10:38 am
Subject: Extracting Javascript features

Hello Gentle Reader,

Using the simple idea of Regular Expressions, I have worked out the way to
extract the ratio of the white space

(re.findall("\s",line))

in the JS script to the script length.
Apart from this I was planning, as you know, on finding the %of comments in
the JS code. I have written the attached regular expression for stripping
the comment from the string considering the fact that:
1. Single line comments in JS either follow // or are within /* */
2. these patterns don't work if are enclosed in " "
3. multi line comments are bounded by /* */

The expression I worked out doesnot function well in case /* or  */ are
immediately followed by the string patterns or if there is a different
pattern within the construct with special chars or sequence of alphabets and
digits.
Then after properly thinking on this idea of ratio of comment strings to
file length, I find that it not very useful. So may I drop it for a while? I
think it is better to concentrate on extracting the following features:

1. length of argument in the unescape(), eval() function.
2. string passed to the document.write or document.writeln method
3. length of variable names.

Apart from this JS oriented approach, I also came across the use of Meta tag
of html for redirection of pages. I will get a proper idea on this and find
how we could put it to use.
Awaiting your comments.
--
Sincere Regards,
Neha Jain

--
Smiles
Neha )))))

  strex.py
< 1K Download

  strexp.js
< 1K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »