Homework Week 2
JavaScript Character sets

The class's JavaScript compiler will use the Unicode Character set. Your homework is to write a function to scan a text string and extract a valid JavaScript variable name. To help you on your quest, I have supplied you with a set of tools and functions.  (  DOWNLOAD all files (zipped) plus the classroom slide presentation (*.ppt) )

  • MakeCharacterSet.htm this page scans the 65536 Unicode characters and builds a bitmap of
  • FIRST: the valid first characters in a JavaScript Variable or Function Name
  • SECOND: the valid second characters in JavaScript variable or function name
  • BLANK:  characters that are considered a white-space
  • NUMBER: characters that are numbers

  • Display.htm page displays the above generated characters sets

  • WhatIsIt.htm page determines if the text entered is a valid JavaScript Variable or Number. This will be similar to your homework assignment

  • Bits.js JavaScript BIT mask object. This file can be used to determine if the character numeric value is contained in a subset of 65,535 possible unicode characters

  • Compare.js JavaScript Functions to compare 2 Bit Mask Objects

  • Browsers.htm I scanned the characters JavaScript uses in IE, Chrome, Safari, and FireFox... This page will let you compare the character sets in the different browsers.  You will find none of the browsers use the same character sets for variables or for white-space.  A part of your homework will be to decide which character set to use
     
  • Homework.htm The main page of your homework assignment (Includes Bits.js and JavaScript.js)
     
  • JavaScript.js HOMEWORK Modify this file, Take any JavaScript source code and separate it into valid "Variable and Functions names", "Numbers", and "Other" tokens
     
  • NB_JavaScript.Zip  NetBean JavaScript Project Zip File
     
  •