bc... [google]
Home » Source Code » javascript interpreter written in visual c++

javascript interpreter written in visual c++

showmic
2013-10-06 09:58:23
The author
View(s):
Download(s): 0
Point (s): 1 
Category Category:
ScriptScript CPlusPlus, C-C++C++

Description

it is small javascript interpreter called tiny-js.it is written by c++ language within microsoft visual studio 2008.Authored By Gordon Williams Copyright (C) 2009 Pur3 LtdVersion 0.1 : (gw) First published on Google Code Version 0.11 : Making sure the 'root' variable never changes 'symbol_base' added for the current base of the sybmbol table Version 0.12 : Added findChildOrCreate, changed string passing to use references Fixed broken string encoding in getJSString() Removed getInitCode and added getJSON instead Added nil Added rough JSON parsing Improved example app Version 0.13 : Added tokenEnd/tokenLastEnd to lexer to avoid parsing whitespace Ability to define functions without names Can now do "var mine = function(a,b) { ... };" Slightly better 'trace' function Added findChildOrCreateByPath function Added simple test suite Added skipping of blocks when not executing Version 0.14 : Added parsing of more number types Added parsing of string defined with ' Changed nil to null as per spec, added 'undefined' Now set variables with the correct scope, and treat unknown as 'undefined' rather than failing Added proper (I hope) handling of null and undefined Added === check Version 0.15 : Fix for possible memory leaks Version 0.16 : Removal of un-needed findRecursive calls symbol_base removed and replaced with 'scopes' stack Added reference counting a proper tree structure (Allowing pass by reference) Allowed JSON output to output IDs, not strings Added get/set for array indices Changed Callbacks to include user data pointer Added some support for objects Added more Java-esque builtin functions Version 0.17 : Now we don't deepCopy the parent object of the class Added JSON.stringify and eval() Nicer JSON indenting Fixed function output in JSON Added evaluateComplex Fixed some reentrancy issues with evaluate/execute Version 0.18 : Fixed some issues with code being executed when it shouldn't Version 0.19 : Added array.length Changed '__parent' to 'prototype' to bring it more in line with javascript Version 0.20 : Added '%' operator Version 0.21 : Added array type String.length() no more - now String.length Added extra constructors to reduce confusion Fixed checks against undefined Version 0.22 : First part of ardi's changes: sprintf -> sprintf_s extra tokens parsed array memory leak fixed Fixed memory leak in evaluateComplex Fixed memory leak in FOR loops Fixed memory leak for unary minus Version 0.23 : Allowed evaluate[Complex] to take in semi-colon separated statements and then only return the value from the last one. Also checks to make sure *everything* was parsed. Ints + doubles are now stored in binary form (faster + more precise) Version 0.24 : More useful error for maths ops Don't dump everything on a match error. Version 0.25 : Better string escaping Version 0.26 : Add CScriptVar::equals Add built-in array functions Version 0.27 : Added OZLB's TinyJS.setVariable (with some tweaks) Added OZLB's Maths Functions Version 0.28 : Ternary operator Rudimentary call stack on error Added String Character functions Added shift operators Version 0.29 : Added new object via functions Fixed getString() for double on some platforms Version 0.30 : Rlyeh Mario's patch for Math Functions on VC++ Version 0.31 : Add exec() to TinyJS functions Now print quoted JSON that can be read by PHP/Python parsers Fixed postfix increment operator Version 0.32 : Fixed Math.randInt on 32 bit PCs, where it was broken Version 0.33 : Fixed Memory leak + brokenness on === comparison
Sponsored links

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
Makefile445.00 B08-06-11 00:17
Script.cpp2.97 kB08-06-11 00:17
TinyJS.cpp68.22 kB08-06-11 00:17
TinyJS.h13.99 kB08-06-11 00:17
TinyJS_Functions.cpp8.48 kB08-06-11 00:17
TinyJS_Functions.h1.41 kB08-06-11 00:17
TinyJS_MathFunctions.cpp10.18 kB08-06-11 00:17
TinyJS_MathFunctions.h208.00 B08-06-11 00:18
run_tests.cpp7.79 kB08-06-11 00:18
test014.js.svn-base473.00 B08-06-11 00:19
test032.js.svn-base228.00 B08-06-11 00:19
test006.js.svn-base75.00 B08-06-11 00:19
test024.js.svn-base2.09 kB08-06-11 00:19
test016.js.svn-base753.00 B08-06-11 00:19
test034.js.svn-base63.00 B08-06-11 00:19
test008.js.svn-base108.00 B08-06-11 00:19
test026.js.svn-base93.00 B08-06-11 00:19
test018.js.svn-base194.00 B08-06-11 00:19
test036.js.svn-base195.00 B08-06-11 00:19
test028.js.svn-base178.00 B08-06-11 00:19
test021.42.js.svn-base280.00 B08-06-11 00:19
test022.42.js.svn-base555.00 B08-06-11 00:19
test001.js.svn-base62.00 B08-06-11 00:19
test011.js.svn-base102.00 B08-06-11 00:19
test003.js.svn-base83.00 B08-06-11 00:19
test021.js.svn-base99.00 B08-06-11 00:19
test013.js.svn-base93.00 B08-06-11 00:19
test031.js.svn-base120.00 B08-06-11 00:19
test023.js.svn-base213.00 B08-06-11 00:19
test005.js.svn-base113.00 B08-06-11 00:19
test033.js.svn-base110.00 B08-06-11 00:19
test015.js.svn-base473.00 B08-06-11 00:19
test025.js.svn-base154.00 B08-06-11 00:19
test007.js.svn-base116.00 B08-06-11 00:19
test017.js.svn-base122.00 B08-06-11 00:19
test035.js.svn-base178.00 B08-06-11 00:19
test009.js.svn-base136.00 B08-06-11 00:19
test027.js.svn-base80.00 B08-06-11 00:19
test019.js.svn-base425.00 B08-06-11 00:19
test029.js.svn-base129.00 B08-06-11 00:19
test032.42.js.svn-base297.00 B08-06-11 00:19
test019.42.js.svn-base966.00 B08-06-11 00:19
test010.js.svn-base117.00 B08-06-11 00:19
test020.js.svn-base670.00 B08-06-11 00:19
test002.js.svn-base42.00 B08-06-11 00:19
test012.js.svn-base72.00 B08-06-11 00:19
test030.js.svn-base80.00 B08-06-11 00:19
test004.js.svn-base51.00 B08-06-11 00:19
test022.js.svn-base252.00 B08-06-11 00:19
all-wcprops3.63 kB08-06-11 00:19
entries6.02 kB08-06-11 00:19
test001.js.svn-base1.24 kB08-06-11 00:19
test002.js.svn-base227.00 B08-06-11 00:19
test003.js.svn-base232.00 B08-06-11 00:19
all-wcprops374.00 B08-06-11 00:19
entries680.00 B08-06-11 00:19
test001.js1.24 kB08-06-11 00:19
test002.js227.00 B08-06-11 00:19
test003.js232.00 B08-06-11 00:19
test014.js473.00 B08-06-11 00:19
test032.js228.00 B08-06-11 00:19
test006.js75.00 B08-06-11 00:19
test024.js2.09 kB08-06-11 00:19
test016.js753.00 B08-06-11 00:19
test034.js63.00 B08-06-11 00:19
test008.js108.00 B08-06-11 00:19
test026.js93.00 B08-06-11 00:19
test018.js194.00 B08-06-11 00:19
test036.js195.00 B08-06-11 00:19
test028.js178.00 B08-06-11 00:19
test021.42.js280.00 B08-06-11 00:19
test022.42.js555.00 B08-06-11 00:19
test001.js62.00 B08-06-11 00:19
test011.js102.00 B08-06-11 00:19
test003.js83.00 B08-06-11 00:19
test021.js99.00 B08-06-11 00:19
test013.js93.00 B08-06-11 00:19
test031.js120.00 B08-06-11 00:19
test023.js213.00 B08-06-11 00:19
test005.js113.00 B08-06-11 00:19
test033.js110.00 B08-06-11 00:19
test015.js473.00 B08-06-11 00:19
test025.js154.00 B08-06-11 00:19
test007.js116.00 B08-06-11 00:19
test017.js122.00 B08-06-11 00:19
test035.js178.00 B08-06-11 00:19
test009.js136.00 B08-06-11 00:19
test027.js80.00 B08-06-11 00:19
test019.js425.00 B08-06-11 00:19
test029.js129.00 B08-06-11 00:19
test032.42.js297.00 B08-06-11 00:19
test019.42.js966.00 B08-06-11 00:19
test010.js117.00 B08-06-11 00:19
test020.js670.00 B08-06-11 00:19
test002.js42.00 B08-06-11 00:19
test012.js72.00 B08-06-11 00:19
test030.js80.00 B08-06-11 00:19
test004.js51.00 B08-06-11 00:19
test022.js252.00 B08-06-11 00:19
<text-base>0.00 B08-06-11 00:19
<prop-base>0.00 B08-06-11 00:19
<props>0.00 B08-06-11 00:19
<text-base>0.00 B08-06-11 00:19
<prop-base>0.00 B08-06-11 00:19
<props>0.00 B08-06-11 00:19
<text-base>0.00 B08-06-11 00:19
<prop-base>0.00 B08-06-11 00:19
<props>0.00 B08-06-11 00:19
<tmp>0.00 B08-06-11 00:19
<text-base>0.00 B08-06-11 00:19
<prop-base>0.00 B08-06-11 00:19
<props>0.00 B08-06-11 00:19
<tmp>0.00 B08-06-11 00:19
<.svn>0.00 B08-06-11 00:19
<.svn>0.00 B08-06-11 00:19
<42tests>0.00 B08-06-11 00:19
<tests>0.00 B08-06-11 00:18
<tiny-js>0.00 B08-06-11 00:16
...
Sponsored links

Comments

(Add your comment, get 0.1 Point)
Minimum:15 words, Maximum:160 words
  • 1
  • Page 1
  • Total 1

javascript interpreter written in visual c++ (53.65 kB)

Need 1 Point(s)
Your Point (s)

Your Point isn't enough.

Get 22 Point immediately by PayPal

Point will be added to your account automatically after the transaction.

More(Debit card / Credit card / PayPal Credit / Online Banking)

Submit your source codes. Get more Points

LOGIN

Don't have an account? Register now
Need any help?
Mail to: support@codeforge.com

切换到中文版?

CodeForge Chinese Version
CodeForge English Version

Where are you going?

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!
OK

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D