You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(107) |
Dec
(67) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(76) |
Feb
(125) |
Mar
(72) |
Apr
(13) |
May
(18) |
Jun
(12) |
Jul
(129) |
Aug
(47) |
Sep
(1) |
Oct
(36) |
Nov
(128) |
Dec
(124) |
2002 |
Jan
(59) |
Feb
|
Mar
(14) |
Apr
(14) |
May
(72) |
Jun
(9) |
Jul
(3) |
Aug
(5) |
Sep
(18) |
Oct
(65) |
Nov
(28) |
Dec
(12) |
2003 |
Jan
(10) |
Feb
(2) |
Mar
(4) |
Apr
(33) |
May
(21) |
Jun
(9) |
Jul
(29) |
Aug
(34) |
Sep
(4) |
Oct
(8) |
Nov
(15) |
Dec
(4) |
2004 |
Jan
(26) |
Feb
(12) |
Mar
(11) |
Apr
(9) |
May
(7) |
Jun
|
Jul
(5) |
Aug
|
Sep
(3) |
Oct
(7) |
Nov
(1) |
Dec
(10) |
2005 |
Jan
(2) |
Feb
(72) |
Mar
(16) |
Apr
(39) |
May
(48) |
Jun
(97) |
Jul
(57) |
Aug
(13) |
Sep
(16) |
Oct
(24) |
Nov
(100) |
Dec
(24) |
2006 |
Jan
(15) |
Feb
(34) |
Mar
(33) |
Apr
(31) |
May
(79) |
Jun
(64) |
Jul
(41) |
Aug
(64) |
Sep
(31) |
Oct
(46) |
Nov
(55) |
Dec
(37) |
2007 |
Jan
(32) |
Feb
(61) |
Mar
(11) |
Apr
(58) |
May
(46) |
Jun
(30) |
Jul
(94) |
Aug
(93) |
Sep
(86) |
Oct
(69) |
Nov
(125) |
Dec
(177) |
2008 |
Jan
(169) |
Feb
(97) |
Mar
(74) |
Apr
(113) |
May
(120) |
Jun
(334) |
Jul
(215) |
Aug
(237) |
Sep
(72) |
Oct
(189) |
Nov
(126) |
Dec
(160) |
2009 |
Jan
(180) |
Feb
(45) |
Mar
(98) |
Apr
(140) |
May
(151) |
Jun
(71) |
Jul
(107) |
Aug
(119) |
Sep
(73) |
Oct
(121) |
Nov
(14) |
Dec
(6) |
2010 |
Jan
(13) |
Feb
(9) |
Mar
(10) |
Apr
(64) |
May
(3) |
Jun
(16) |
Jul
(7) |
Aug
(23) |
Sep
(17) |
Oct
(37) |
Nov
(5) |
Dec
(8) |
2011 |
Jan
(10) |
Feb
(11) |
Mar
(77) |
Apr
(11) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <fwi...@us...> - 2008-09-06 20:07:27
|
Revision: 5296 http://jython.svn.sourceforge.net/jython/?rev=5296&view=rev Author: fwierzbicki Date: 2008-09-06 20:07:25 +0000 (Sat, 06 Sep 2008) Log Message: ----------- Update installer as installer25 did. In part: uses jython-complete.jar, removes jythonc. Modified Paths: -------------- trunk/installer/src/java/org/python/util/install/DirectorySelectionPage.java trunk/installer/src/java/org/python/util/install/JarInstaller.java trunk/installer/src/java/org/python/util/install/StartScriptGenerator.java Modified: trunk/installer/src/java/org/python/util/install/DirectorySelectionPage.java =================================================================== --- trunk/installer/src/java/org/python/util/install/DirectorySelectionPage.java 2008-09-06 19:34:07 UTC (rev 5295) +++ trunk/installer/src/java/org/python/util/install/DirectorySelectionPage.java 2008-09-06 20:07:25 UTC (rev 5296) @@ -142,7 +142,7 @@ File defaultDirectory = null; File parentDirectory = new File(directory); if (parentDirectory.exists() && parentDirectory.isDirectory()) { - String jythonSubDirectoryName = "jython" + _jarInfo.getVersion(); + String jythonSubDirectoryName = "jython" + (_jarInfo.getVersion()).replaceAll("\\+", ""); defaultDirectory = new File(parentDirectory, jythonSubDirectoryName); } return defaultDirectory; @@ -189,4 +189,4 @@ } } -} \ No newline at end of file +} Modified: trunk/installer/src/java/org/python/util/install/JarInstaller.java =================================================================== --- trunk/installer/src/java/org/python/util/install/JarInstaller.java 2008-09-06 19:34:07 UTC (rev 5295) +++ trunk/installer/src/java/org/python/util/install/JarInstaller.java 2008-09-06 20:07:25 UTC (rev 5296) @@ -17,7 +17,7 @@ * moment). */ public class JarInstaller { - public static final String JYTHON_JAR = "jython.jar"; + public static final String JYTHON_JAR = "jython-complete.jar"; private static final String PATH_SEPARATOR = "/"; private static final String LIB_NAME_SEP = "Lib" + PATH_SEPARATOR; @@ -52,6 +52,8 @@ List coreLibFiles = new ArrayList(); if (!installationType.installSources()) { excludeDirs.add("src"); + excludeDirs.add("grammar"); + excludeDirs.add("extlibs"); } if (!installationType.installDocumentation()) { excludeDirs.add("Doc"); @@ -93,6 +95,10 @@ exclude = true; } } + // exclude build.xml when not installing source + if (!installationType.installSources() && zipEntryName.equals("build.xml")) + exclude = true; + // handle exclusion of core Lib files if (!exclude) { exclude = shouldExcludeFile(installationType, coreLibFiles, zipEntry, zipEntryName); @@ -133,6 +139,7 @@ _progressListener.progressStartScripts(); StartScriptGenerator generator = new StartScriptGenerator(targetDirectory, javaHome); generator.generateStartScripts(); + StandalonePackager.emptyDirectory(new File(targetDirectory, "bin"), null); } else { _progressListener.progressStandalone(); File jythonJar = new File(targetDirectory, JYTHON_JAR); @@ -220,6 +227,8 @@ coreLibFiles.add("javapath.py"); coreLibFiles.add("jreload.py"); coreLibFiles.add("marshal.py"); + coreLibFiles.add("os.py"); + coreLibFiles.add("posixpath.py"); coreLibFiles.add("random.py"); coreLibFiles.add("re.py"); coreLibFiles.add("site.py"); @@ -228,6 +237,7 @@ coreLibFiles.add("sre_compile.py"); coreLibFiles.add("sre_constants.py"); coreLibFiles.add("sre_parse.py"); + coreLibFiles.add("stat.py"); coreLibFiles.add("string.py"); coreLibFiles.add("zipfile.py"); coreLibFiles.add("zlib.py"); @@ -258,4 +268,4 @@ return exclude; } -} \ No newline at end of file +} Modified: trunk/installer/src/java/org/python/util/install/StartScriptGenerator.java =================================================================== --- trunk/installer/src/java/org/python/util/install/StartScriptGenerator.java 2008-09-06 19:34:07 UTC (rev 5295) +++ trunk/installer/src/java/org/python/util/install/StartScriptGenerator.java 2008-09-06 20:07:25 UTC (rev 5296) @@ -1,6 +1,7 @@ package org.python.util.install; import java.io.File; +import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.text.MessageFormat; @@ -17,8 +18,6 @@ private final static String JYTHON = "jython"; private final static String JYTHON_BAT = "jython.bat"; - private final static String JYTHONC = "jythonc"; - private final static String JYTHONC_BAT = "jythonc.bat"; private final static String JYTHON_JAR = JarInstaller.JYTHON_JAR; static { @@ -73,7 +72,6 @@ protected final void generateStartScripts() throws IOException { generateJythonScript(); - generateJythoncScript(); } private final void generateJythonScript() throws IOException { @@ -90,43 +88,18 @@ } } - private final void generateJythoncScript() throws IOException { - switch (getFlavour()) { - case BOTH_FLAVOUR: - writeToFile(JYTHONC_BAT, getJythoncScript(WINDOWS_FLAVOUR)); - makeExecutable(writeToFile(JYTHONC, getJythoncScript(BOTH_FLAVOUR))); - break; - case WINDOWS_FLAVOUR: - writeToFile(JYTHONC_BAT, getJythoncScript(WINDOWS_FLAVOUR)); - break; - default: - makeExecutable(writeToFile(JYTHONC, getJythoncScript(UNIX_FLAVOUR))); - } - } - /** * only <code>protected</code> for unit test use */ protected final String getJythonScript(int flavour) throws IOException { if (flavour == WINDOWS_FLAVOUR) { - return getStartScript(getWindowsJythonTemplate()); + return getStartScript(getWindowsJythonTemplate()) + readFromFile(JYTHON_BAT); } else { - return getStartScript(getUnixJythonTemplate(flavour)); + return getStartScript(getUnixJythonTemplate()) + readFromFile(JYTHON); } } /** - * only <code>protected</code> for unit test use - */ - protected final String getJythoncScript(int flavour) throws IOException { - if (flavour == WINDOWS_FLAVOUR) { - return getStartScript(getWindowsJythoncTemplate()); - } else { - return getStartScript(getUnixJythoncTemplate()); - } - } - - /** * These placeholders are valid for all private methods: * * {0} : current date <br> @@ -150,8 +123,9 @@ */ private String getWindowsJythonTemplate() { StringBuffer buffer = getWindowsHeaderTemplate(); - buffer.append("\"{2}\\bin\\java.exe\" -Dpython.home=\"{3}\" -Dpython.executable=\"%0\" -classpath \"{3}\\" + JYTHON_JAR - + ";%CLASSPATH%\" org.python.util.jython %ARGS%" + WIN_CR_LF); + buffer.append("set JAVA_HOME=\"{2}\"" + WIN_CR_LF); + buffer.append("set JYTHON_HOME=\"{3}\"" + WIN_CR_LF); + buffer.append(WIN_CR_LF); return buffer.toString(); } @@ -160,32 +134,12 @@ * * @see getStartScript */ - private String getWindowsJythoncTemplate() { - StringBuffer buffer = getWindowsHeaderTemplate(); - buffer.append("\"{3}\\jython.bat\" \"{3}\\Tools\\jythonc\\jythonc.py\" %ARGS%" + WIN_CR_LF); - return buffer.toString(); - } - - /** - * placeholders: - * - * @see getStartScript - */ private StringBuffer getWindowsHeaderTemplate() { StringBuffer buffer = new StringBuffer(1000); buffer.append("@echo off" + WIN_CR_LF); buffer.append("rem This file was generated by the Jython installer" + WIN_CR_LF); buffer.append("rem Created on {0} by {1}" + WIN_CR_LF); buffer.append(WIN_CR_LF); - buffer.append("set ARGS=" + WIN_CR_LF); - buffer.append(WIN_CR_LF); - buffer.append(":loop" + WIN_CR_LF); - buffer.append("if [%1] == [] goto end" + WIN_CR_LF); - buffer.append(" set ARGS=%ARGS% %1" + WIN_CR_LF); - buffer.append(" shift" + WIN_CR_LF); - buffer.append(" goto loop" + WIN_CR_LF); - buffer.append(":end" + WIN_CR_LF); - buffer.append(WIN_CR_LF); return buffer; } @@ -194,11 +148,11 @@ * * @see getStartScript */ - private String getUnixJythonTemplate(int flavour) { + private String getUnixJythonTemplate() { StringBuffer buffer = getUnixHeaderTemplate(); - buffer.append("CP=\"{3}/" + JYTHON_JAR + "\"\n"); - buffer.append("if [ ! -z \"$CLASSPATH\" ]\nthen\n CP=$CP:$CLASSPATH\nfi\n"); - buffer.append("\"{2}/bin/java\" -Dpython.home=\"{3}\" -Dpython.executable=\"$0\" -classpath \"$CP\" org.python.util.jython \"$@\"\n"); + buffer.append("JAVA_HOME=\"{2}\"\n"); + buffer.append("JYTHON_HOME=\"{3}\"\n"); + buffer.append("\n"); return buffer.toString(); } @@ -207,20 +161,9 @@ * * @see getStartScript */ - private String getUnixJythoncTemplate() { - StringBuffer buffer = getUnixHeaderTemplate(); - buffer.append("\"{3}/jython\" \"{3}/Tools/jythonc/jythonc.py\" \"$@\"\n"); - return buffer.toString(); - } - - /** - * placeholders: - * - * @see getStartScript - */ private StringBuffer getUnixHeaderTemplate() { StringBuffer buffer = new StringBuffer(1000); - buffer.append("#!/bin/sh\n"); + buffer.append("#!/usr/bin/env bash\n"); buffer.append("\n"); buffer.append("# This file was generated by the Jython installer\n"); buffer.append("# Created on {0} by {1}\n"); @@ -230,6 +173,24 @@ /** * @param fileName The short file name, e.g. JYTHON_BAT + * + * @throws IOException + */ + private String readFromFile(String fileName) throws IOException { + File file = new File(new File(_targetDirectory, "bin"), fileName); + FileReader fileReader = new FileReader(file); + StringBuffer sb = new StringBuffer(); + char[] b = new char[8192]; + int n; + + while ( (n = fileReader.read(b)) > 0) { + sb.append(b, 0, n); + } + return sb.toString(); + } + + /** + * @param fileName The short file name, e.g. JYTHON_BAT * @param contents * * @throws IOException This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fwi...@us...> - 2008-09-06 19:34:09
|
Revision: 5295 http://jython.svn.sourceforge.net/jython/?rev=5295&view=rev Author: fwierzbicki Date: 2008-09-06 19:34:07 +0000 (Sat, 06 Sep 2008) Log Message: ----------- Update README. Modified Paths: -------------- trunk/jython/README.txt Modified: trunk/jython/README.txt =================================================================== --- trunk/jython/README.txt 2008-09-06 18:58:02 UTC (rev 5294) +++ trunk/jython/README.txt 2008-09-06 19:34:07 UTC (rev 5295) @@ -1,12 +1,9 @@ -Welcome to Jython 2.5a0+ +Welcome to Jython 2.5a2+ ======================= -This is the first alpha of the 2.5 version of Jython. It -contains all of the most of the new features for the 2.5 release: +This is the second alpha of the 2.5 version of Jython. It +contains most of the new features for the 2.5 release. -In addition to these major features, several bugs have been fixed from 2.2rc2. -See the NEWS file for a more complete list of changes. - The release was compiled on Mac OS X with JDK 5 and requires JDK 5 to run. As an alpha release, this release is incomplete and contains bugs. Do not This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fwi...@us...> - 2008-09-06 18:58:04
|
Revision: 5294 http://jython.svn.sourceforge.net/jython/?rev=5294&view=rev Author: fwierzbicki Date: 2008-09-06 18:58:02 +0000 (Sat, 06 Sep 2008) Log Message: ----------- increment version. Modified Paths: -------------- trunk/jython/build.xml Modified: trunk/jython/build.xml =================================================================== --- trunk/jython/build.xml 2008-09-06 18:31:14 UTC (rev 5293) +++ trunk/jython/build.xml 2008-09-06 18:58:02 UTC (rev 5294) @@ -184,8 +184,8 @@ <property name="PY_RELEASE_LEVEL_SNAPSHOT" value="170"/> <!-- 0xAA --> <!-- The current version info --> - <property name="jython.version" value="2.5a1+"/> - <property name="jython.version.noplus" value="2.5a1"/> + <property name="jython.version" value="2.5a2+"/> + <property name="jython.version.noplus" value="2.5a2"/> <property name="jython.major_version" value="2"/> <property name="jython.minor_version" value="5"/> <property name="jython.micro_version" value="1"/> @@ -392,7 +392,7 @@ <target name="brand-readme-version" depends="checkout" if="do.snapshot.build"> <!-- change README.txt version string, if so defined: used for snapshot builds. XXX: a bit broken for now--> - <replace file="${jython.base.dir}/README.txt" token='2.5a1+' + <replace file="${jython.base.dir}/README.txt" token='2.5a2+' value='2.5a${svn.revision}' /> <replace file="${jython.base.dir}/README.txt"> <replacetoken>=======================</replacetoken> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fwi...@us...> - 2008-09-06 18:31:16
|
Revision: 5293 http://jython.svn.sourceforge.net/jython/?rev=5293&view=rev Author: fwierzbicki Date: 2008-09-06 18:31:14 +0000 (Sat, 06 Sep 2008) Log Message: ----------- Switch back installer25 -> installer. Leaked in from asm branch. Modified Paths: -------------- trunk/jython/build.xml Modified: trunk/jython/build.xml =================================================================== --- trunk/jython/build.xml 2008-09-06 04:28:11 UTC (rev 5292) +++ trunk/jython/build.xml 2008-09-06 18:31:14 UTC (rev 5293) @@ -219,7 +219,7 @@ <!-- predefined main directory for checkout --> <property name="svn.main.dir" value="branches" /> <property name="svn.code.dir" value="asm" /> - <property name="svn.installer.dir" value="installer25" /> + <property name="svn.installer.dir" value="installer" /> <!-- properties work.dir and jython.base.dir are also definied in init, so full-preinit must run first to work --> @@ -696,7 +696,7 @@ <!-- wrap the build into the installer --> <target name="install" depends="brand-readme-version, install-init, jar-complete, javadoc, copy-full"> - <property name="install.src.dir" value="${jython.base.dir}/../installer25/src/java" /> + <property name="install.src.dir" value="${jython.base.dir}/../installer/src/java" /> <echo>compiling installer from ${install.src.dir}</echo> <javac srcdir="${install.src.dir}" includes="org/**" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fwi...@us...> - 2008-09-06 04:28:13
|
Revision: 5292 http://jython.svn.sourceforge.net/jython/?rev=5292&view=rev Author: fwierzbicki Date: 2008-09-06 04:28:11 +0000 (Sat, 06 Sep 2008) Log Message: ----------- Some tuning of node col and line positions to align better with CPython. Modified Paths: -------------- trunk/jython/ast/astview.py trunk/jython/grammar/Python.g trunk/jython/src/org/python/antlr/GrammarActions.java Modified: trunk/jython/ast/astview.py =================================================================== --- trunk/jython/ast/astview.py 2008-09-05 16:30:36 UTC (rev 5291) +++ trunk/jython/ast/astview.py 2008-09-06 04:28:11 UTC (rev 5292) @@ -25,6 +25,10 @@ "org.python.antlr.ast.cmpopType", "org.python.antlr.ast.operatorType"): result = str(t) + if result == "AugLoad": + result = "Load" + elif result == "AugStore": + result = "Store" else: result = result.split(".")[-1] if result.endswith("Type"): Modified: trunk/jython/grammar/Python.g =================================================================== --- trunk/jython/grammar/Python.g 2008-09-05 16:30:36 UTC (rev 5291) +++ trunk/jython/grammar/Python.g 2008-09-06 04:28:11 UTC (rev 5292) @@ -806,7 +806,7 @@ //not in CPython's Grammar file elif_clause : ELIF test[expr_contextType.Load] COLON suite - -> ^(ELIF<If>[$ELIF, (exprType)$test.tree, actions.makeStmts($suite.stypes), new stmtType[0\]]) + -> ^(ELIF<If>[$test.start, (exprType)$test.tree, actions.makeStmts($suite.stypes), new stmtType[0\]]) ; //while_stmt: 'while' test ':' suite ['else' ':' suite] @@ -913,7 +913,7 @@ test[expr_contextType ctype] :o1=or_test[ctype] ( (IF or_test[null] ORELSE) => IF o2=or_test[ctype] ORELSE e=test[expr_contextType.Load] - -> ^(IF<IfExp>[$IF, (exprType)$o2.tree, (exprType)$o1.tree, (exprType)$e.tree]) + -> ^(IF<IfExp>[$o1.start, (exprType)$o2.tree, (exprType)$o1.tree, (exprType)$e.tree]) | -> or_test ) @@ -964,7 +964,7 @@ } @after { if (!cmps.isEmpty()) { - $comparison.tree = new Compare($left.tree, (exprType)$left.tree, actions.makeCmpOps(cmps), + $comparison.tree = new Compare($left.start, (exprType)$left.tree, actions.makeCmpOps(cmps), actions.makeExprs($right)); } } @@ -1136,8 +1136,7 @@ //XXX: This could be better. $etype = (exprType)$atom.tree; if ($t != null) { - for(int i = 0; i < $t.size(); i++) { - Object o = $t.get(i); + for(Object o : $t) { if ($etype instanceof Context) { ((Context)$etype).setContext(expr_contextType.Load); } @@ -1249,7 +1248,7 @@ ( ((options {k=2;}: c1=COMMA t+=test[$expr::ctype])* (c2=COMMA)? -> { $c1 != null || $c2 != null }? ^(COMMA<Tuple>[$testlist_gexp.start, actions.makeExprs($t), $expr::ctype]) - -> test + -> test ) | (gen_for[gens] { @@ -1290,7 +1289,7 @@ -> ^(LPAREN<Call>[$begin, (exprType)$tree, actions.makeExprs($arglist.args), actions.makeKeywords($arglist.keywords), $arglist.starargs, $arglist.kwargs]) | - -> ^(LPAREN<Call>[$LPAREN, (exprType)$tree, new exprType[0\], new keywordType[0\], null, null]) + -> ^(LPAREN<Call>[$begin, (exprType)$tree, new exprType[0\], new keywordType[0\], null, null]) ) RPAREN | LBRACK subscriptlist[$begin] RBRACK @@ -1447,7 +1446,7 @@ $genarg = true; Collections.reverse($gens); comprehensionType[] c = (comprehensionType[])$gens.toArray(new comprehensionType[$gens.size()]); - arguments.add(new GeneratorExp($gen_for.start, (exprType)$t1.tree, c)); + arguments.add(new GeneratorExp($t1.start, (exprType)$t1.tree, c)); } | { if (kws.size() > 0) { Modified: trunk/jython/src/org/python/antlr/GrammarActions.java =================================================================== --- trunk/jython/src/org/python/antlr/GrammarActions.java 2008-09-05 16:30:36 UTC (rev 5291) +++ trunk/jython/src/org/python/antlr/GrammarActions.java 2008-09-06 04:28:11 UTC (rev 5292) @@ -459,7 +459,8 @@ } Token extractStringToken(List s) { - return (Token)s.get(s.size() - 1); + return (Token)s.get(0); + //return (Token)s.get(s.size() - 1); } //FROM Walker: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fwi...@us...> - 2008-09-05 16:30:39
|
Revision: 5291 http://jython.svn.sourceforge.net/jython/?rev=5291&view=rev Author: fwierzbicki Date: 2008-09-05 16:30:36 +0000 (Fri, 05 Sep 2008) Log Message: ----------- Broke test_traceback.py in my last commit. This fixes it again. Modified Paths: -------------- trunk/jython/grammar/Python.g trunk/jython/src/org/python/antlr/PythonTokenSource.java Modified: trunk/jython/grammar/Python.g =================================================================== --- trunk/jython/grammar/Python.g 2008-09-05 16:21:55 UTC (rev 5290) +++ trunk/jython/grammar/Python.g 2008-09-05 16:30:36 UTC (rev 5291) @@ -286,10 +286,14 @@ @after { if (!stypes.isEmpty()) { //The EOF token messes up the end offsets, so set them manually. + //XXX: this may no longer be true now that PythonTokenSource is + // adjusting EOF offsets -- but needs testing before I remove + // this. PythonTree stop = (PythonTree)stypes.get(stypes.size() -1); mtype.setCharStopIndex(stop.getCharStopIndex()); mtype.setTokenStopIndex(stop.getTokenStopIndex()); } + $file_input.tree = mtype; } : (NEWLINE @@ -1778,6 +1782,8 @@ CommonToken c = new CommonToken(LEADING_WS,new String(indentation)); c.setLine(input.getLine()); c.setCharPositionInLine(input.getCharPositionInLine()); + c.setStartIndex(input.index() - 1); + c.setStopIndex(input.index() - 1); emit(c); // kill trailing newline if present and then ignore if (newlines != 0) { @@ -1793,7 +1799,12 @@ for (int i=0; i<newlines; i++) { nls[i] = '\n'; } - emit(new CommonToken(NEWLINE,new String(nls))); + CommonToken c = new CommonToken(NEWLINE,new String(nls)); + c.setLine(input.getLine()); + c.setCharPositionInLine(input.getCharPositionInLine()); + c.setStartIndex(input.index() - 1); + c.setStopIndex(input.index() - 1); + emit(c); } } ) Modified: trunk/jython/src/org/python/antlr/PythonTokenSource.java =================================================================== --- trunk/jython/src/org/python/antlr/PythonTokenSource.java 2008-09-05 16:21:55 UTC (rev 5290) +++ trunk/jython/src/org/python/antlr/PythonTokenSource.java 2008-09-05 16:30:36 UTC (rev 5291) @@ -152,23 +152,25 @@ tokens.addElement(newline); } + private void handleEOF(CommonToken eof, CommonToken prev) { + if (prev != null) { + eof.setStopIndex(prev.getStopIndex()); + } + } + protected void insertImaginaryIndentDedentTokens() { Token t = stream.LT(1); stream.consume(); if (t.getType() == Token.EOF) { Token prev = stream.LT(-1); + handleEOF((CommonToken)t, (CommonToken)prev); if (!inSingle) { if (prev == null || prev.getType() != PythonLexer.NEWLINE) { generateNewline(t); } } - if (prev != null) { - ((CommonToken)t).setStopIndex(((CommonToken)prev).getStopIndex()); - handleDedents(-1, (CommonToken)prev); - } else { - handleDedents(-1, (CommonToken)t); - } + handleDedents(-1, (CommonToken)t); enqueue(t); } else if (t.getType() == PythonLexer.NEWLINE) { // save NEWLINE in the queue @@ -186,6 +188,7 @@ // compute cpos as the char pos of next non-WS token in line int cpos = t.getCharPositionInLine(); // column dictates indent/dedent if (t.getType() == Token.EOF) { + handleEOF((CommonToken)t, (CommonToken)newline); cpos = -1; // pretend EOF always happens at left edge } else if (t.getType() == PythonLexer.LEADING_WS) { @@ -207,8 +210,7 @@ handleIndents(cpos, (CommonToken)t); } else if (cpos < lastIndent) { // they dedented - Token prev = stream.LT(-1); - handleDedents(cpos, (CommonToken)newline); + handleDedents(cpos, (CommonToken)t); } if (t.getType() == Token.EOF && inSingle) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zy...@us...> - 2008-09-05 16:21:58
|
Revision: 5290 http://jython.svn.sourceforge.net/jython/?rev=5290&view=rev Author: zyasoft Date: 2008-09-05 16:21:55 +0000 (Fri, 05 Sep 2008) Log Message: ----------- PySystemState.warnoptions was not initialized before adding to it in the processing of the -W option. Modified Paths: -------------- trunk/jython/src/org/python/util/jython.java Modified: trunk/jython/src/org/python/util/jython.java =================================================================== --- trunk/jython/src/org/python/util/jython.java 2008-09-05 03:36:04 UTC (rev 5289) +++ trunk/jython/src/org/python/util/jython.java 2008-09-05 16:21:55 UTC (rev 5290) @@ -6,6 +6,8 @@ import java.io.FileInputStream; import java.io.InputStream; import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.List; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; @@ -14,6 +16,7 @@ import org.python.core.PyCode; import org.python.core.PyException; import org.python.core.PyFile; +import org.python.core.PyList; import org.python.core.PyModule; import org.python.core.PyString; import org.python.core.PyStringMap; @@ -136,8 +139,8 @@ // Now create an interpreter InteractiveConsole interp = newInterpreter(); - for (int i = 0; i < opts.warnoptions.size(); i++) { - String wopt = (String) opts.warnoptions.elementAt(i); + PySystemState.warnoptions = new PyList(); + for (String wopt : opts.warnoptions) { PySystemState.warnoptions.append(new PyString(wopt)); } @@ -333,7 +336,7 @@ public String[] argv; public java.util.Properties properties; public String command; - public java.util.Vector warnoptions = new java.util.Vector(); + public List<String> warnoptions = new ArrayList<String>(); public String encoding; public String division; public String moduleName; @@ -403,7 +406,7 @@ break; } else if (arg.equals("-W")) { - warnoptions.addElement(args[++index]); + warnoptions.add(args[++index]); } else if (arg.equals("-C")) { encoding = args[++index]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fwi...@us...> - 2008-09-05 03:36:07
|
Revision: 5289 http://jython.svn.sourceforge.net/jython/?rev=5289&view=rev Author: fwierzbicki Date: 2008-09-05 03:36:04 +0000 (Fri, 05 Sep 2008) Log Message: ----------- Adjustment to offset fix. Overthought the offsets for simple dedents. Modified Paths: -------------- trunk/jython/src/org/python/antlr/PythonTokenSource.java Modified: trunk/jython/src/org/python/antlr/PythonTokenSource.java =================================================================== --- trunk/jython/src/org/python/antlr/PythonTokenSource.java 2008-09-04 16:57:30 UTC (rev 5288) +++ trunk/jython/src/org/python/antlr/PythonTokenSource.java 2008-09-05 03:36:04 UTC (rev 5289) @@ -208,11 +208,7 @@ } else if (cpos < lastIndent) { // they dedented Token prev = stream.LT(-1); - if (prev != null) { - handleDedents(cpos, (CommonToken)prev); - } else { - handleDedents(cpos, (CommonToken)t); - } + handleDedents(cpos, (CommonToken)newline); } if (t.getType() == Token.EOF && inSingle) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fwi...@us...> - 2008-09-04 16:57:33
|
Revision: 5288 http://jython.svn.sourceforge.net/jython/?rev=5288&view=rev Author: fwierzbicki Date: 2008-09-04 16:57:30 +0000 (Thu, 04 Sep 2008) Log Message: ----------- Fix for some offset problems -- the biggest one being dedents now take on the offset values of the previous token. Modified Paths: -------------- trunk/jython/grammar/Python.g trunk/jython/src/org/python/antlr/PythonTokenSource.java trunk/jython/src/org/python/antlr/PythonTreeAdaptor.java Modified: trunk/jython/grammar/Python.g =================================================================== --- trunk/jython/grammar/Python.g 2008-09-03 15:24:20 UTC (rev 5287) +++ trunk/jython/grammar/Python.g 2008-09-04 16:57:30 UTC (rev 5288) @@ -284,6 +284,12 @@ List stypes = new ArrayList(); } @after { + if (!stypes.isEmpty()) { + //The EOF token messes up the end offsets, so set them manually. + PythonTree stop = (PythonTree)stypes.get(stypes.size() -1); + mtype.setCharStopIndex(stop.getCharStopIndex()); + mtype.setTokenStopIndex(stop.getTokenStopIndex()); + } $file_input.tree = mtype; } : (NEWLINE Modified: trunk/jython/src/org/python/antlr/PythonTokenSource.java =================================================================== --- trunk/jython/src/org/python/antlr/PythonTokenSource.java 2008-09-03 15:24:20 UTC (rev 5287) +++ trunk/jython/src/org/python/antlr/PythonTokenSource.java 2008-09-04 16:57:30 UTC (rev 5288) @@ -157,14 +157,18 @@ stream.consume(); if (t.getType() == Token.EOF) { + Token prev = stream.LT(-1); if (!inSingle) { - Token prev = stream.LT(-1); if (prev == null || prev.getType() != PythonLexer.NEWLINE) { generateNewline(t); } } - - handleDedents(-1, (CommonToken)t); + if (prev != null) { + ((CommonToken)t).setStopIndex(((CommonToken)prev).getStopIndex()); + handleDedents(-1, (CommonToken)prev); + } else { + handleDedents(-1, (CommonToken)t); + } enqueue(t); } else if (t.getType() == PythonLexer.NEWLINE) { // save NEWLINE in the queue @@ -203,7 +207,12 @@ handleIndents(cpos, (CommonToken)t); } else if (cpos < lastIndent) { // they dedented - handleDedents(cpos, (CommonToken)t); + Token prev = stream.LT(-1); + if (prev != null) { + handleDedents(cpos, (CommonToken)prev); + } else { + handleDedents(cpos, (CommonToken)t); + } } if (t.getType() == Token.EOF && inSingle) { Modified: trunk/jython/src/org/python/antlr/PythonTreeAdaptor.java =================================================================== --- trunk/jython/src/org/python/antlr/PythonTreeAdaptor.java 2008-09-03 15:24:20 UTC (rev 5287) +++ trunk/jython/src/org/python/antlr/PythonTreeAdaptor.java 2008-09-04 16:57:30 UTC (rev 5288) @@ -12,6 +12,8 @@ if (t==null) { return; } + //System.out.println("setting boundries on '"+t+"' with start: '" + startToken + "' and '" + + // stopToken + "'"); int start = 0; int stop = 0; int startChar = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fwi...@us...> - 2008-09-03 15:24:37
|
Revision: 5287 http://jython.svn.sourceforge.net/jython/?rev=5287&view=rev Author: fwierzbicki Date: 2008-09-03 15:24:20 +0000 (Wed, 03 Sep 2008) Log Message: ----------- Small cleanup of compiler package. Mainly remove unused imports and rename local vars that shadow member vars. Modified Paths: -------------- trunk/jython/src/org/python/compiler/AdapterMaker.java trunk/jython/src/org/python/compiler/ArgListCompiler.java trunk/jython/src/org/python/compiler/ClassFile.java trunk/jython/src/org/python/compiler/Code.java trunk/jython/src/org/python/compiler/CodeCompiler.java trunk/jython/src/org/python/compiler/Constant.java trunk/jython/src/org/python/compiler/JavaMaker.java trunk/jython/src/org/python/compiler/Module.java trunk/jython/src/org/python/compiler/ProxyMaker.java trunk/jython/src/org/python/compiler/ScopeInfo.java trunk/jython/src/org/python/compiler/ScopesCompiler.java Modified: trunk/jython/src/org/python/compiler/AdapterMaker.java =================================================================== --- trunk/jython/src/org/python/compiler/AdapterMaker.java 2008-09-03 09:21:25 UTC (rev 5286) +++ trunk/jython/src/org/python/compiler/AdapterMaker.java 2008-09-03 15:24:20 UTC (rev 5287) @@ -4,11 +4,9 @@ import java.io.OutputStream; import java.lang.reflect.Method; -import java.util.Set; import java.util.HashSet; import org.python.objectweb.asm.Label; -import org.python.objectweb.asm.MethodVisitor; import org.python.objectweb.asm.Opcodes; @@ -41,12 +39,14 @@ return pm.myClass; } + @Override public void doConstants() throws Exception { for (String name : names) { classfile.addField(name, "Lorg/python/core/PyObject;", Opcodes.ACC_PUBLIC); } } + @Override public void addMethod(Method method, int access) throws Exception { Class<?>[] parameters = method.getParameterTypes(); Class<?> ret = method.getReturnType(); Modified: trunk/jython/src/org/python/compiler/ArgListCompiler.java =================================================================== --- trunk/jython/src/org/python/compiler/ArgListCompiler.java 2008-09-03 09:21:25 UTC (rev 5286) +++ trunk/jython/src/org/python/compiler/ArgListCompiler.java 2008-09-03 15:24:20 UTC (rev 5287) @@ -79,6 +79,7 @@ } } + @Override public Object visitName(Name node) throws Exception { //FIXME: do we need Store and Param, or just Param? if (node.ctx != expr_contextType.Store && node.ctx != expr_contextType.Param) { @@ -93,6 +94,7 @@ return node.id; } + @Override public Object visitTuple(Tuple node) throws Exception { StringBuffer name = new StringBuffer("("); int n = node.elts.length; Modified: trunk/jython/src/org/python/compiler/ClassFile.java =================================================================== --- trunk/jython/src/org/python/compiler/ClassFile.java 2008-09-03 09:21:25 UTC (rev 5286) +++ trunk/jython/src/org/python/compiler/ClassFile.java 2008-09-03 15:24:20 UTC (rev 5287) @@ -2,7 +2,6 @@ package org.python.compiler; import java.io.ByteArrayOutputStream; -import java.io.DataOutputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; @@ -11,7 +10,6 @@ import java.util.List; import org.python.objectweb.asm.AnnotationVisitor; -import org.python.objectweb.asm.Attribute; import org.python.objectweb.asm.ClassWriter; import org.python.objectweb.asm.FieldVisitor; import org.python.objectweb.asm.MethodVisitor; Modified: trunk/jython/src/org/python/compiler/Code.java =================================================================== --- trunk/jython/src/org/python/compiler/Code.java 2008-09-03 09:21:25 UTC (rev 5286) +++ trunk/jython/src/org/python/compiler/Code.java 2008-09-03 15:24:20 UTC (rev 5287) @@ -211,7 +211,7 @@ } break; case 'L': - while (c[++i] != ';') {;} + while (c[++i] != ';') {} default: if (ret) stack++; else stack--; Modified: trunk/jython/src/org/python/compiler/CodeCompiler.java =================================================================== --- trunk/jython/src/org/python/compiler/CodeCompiler.java 2008-09-03 09:21:25 UTC (rev 5286) +++ trunk/jython/src/org/python/compiler/CodeCompiler.java 2008-09-03 15:24:20 UTC (rev 5287) @@ -69,12 +69,9 @@ import org.python.antlr.ast.TryFinally; import org.python.antlr.ast.Tuple; import org.python.antlr.ast.UnaryOp; -import org.python.antlr.ast.Unicode; import org.python.antlr.ast.While; import org.python.antlr.ast.With; import org.python.antlr.ast.Yield; -import org.python.antlr.ast.aliasType; -import org.python.antlr.ast.argumentsType; import org.python.antlr.ast.cmpopType; import org.python.antlr.ast.comprehensionType; import org.python.antlr.ast.excepthandlerType; @@ -83,10 +80,7 @@ import org.python.antlr.ast.keywordType; import org.python.antlr.ast.modType; import org.python.antlr.ast.operatorType; -import org.python.antlr.ast.sliceType; import org.python.antlr.ast.stmtType; -import org.python.antlr.ast.unaryopType; -import org.python.core.PyFrame; public class CodeCompiler extends Visitor implements Opcodes, ClassConstants //, PythonGrammarTreeConstants { @@ -288,11 +282,13 @@ } } + @Override public Object visitInteractive(Interactive node) throws Exception { traverse(node); return null; } + @Override public Object visitModule(org.python.antlr.ast.Module suite) throws Exception { @@ -315,6 +311,7 @@ return null; } + @Override public Object visitExpression(Expression node) throws Exception { if (my_scope.generator && node.body != null) { module.error("'return' with argument inside generator", @@ -389,6 +386,7 @@ return true; } + @Override public Object visitFunctionDef(FunctionDef node) throws Exception { String name = getName(node.name); @@ -788,15 +786,15 @@ loadFrame(); code.invokestatic("org/python/core/imp", "importAll", "(" + $str + $pyFrame + ")V"); } else { - String[] names = new String[node.names.length]; + String[] fromNames = new String[node.names.length]; String[] asnames = new String[node.names.length]; for (int i = 0; i < node.names.length; i++) { - names[i] = node.names[i].name; + fromNames[i] = node.names[i].name; asnames[i] = node.names[i].asname; if (asnames[i] == null) - asnames[i] = names[i]; + asnames[i] = fromNames[i]; } - makeStrings(code, names, names.length); + makeStrings(code, fromNames, fromNames.length); loadFrame(); code.invokestatic("org/python/core/imp", "importFrom", "(" + $str + $strArr + $pyFrame + ")" + $pyObjArr); @@ -1353,6 +1351,7 @@ return null; } + @Override public Object visitUnaryOp(UnaryOp node) throws Exception { visit(node.operand); String name = null; @@ -1366,6 +1365,7 @@ return null; } + @Override public Object visitAugAssign(AugAssign node) throws Exception { setline(node); @@ -1466,6 +1466,7 @@ } + @Override public Object visitCall(Call node) throws Exception { String[] keys = new String[node.keywords.length]; exprType[] values = new exprType[node.args.length + keys.length]; @@ -1582,6 +1583,7 @@ } + @Override public Object visitSubscript(Subscript node) throws Exception { if (node.slice instanceof Slice) { return Slice(node, (Slice) node.slice); @@ -1617,11 +1619,13 @@ return null; } + @Override public Object visitIndex(Index node) throws Exception { traverse(node); return null; } + @Override public Object visitExtSlice(ExtSlice node) throws Exception { code.new_("org/python/core/PyTuple"); code.dup(); @@ -1630,6 +1634,7 @@ return null; } + @Override public Object visitAttribute(Attribute node) throws Exception { expr_contextType ctx = node.ctx; @@ -1688,6 +1693,7 @@ return null; } + @Override public Object visitTuple(Tuple node) throws Exception { /* if (mode ==AUGSET) throw new ParseException( @@ -1703,6 +1709,7 @@ return null; } + @Override public Object visitList(List node) throws Exception { if (node.ctx == expr_contextType.Store) return seqSet(node.elts); if (node.ctx == expr_contextType.Del) return seqDel(node.elts); @@ -1714,6 +1721,7 @@ return null; } + @Override public Object visitListComp(ListComp node) throws Exception { code.new_("org/python/core/PyList"); @@ -1747,6 +1755,7 @@ return null; } + @Override public Object visitDict(Dict node) throws Exception { code.new_("org/python/core/PyDictionary"); @@ -1761,12 +1770,14 @@ return null; } + @Override public Object visitRepr(Repr node) throws Exception { visit(node.value); code.invokevirtual("org/python/core/PyObject", "__repr__", "()" + $pyStr); return null; } + @Override public Object visitLambda(Lambda node) throws Exception { String name = "<lambda>"; @@ -1801,11 +1812,13 @@ } + @Override public Object visitEllipsis(Ellipsis node) throws Exception { code.getstatic("org/python/core/Py", "Ellipsis", "Lorg/python/core/PyObject;"); return null; } + @Override public Object visitSlice(Slice node) throws Exception { code.new_("org/python/core/PySlice"); @@ -1817,6 +1830,7 @@ return null; } + @Override public Object visitClassDef(ClassDef node) throws Exception { setline(node); @@ -1881,6 +1895,7 @@ code.invokevirtual("org/python/core/PyFrame", "getglobal", "(" + $str + ")" + $pyObj); } + @Override public Object visitName(Name node) throws Exception { String name; if (fast_locals) @@ -1985,6 +2000,7 @@ return null; } + @Override public Object visitStr(Str node) throws Exception { PyString s = (PyString)node.s; if (s instanceof PyUnicode) { @@ -1995,6 +2011,7 @@ return null; } + @Override public Object visitGeneratorExp(GeneratorExp node) throws Exception { String bound_exp = "_(x)"; String tmp_append ="_(" + node.getLine() + "_" + node.getCharPositionInLine() + ")"; @@ -2170,6 +2187,7 @@ return null; } + @Override protected Object unhandled_node(PythonTree node) throws Exception { throw new Exception("Unhandled node " + node); } Modified: trunk/jython/src/org/python/compiler/Constant.java =================================================================== --- trunk/jython/src/org/python/compiler/Constant.java 2008-09-03 09:21:25 UTC (rev 5286) +++ trunk/jython/src/org/python/compiler/Constant.java 2008-09-03 15:24:20 UTC (rev 5287) @@ -4,7 +4,6 @@ import java.io.IOException; -import org.python.objectweb.asm.MethodVisitor; import org.python.objectweb.asm.Opcodes; abstract class Constant implements Opcodes{ Modified: trunk/jython/src/org/python/compiler/JavaMaker.java =================================================================== --- trunk/jython/src/org/python/compiler/JavaMaker.java 2008-09-03 09:21:25 UTC (rev 5286) +++ trunk/jython/src/org/python/compiler/JavaMaker.java 2008-09-03 15:24:20 UTC (rev 5287) @@ -4,7 +4,6 @@ import java.lang.reflect.Method; import java.lang.reflect.Modifier; -import org.python.objectweb.asm.Opcodes; import org.python.core.PyObject; public class JavaMaker extends ProxyMaker implements ClassConstants { @@ -25,6 +24,7 @@ this.methods = methods; } + @Override public void addConstructor(String name, Class<?>[] parameters, Class<?> ret, @@ -40,6 +40,7 @@ code.visitInsn(RETURN); } + @Override public void addProxy() throws Exception { if (methods != null) super.addProxy(); @@ -58,6 +59,7 @@ } + @Override public void addMethod(Method method, int access) throws Exception { if (Modifier.isAbstract(access)) { // Maybe throw an exception here??? Modified: trunk/jython/src/org/python/compiler/Module.java =================================================================== --- trunk/jython/src/org/python/compiler/Module.java 2008-09-03 09:21:25 UTC (rev 5286) +++ trunk/jython/src/org/python/compiler/Module.java 2008-09-03 15:24:20 UTC (rev 5287) @@ -37,10 +37,12 @@ c.putstatic(module.classfile.name, name, $pyInteger); } + @Override public int hashCode() { return value; } + @Override public boolean equals(Object o) { if (o instanceof PyIntegerConstant) return ((PyIntegerConstant)o).value == value; @@ -68,10 +70,12 @@ c.putstatic(module.classfile.name, name, $pyFloat); } + @Override public int hashCode() { return (int)value; } + @Override public boolean equals(Object o) { if (o instanceof PyFloatConstant) return ((PyFloatConstant)o).value == value; @@ -99,10 +103,12 @@ c.putstatic(module.classfile.name, name, $pyComplex); } + @Override public int hashCode() { return (int)value; } + @Override public boolean equals(Object o) { if (o instanceof PyComplexConstant) return ((PyComplexConstant)o).value == value; @@ -130,10 +136,12 @@ c.putstatic(module.classfile.name, name, $pyStr); } + @Override public int hashCode() { return value.hashCode(); } + @Override public boolean equals(Object o) { if (o instanceof PyStringConstant) return ((PyStringConstant)o).value.equals(value); @@ -161,10 +169,12 @@ c.putstatic(module.classfile.name, name, $pyUnicode); } + @Override public int hashCode() { return value.hashCode(); } + @Override public boolean equals(Object o) { if (o instanceof PyUnicodeConstant) return ((PyUnicodeConstant)o).value.equals(value); @@ -192,10 +202,12 @@ c.putstatic(module.classfile.name, name, $pyLong); } + @Override public int hashCode() { return value.hashCode(); } + @Override public boolean equals(Object o) { if (o instanceof PyLongConstant) return ((PyLongConstant)o).value.equals(value); @@ -220,7 +232,7 @@ public int moreflags; - public PyCodeConstant() { ; + public PyCodeConstant() { } public void get(Code c) throws IOException { Modified: trunk/jython/src/org/python/compiler/ProxyMaker.java =================================================================== --- trunk/jython/src/org/python/compiler/ProxyMaker.java 2008-09-03 09:21:25 UTC (rev 5286) +++ trunk/jython/src/org/python/compiler/ProxyMaker.java 2008-09-03 15:24:20 UTC (rev 5287) @@ -34,17 +34,17 @@ public static Map<Class<?>, Integer> types=fillTypes(); public static Map<Class<?>, Integer> fillTypes() { - Map<Class<?>, Integer> types = new HashMap<Class<?>, Integer>(); - types.put(Boolean.TYPE, tBoolean); - types.put(Byte.TYPE, tByte); - types.put(Short.TYPE, tShort); - types.put(Integer.TYPE, tInteger); - types.put(Long.TYPE, tLong); - types.put(Float.TYPE, tFloat); - types.put(Double.TYPE, tDouble); - types.put(Character.TYPE, tCharacter); - types.put(Void.TYPE, tVoid); - return types; + Map<Class<?>, Integer> typeMap = new HashMap<Class<?>, Integer>(); + typeMap.put(Boolean.TYPE, tBoolean); + typeMap.put(Byte.TYPE, tByte); + typeMap.put(Short.TYPE, tShort); + typeMap.put(Integer.TYPE, tInteger); + typeMap.put(Long.TYPE, tLong); + typeMap.put(Float.TYPE, tFloat); + typeMap.put(Double.TYPE, tDouble); + typeMap.put(Character.TYPE, tCharacter); + typeMap.put(Void.TYPE, tVoid); + return typeMap; } public static int getType(Class<?> c) { @@ -440,14 +440,14 @@ Label callPython = new Label(); code.ifnonnull(callPython); - String superclass = mapClass(method.getDeclaringClass()); + String superClass = mapClass(method.getDeclaringClass()); - callSuper(code, name, superclass, parameters, ret, sig); + callSuper(code, name, superClass, parameters, ret, sig); code.label(callPython); code.aload(tmp); callMethod(code, name, parameters, ret, method.getExceptionTypes()); - addSuperMethod("super__"+name, name, superclass, parameters, + addSuperMethod("super__"+name, name, superClass, parameters, ret, sig, access); } else { if (!isAdapter) { @@ -512,9 +512,9 @@ if (sc != null) addMethods(sc, t); - Class<?>[] interfaces = c.getInterfaces(); - for (int j=0; j<interfaces.length; j++) { - addMethods(interfaces[j], t); + Class<?>[] ifaces = c.getInterfaces(); + for (int j=0; j<ifaces.length; j++) { + addMethods(ifaces[j], t); } } @@ -562,14 +562,14 @@ Class<?>[] parameters = method.getParameterTypes(); Class<?> ret = method.getReturnType(); String sig = makeSignature(parameters, ret); - String superclass = mapClass(method.getDeclaringClass()); + String superClass = mapClass(method.getDeclaringClass()); String superName = method.getName(); String methodName = superName; if (Modifier.isFinal(access)) { methodName = "super__" + superName; access &= ~Modifier.FINAL; } - addSuperMethod(methodName, superName, superclass, parameters, + addSuperMethod(methodName, superName, superClass, parameters, ret, sig, access); } @@ -656,8 +656,8 @@ code.aload(0); code.ldc("__supernames__"); - String[] names = supernames.toArray(new String[n]); - CodeCompiler.makeStrings(code, names, n); + String[] nameArray = supernames.toArray(new String[n]); + CodeCompiler.makeStrings(code, nameArray, n); code.invokestatic("org/python/core/Py", "java2py", "(" + $obj + ")" + $pyObj); code.invokevirtual("org/python/core/PyObject", "__setitem__", "(" + $str + $pyObj + ")V"); code.return_(); Modified: trunk/jython/src/org/python/compiler/ScopeInfo.java =================================================================== --- trunk/jython/src/org/python/compiler/ScopeInfo.java 2008-09-03 09:21:25 UTC (rev 5286) +++ trunk/jython/src/org/python/compiler/ScopeInfo.java 2008-09-03 15:24:20 UTC (rev 5287) @@ -2,7 +2,9 @@ package org.python.compiler; -import java.util.*; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.Vector; import org.python.antlr.PythonTree; public class ScopeInfo extends Object implements ScopeConstants { @@ -257,6 +259,7 @@ } + @Override public String toString() { return "ScopeInfo[" + scope_name + " " + kind + "]@" + System.identityHashCode(this); Modified: trunk/jython/src/org/python/compiler/ScopesCompiler.java =================================================================== --- trunk/jython/src/org/python/compiler/ScopesCompiler.java 2008-09-03 09:21:25 UTC (rev 5286) +++ trunk/jython/src/org/python/compiler/ScopesCompiler.java 2008-09-03 15:24:20 UTC (rev 5287) @@ -66,6 +66,7 @@ } } + @Override public Object visitInteractive(Interactive node) throws Exception { beginScope("<single-top>", TOPSCOPE, node, null); suite(node.body); @@ -73,6 +74,7 @@ return null; } + @Override public Object visitModule(org.python.antlr.ast.Module node) throws Exception { @@ -82,6 +84,7 @@ return null; } + @Override public Object visitExpression(Expression node) throws Exception { beginScope("<eval-top>", TOPSCOPE, node, null); visit(new Return(node, node.body)); @@ -93,6 +96,7 @@ cur.addBound(name); } + @Override public Object visitFunctionDef(FunctionDef node) throws Exception { def(node.name); ArgListCompiler ac = new ArgListCompiler(); @@ -117,6 +121,7 @@ return null; } + @Override public Object visitLambda(Lambda node) throws Exception { ArgListCompiler ac = new ArgListCompiler(); ac.visitArgs(node.args); @@ -144,6 +149,7 @@ visit(stmts[i]); } + @Override public Object visitImport(Import node) throws Exception { for (int i = 0; i < node.names.length; i++) { if (node.names[i].asname != null) { @@ -159,6 +165,7 @@ return null; } + @Override public Object visitImportFrom(ImportFrom node) throws Exception { Future.checkFromFuture(node); // future stmt support int n = node.names.length; @@ -176,6 +183,7 @@ return null; } + @Override public Object visitGlobal(Global node) throws Exception { int n = node.names.length; for (int i = 0; i < n; i++) { @@ -202,6 +210,7 @@ return null; } + @Override public Object visitExec(Exec node) throws Exception { cur.exec = true; if (node.globals == null && node.locals == null) { @@ -211,6 +220,7 @@ return null; } + @Override public Object visitClassDef(ClassDef node) throws Exception { def(node.name); int n = node.bases.length; @@ -223,6 +233,7 @@ return null; } + @Override public Object visitName(Name node) throws Exception { String name = node.id; if (node.ctx != expr_contextType.Load) { @@ -236,6 +247,7 @@ return null; } + @Override public Object visitListComp(ListComp node) throws Exception { String tmp ="_[" + node.getLine() + "_" + node.getCharPositionInLine() + "]"; cur.addBound(tmp); @@ -243,6 +255,7 @@ return null; } + @Override public Object visitYield(Yield node) throws Exception { cur.generator = true; cur.yield_count++; @@ -250,6 +263,7 @@ return null; } + @Override public Object visitGeneratorExp(GeneratorExp node) throws Exception { String bound_exp = "_(x)"; String tmp ="_(" + node.getLine() + "_" + node.getCharPositionInLine() + ")"; @@ -269,6 +283,7 @@ return null; } + @Override public Object visitWith(With node) throws Exception { cur.max_with_count++; traverse(node); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <th...@us...> - 2008-09-03 09:21:40
|
Revision: 5286 http://jython.svn.sourceforge.net/jython/?rev=5286&view=rev Author: thobes Date: 2008-09-03 09:21:25 +0000 (Wed, 03 Sep 2008) Log Message: ----------- Merged revisions 5211-5215,5227,5229,5231-5234,5262-5271,5274-5276,5278-5279,5281-5285 via svnmerge from https://jython.svn.sourceforge.net/svnroot/jython/trunk/jython ................ r5211 | pjenvey | 2008-08-20 01:34:29 +0200 (Wed, 20 Aug 2008) | 2 lines small cleanup ................ r5212 | pjenvey | 2008-08-20 02:28:55 +0200 (Wed, 20 Aug 2008) | 4 lines o rename unmarshalCode -> readCode, as it doesn't relate to Python's marshal o zipimport shouldn't cacheCompiledSource (it's just been silently failing), and use java enums ................ r5213 | nriley | 2008-08-20 06:33:02 +0200 (Wed, 20 Aug 2008) | 1 line Run Jython regrtest (on Windows) with bytecode verification; support -J, --jdb, -- on Windows too. ................ r5214 | nriley | 2008-08-20 07:26:20 +0200 (Wed, 20 Aug 2008) | 1 line Turned out those quotes were useful after all. ................ r5215 | zyasoft | 2008-08-20 08:54:10 +0200 (Wed, 20 Aug 2008) | 5 lines A class definition needs to have __module__ set in frame locals, so that it is accessible by a metaclass, if defined. Fixes test_advice in zope.interfaces ................ r5227 | pjenvey | 2008-08-21 01:01:42 +0200 (Thu, 21 Aug 2008) | 3 lines rewrite the subx joiner yet again: this time exactly as CPython does it, with __getslice__ and join. fixes a string subclass corner case ................ r5229 | leosoto | 2008-08-21 05:23:28 +0200 (Thu, 21 Aug 2008) | 1 line Fixing #1095 for old-style classes. Thanks to Anselm Kruls for the patch. ................ r5231 | pjenvey | 2008-08-21 21:44:29 +0200 (Thu, 21 Aug 2008) | 3 lines make cStringIO thread safe as unfortunately the CPython GIL guarantees it, as does the pure python version. add cStringIO.In/OutputType ................ r5232 | pjenvey | 2008-08-22 01:59:46 +0200 (Fri, 22 Aug 2008) | 1 line document TypeError vs AttributeError here ................ r5233 | fwierzbicki | 2008-08-22 17:31:56 +0200 (Fri, 22 Aug 2008) | 2 lines Switch "type"->"kind" for the compile parameter value which specifies the kind of parse/compile "exec", "eval", or "single". CPython's source uses "kind" and other parts of Jython use this term as well. ................ r5234 | pjenvey | 2008-08-22 22:16:59 +0200 (Fri, 22 Aug 2008) | 3 lines fix unicode __add__ and repeat always forcing the basic plane on the result -- can't optimize for strs when unicode also uses these methods ................ r5262 | fwierzbicki | 2008-08-29 14:11:43 +0200 (Fri, 29 Aug 2008) | 3 lines Leaving out two of the harder parts of test_inspect out for now (with comments to come back to them later). ................ r5263 | fwierzbicki | 2008-08-29 14:14:12 +0200 (Fri, 29 Aug 2008) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-5209" from https://jython.svn.sourceforge.net/svnroot/jython/branches/nowalker ................ r5264 | fwierzbicki | 2008-08-29 15:47:16 +0200 (Fri, 29 Aug 2008) | 168 lines Merged revisions 5210,5216-5220,5223-5226,5228,5230,5236-5261 via svnmerge from https://jython.svn.sourceforge.net/svnroot/jython/branches/nowalker ........ r5210 | fwierzbicki | 2008-08-19 17:43:06 -0400 (Tue, 19 Aug 2008) | 5 lines Work to date on the one pass grammar. Not ready for others to look at really. If you really want to try it note that you need to comment out parts of site.py and os.py to get things to work. They *almost* parse and compile, but not quite, and they are basic dependencies for Jython to run. ........ r5216 | fwierzbicki | 2008-08-20 08:10:26 -0400 (Wed, 20 Aug 2008) | 2 lines Much better BoolOp. ........ r5217 | fwierzbicki | 2008-08-20 10:06:30 -0400 (Wed, 20 Aug 2008) | 2 lines Fix "del". ........ r5218 | fwierzbicki | 2008-08-20 10:39:21 -0400 (Wed, 20 Aug 2008) | 2 lines Dict support. ........ r5219 | fwierzbicki | 2008-08-20 11:23:14 -0400 (Wed, 20 Aug 2008) | 2 lines Conditional Expression support. ........ r5220 | fwierzbicki | 2008-08-20 11:37:02 -0400 (Wed, 20 Aug 2008) | 2 lines repr support. ........ r5223 | fwierzbicki | 2008-08-20 15:57:39 -0400 (Wed, 20 Aug 2008) | 2 lines Start of list comprehensions and generator expressions. ........ r5224 | fwierzbicki | 2008-08-20 15:58:17 -0400 (Wed, 20 Aug 2008) | 2 lines oops revert build.xml ........ r5225 | fwierzbicki | 2008-08-20 16:57:09 -0400 (Wed, 20 Aug 2008) | 2 lines re-remove PythonWalker.g from build ........ r5226 | fwierzbicki | 2008-08-20 16:59:44 -0400 (Wed, 20 Aug 2008) | 2 lines gen expressions and list comps now actually work... ........ r5228 | fwierzbicki | 2008-08-20 22:58:24 -0400 (Wed, 20 Aug 2008) | 2 lines debugging of some expr_contextType values. ........ r5230 | fwierzbicki | 2008-08-20 23:47:32 -0400 (Wed, 20 Aug 2008) | 2 lines bugfix on exception and on assign value expr_contextType. ........ r5236 | fwierzbicki | 2008-08-22 19:03:45 -0400 (Fri, 22 Aug 2008) | 2 lines Bugfix for expr_contextType on assign values. ........ r5237 | fwierzbicki | 2008-08-22 22:33:48 -0400 (Fri, 22 Aug 2008) | 2 lines Add expr types to BaseTree children. ........ r5238 | fwierzbicki | 2008-08-23 15:19:16 -0400 (Sat, 23 Aug 2008) | 2 lines BinOp now works in one pass. ........ r5239 | fwierzbicki | 2008-08-23 15:43:19 -0400 (Sat, 23 Aug 2008) | 2 lines Fine tuning List and Assign col position. ........ r5240 | fwierzbicki | 2008-08-23 19:03:59 -0400 (Sat, 23 Aug 2008) | 5 lines Make PythonTree's toStringTree more easily comparable with ast/astview.py output. This will help with the walkerless Python.g, as it doesn't quite parse ast/astview.py yet. ........ r5241 | fwierzbicki | 2008-08-23 22:04:43 -0400 (Sat, 23 Aug 2008) | 2 lines Fix lambda without args. ........ r5242 | fwierzbicki | 2008-08-24 05:38:22 -0400 (Sun, 24 Aug 2008) | 2 lines check for PythonTree in makeStmts. ........ r5243 | fwierzbicki | 2008-08-25 10:21:29 -0400 (Mon, 25 Aug 2008) | 2 lines Fix generator expressions, rename all "stmts" in Python.g to "stypes". ........ r5244 | fwierzbicki | 2008-08-25 11:25:24 -0400 (Mon, 25 Aug 2008) | 2 lines Clean up creation of stmtType[] and exprType[]. ........ r5245 | fwierzbicki | 2008-08-25 14:44:46 -0400 (Mon, 25 Aug 2008) | 3 lines Fix build.xml (oops) Fix Generator Expression assignments and multi-statement simple_stmt. ........ r5246 | fwierzbicki | 2008-08-25 16:36:04 -0400 (Mon, 25 Aug 2008) | 3 lines Fixed fplist, subscripts (especially extslice) and enable Interactive and Expression (single and eval). regrtest.py is now running. ........ r5247 | fwierzbicki | 2008-08-25 17:18:03 -0400 (Mon, 25 Aug 2008) | 2 lines Fix ** ........ r5248 | fwierzbicki | 2008-08-25 22:04:27 -0400 (Mon, 25 Aug 2008) | 3 lines Cleanup: removal of comments, re-format of Python.g and removal of PYNODE. ........ r5249 | fwierzbicki | 2008-08-26 08:21:42 -0400 (Tue, 26 Aug 2008) | 3 lines Remove unnecessary constructor on BinOp (now it is just the generated version again) Remove some whitespace in Python.g ........ r5250 | fwierzbicki | 2008-08-26 11:05:19 -0400 (Tue, 26 Aug 2008) | 2 lines Moved makeSliceType code to GrammarActions. ........ r5251 | fwierzbicki | 2008-08-26 12:51:15 -0400 (Tue, 26 Aug 2008) | 2 lines Moved Subscript creation up a rule - fixed a bunch of unit tests. ........ r5252 | fwierzbicki | 2008-08-26 15:37:34 -0400 (Tue, 26 Aug 2008) | 2 lines Another expr_contextType adjustment. ........ r5253 | fwierzbicki | 2008-08-26 16:17:50 -0400 (Tue, 26 Aug 2008) | 2 lines checking for bad assignment statements. ........ r5254 | fwierzbicki | 2008-08-26 20:44:35 -0400 (Tue, 26 Aug 2008) | 3 lines Fix illegal Lambda statements and more illegal assigns. Also raise exceptions on illegal gen expression arguments. ........ r5255 | fwierzbicki | 2008-08-26 22:38:35 -0400 (Tue, 26 Aug 2008) | 2 lines Fix for FunctionDef and Call problems. ........ r5256 | fwierzbicki | 2008-08-26 22:47:56 -0400 (Tue, 26 Aug 2008) | 2 lines whitespace ........ r5257 | fwierzbicki | 2008-08-27 12:07:35 -0400 (Wed, 27 Aug 2008) | 2 lines revert build.xml after accidently checking in my local copy. ........ r5258 | fwierzbicki | 2008-08-27 15:51:16 -0400 (Wed, 27 Aug 2008) | 2 lines for not_test, replacing manual tree construction with ->. ........ r5259 | fwierzbicki | 2008-08-27 16:09:39 -0400 (Wed, 27 Aug 2008) | 2 lines TODO comment. ........ r5260 | fwierzbicki | 2008-08-27 16:35:54 -0400 (Wed, 27 Aug 2008) | 3 lines Removed XXX comments that no longer apply (special testlists don't seem to be needed). Removed unused c1 and c2 alias. ........ r5261 | fwierzbicki | 2008-08-27 16:51:19 -0400 (Wed, 27 Aug 2008) | 2 lines simplify testlist. ........ ................ r5265 | nriley | 2008-08-29 21:51:57 +0200 (Fri, 29 Aug 2008) | 1 line filecmp.py from http://svn.python.org/projects/python/branches/release25-maint/Lib/filecmp.py r66059 ................ r5266 | nriley | 2008-08-29 21:53:04 +0200 (Fri, 29 Aug 2008) | 1 line Close file immediately after comparing it. Fixes test_filecmp on Windows. ................ r5267 | nriley | 2008-08-29 21:55:43 +0200 (Fri, 29 Aug 2008) | 1 line Correct file position after truncate; similar to CPython's bug <http://bugs.python.org/issue801631>. Fixes test_file on Windows. ................ r5268 | nriley | 2008-08-29 21:56:54 +0200 (Fri, 29 Aug 2008) | 1 line Fix some mispasted docstrings in the grp module. ................ r5269 | nriley | 2008-08-29 21:58:06 +0200 (Fri, 29 Aug 2008) | 1 line Raise ImportError when attempting to import pwd, grp modules on Windows. Fixes test_tarfile. ................ r5270 | nriley | 2008-08-29 22:41:41 +0200 (Fri, 29 Aug 2008) | 1 line Revert stubbed out bit from r5210. ................ r5271 | pjenvey | 2008-08-29 23:08:52 +0200 (Fri, 29 Aug 2008) | 3 lines PEP 338 (jython -m mod) support patch from Georgy Berdyshev ................ r5274 | zyasoft | 2008-08-30 20:39:59 +0200 (Sat, 30 Aug 2008) | 22 lines Exposed unicode_toString, str_toString so that Jython code can directly access the underlying java.lang.String backing our unicode and str types. This enables writing code like this: return Normalizer.normalize(unistr.toString(), normalizer_form) without Jython automatically encoding the string on our behalf. That's often what we want for CPython compatibility, but not when we are calling methods like this. (Too bad we need to know.) Added unicodedata.py and supporting data files UnicodeData.txt and EastAsianWidth.txt, both from 4.10. (We may wish to update to be more compliant with Java than Python 2.5.) Because the time it takes to import, serious refactoring should be considered, including possibly doing a codegen to Java approach. Currently does not pass MD5 hash tests in test_unicodedata, which by their nature are highly sensitive. Added collections.namedtuple. First 2.6 feature. (We should have a few in Jython 2.5.) This was originally added to support Python version of unicodedata.py, but is now just included. ................ r5275 | fwierzbicki | 2008-08-31 02:31:36 +0200 (Sun, 31 Aug 2008) | 3 lines Fixes #1116 -- dotted_attr was calling itself, which does not make sense with +=. ................ r5276 | fwierzbicki | 2008-08-31 03:00:57 +0200 (Sun, 31 Aug 2008) | 2 lines Test for more than 2 dotted_attr. See http://bugs.jython.org/issue1116. ................ r5278 | fwierzbicki | 2008-09-01 06:21:27 +0200 (Mon, 01 Sep 2008) | 2 lines Check for EOF in file_input. Comment cleanup. ................ r5279 | zyasoft | 2008-09-01 08:32:39 +0200 (Mon, 01 Sep 2008) | 6 lines The compile builtin function now can take an AST node, as produced by a previous usage of compile with the compiler flag _ast.PyCF_ONLY_AST. Generally this would be after some modification of the AST itself. Another 2.6 feature. ................ r5281 | fwierzbicki | 2008-09-02 16:41:10 +0200 (Tue, 02 Sep 2008) | 2 lines Coding standards and cosmetic changes. ................ r5282 | fwierzbicki | 2008-09-02 16:43:50 +0200 (Tue, 02 Sep 2008) | 2 lines accidentally commented out call to dump() which is turned off by default anyway. ................ r5283 | fwierzbicki | 2008-09-03 02:19:22 +0200 (Wed, 03 Sep 2008) | 2 lines Remove unused file. ................ r5284 | fwierzbicki | 2008-09-03 02:25:53 +0200 (Wed, 03 Sep 2008) | 3 lines from: http://svn.python.org/projects/python/branches/release25-maint/Lib/test/test_code.py@51333 ................ r5285 | fwierzbicki | 2008-09-03 03:00:56 +0200 (Wed, 03 Sep 2008) | 6 lines Removed co_names, co_consts since these are implementation details that may never get implemented, and removed flags since there are implementation differences that may never line up. Still failing on one test for varnames because I think it is possible that the order of varnames might be useful (in order declared) and Jython doesn't quite get that right. ................ Modified Paths: -------------- branches/advanced/CPythonLib.includes branches/advanced/CoreExposed.includes branches/advanced/Lib/grp.py branches/advanced/Lib/pkgutil.py branches/advanced/Lib/pwd.py branches/advanced/Lib/test/regrtest.py branches/advanced/Lib/test/test_descr_jy.py branches/advanced/Lib/test/test_inspect.py branches/advanced/Lib/test/test_jy_compile.py branches/advanced/Lib/test/test_re_jy.py branches/advanced/ast/asdl_antlr.py branches/advanced/build.xml branches/advanced/grammar/Python.g branches/advanced/src/org/python/antlr/ExpressionParser.java branches/advanced/src/org/python/antlr/GrammarActions.java branches/advanced/src/org/python/antlr/InteractiveParser.java branches/advanced/src/org/python/antlr/ModuleParser.java branches/advanced/src/org/python/antlr/PythonTokenSource.java branches/advanced/src/org/python/antlr/ast/Assert.java branches/advanced/src/org/python/antlr/ast/Assign.java branches/advanced/src/org/python/antlr/ast/Attribute.java branches/advanced/src/org/python/antlr/ast/AugAssign.java branches/advanced/src/org/python/antlr/ast/BinOp.java branches/advanced/src/org/python/antlr/ast/Call.java branches/advanced/src/org/python/antlr/ast/Compare.java branches/advanced/src/org/python/antlr/ast/Exec.java branches/advanced/src/org/python/antlr/ast/Expr.java branches/advanced/src/org/python/antlr/ast/Expression.java branches/advanced/src/org/python/antlr/ast/For.java branches/advanced/src/org/python/antlr/ast/GeneratorExp.java branches/advanced/src/org/python/antlr/ast/If.java branches/advanced/src/org/python/antlr/ast/IfExp.java branches/advanced/src/org/python/antlr/ast/Index.java branches/advanced/src/org/python/antlr/ast/Lambda.java branches/advanced/src/org/python/antlr/ast/ListComp.java branches/advanced/src/org/python/antlr/ast/Print.java branches/advanced/src/org/python/antlr/ast/Raise.java branches/advanced/src/org/python/antlr/ast/Repr.java branches/advanced/src/org/python/antlr/ast/Return.java branches/advanced/src/org/python/antlr/ast/Slice.java branches/advanced/src/org/python/antlr/ast/Subscript.java branches/advanced/src/org/python/antlr/ast/UnaryOp.java branches/advanced/src/org/python/antlr/ast/While.java branches/advanced/src/org/python/antlr/ast/With.java branches/advanced/src/org/python/antlr/ast/Yield.java branches/advanced/src/org/python/antlr/ast/comprehensionType.java branches/advanced/src/org/python/antlr/ast/excepthandlerType.java branches/advanced/src/org/python/antlr/ast/keywordType.java branches/advanced/src/org/python/compiler/Module.java branches/advanced/src/org/python/compiler/ScopesCompiler.java branches/advanced/src/org/python/core/CompilerFacade.java branches/advanced/src/org/python/core/Py.java branches/advanced/src/org/python/core/PyBaseException.java branches/advanced/src/org/python/core/PyFrame.java branches/advanced/src/org/python/core/PyInstance.java branches/advanced/src/org/python/core/PyObject.java branches/advanced/src/org/python/core/PyString.java branches/advanced/src/org/python/core/PyUnicode.java branches/advanced/src/org/python/core/__builtin__.java branches/advanced/src/org/python/core/imp.java branches/advanced/src/org/python/core/io/FileIO.java branches/advanced/src/org/python/modules/Setup.java branches/advanced/src/org/python/modules/cStringIO.java branches/advanced/src/org/python/modules/sre/PatternObject.java branches/advanced/src/org/python/modules/zipimport/zipimporter.java branches/advanced/src/org/python/util/jython.java branches/advanced/src/shell/jython.bat branches/advanced/tests/java/org/python/antlr/PythonTreeTester.java Added Paths: ----------- branches/advanced/Lib/EastAsianWidth.txt branches/advanced/Lib/UnicodeData.txt branches/advanced/Lib/collections/ branches/advanced/Lib/collections/__init__.py branches/advanced/Lib/filecmp.py branches/advanced/Lib/test/test_code.py branches/advanced/Lib/test/test_unicode_jy.py branches/advanced/Lib/unicodedata.py branches/advanced/src/org/python/modules/_collections/ branches/advanced/src/org/python/modules/_collections/Collections.java branches/advanced/src/org/python/modules/_collections/PyDefaultDict.java branches/advanced/src/org/python/modules/_collections/PyDefaultDictDerived.java branches/advanced/src/org/python/modules/_collections/PyDeque.java branches/advanced/src/org/python/modules/_collections/PyDequeDerived.java Removed Paths: ------------- branches/advanced/Lib/collections/__init__.py branches/advanced/grammar/PythonWalker.g branches/advanced/src/org/python/compiler/SourceFile.java branches/advanced/src/org/python/modules/_collections/Collections.java branches/advanced/src/org/python/modules/_collections/PyDefaultDict.java branches/advanced/src/org/python/modules/_collections/PyDefaultDictDerived.java branches/advanced/src/org/python/modules/_collections/PyDeque.java branches/advanced/src/org/python/modules/_collections/PyDequeDerived.java branches/advanced/src/org/python/modules/collections/ Property Changed: ---------------- branches/advanced/ Property changes on: branches/advanced ___________________________________________________________________ Modified: svnmerge-integrated - /trunk/jython:1-5210 + /trunk/jython:1-5285 Modified: branches/advanced/CPythonLib.includes =================================================================== --- branches/advanced/CPythonLib.includes 2008-09-03 01:00:56 UTC (rev 5285) +++ branches/advanced/CPythonLib.includes 2008-09-03 09:21:25 UTC (rev 5286) @@ -52,7 +52,6 @@ dospath.py dumbdbm.py exceptions.py -filecmp.py fileinput.py fnmatch.py formatter.py Modified: branches/advanced/CoreExposed.includes =================================================================== --- branches/advanced/CoreExposed.includes 2008-09-03 01:00:56 UTC (rev 5285) +++ branches/advanced/CoreExposed.includes 2008-09-03 09:21:25 UTC (rev 5286) @@ -44,8 +44,8 @@ org/python/modules/_weakref/ReferenceType.class org/python/modules/_weakref/ProxyType.class org/python/modules/_hashlib$Hash.class -org/python/modules/collections/PyDefaultDict.class -org/python/modules/collections/PyDeque.class +org/python/modules/_collections/PyDefaultDict.class +org/python/modules/_collections/PyDeque.class org/python/modules/operator$PyAttrGetter.class org/python/modules/operator$PyItemGetter.class org/python/modules/random/PyRandom.class Copied: branches/advanced/Lib/EastAsianWidth.txt (from rev 5285, trunk/jython/Lib/EastAsianWidth.txt) =================================================================== --- branches/advanced/Lib/EastAsianWidth.txt (rev 0) +++ branches/advanced/Lib/EastAsianWidth.txt 2008-09-03 09:21:25 UTC (rev 5286) @@ -0,0 +1,16368 @@ +# EastAsianWidth-4.1.0.txt +# Date: 2005-03-17, 15:21:00 PST [KW] +# +# East Asian Width Properties +# +# This file is an informative contributory data file in the +# Unicode Character Database. +# +# Copyright (c) 1991-2005 Unicode, Inc. +# For terms of use, see http://www.unicode.org/terms_of_use.html +# +# The format is two fields separated by a semicolon. +# Field 0: Unicode value +# Field 1: East Asian Width property, consisting of one of the following values: +# "N", "A", "H", "W", "F", "Na" +# - All code points, assigned or unassigned, that are not listed +# explicitly are given the value "N". +# - Characters ranges are specified as for other property files in +# the Unicode Character Database. +# +# The Unicode name of each character is provided in a comment for help +# in identifying the characters. +# +# See UAX #11: East Asian Character Width, for more information. +0000;N # <control> +0001;N # <control> +0002;N # <control> +0003;N # <control> +0004;N # <control> +0005;N # <control> +0006;N # <control> +0007;N # <control> +0008;N # <control> +0009;N # <control> +000A;N # <control> +000B;N # <control> +000C;N # <control> +000D;N # <control> +000E;N # <control> +000F;N # <control> +0010;N # <control> +0011;N # <control> +0012;N # <control> +0013;N # <control> +0014;N # <control> +0015;N # <control> +0016;N # <control> +0017;N # <control> +0018;N # <control> +0019;N # <control> +001A;N # <control> +001B;N # <control> +001C;N # <control> +001D;N # <control> +001E;N # <control> +001F;N # <control> +0020;Na # SPACE +0021;Na # EXCLAMATION MARK +0022;Na # QUOTATION MARK +0023;Na # NUMBER SIGN +0024;Na # DOLLAR SIGN +0025;Na # PERCENT SIGN +0026;Na # AMPERSAND +0027;Na # APOSTROPHE +0028;Na # LEFT PARENTHESIS +0029;Na # RIGHT PARENTHESIS +002A;Na # ASTERISK +002B;Na # PLUS SIGN +002C;Na # COMMA +002D;Na # HYPHEN-MINUS +002E;Na # FULL STOP +002F;Na # SOLIDUS +0030;Na # DIGIT ZERO +0031;Na # DIGIT ONE +0032;Na # DIGIT TWO +0033;Na # DIGIT THREE +0034;Na # DIGIT FOUR +0035;Na # DIGIT FIVE +0036;Na # DIGIT SIX +0037;Na # DIGIT SEVEN +0038;Na # DIGIT EIGHT +0039;Na # DIGIT NINE +003A;Na # COLON +003B;Na # SEMICOLON +003C;Na # LESS-THAN SIGN +003D;Na # EQUALS SIGN +003E;Na # GREATER-THAN SIGN +003F;Na # QUESTION MARK +0040;Na # COMMERCIAL AT +0041;Na # LATIN CAPITAL LETTER A +0042;Na # LATIN CAPITAL LETTER B +0043;Na # LATIN CAPITAL LETTER C +0044;Na # LATIN CAPITAL LETTER D +0045;Na # LATIN CAPITAL LETTER E +0046;Na # LATIN CAPITAL LETTER F +0047;Na # LATIN CAPITAL LETTER G +0048;Na # LATIN CAPITAL LETTER H +0049;Na # LATIN CAPITAL LETTER I +004A;Na # LATIN CAPITAL LETTER J +004B;Na # LATIN CAPITAL LETTER K +004C;Na # LATIN CAPITAL LETTER L +004D;Na # LATIN CAPITAL LETTER M +004E;Na # LATIN CAPITAL LETTER N +004F;Na # LATIN CAPITAL LETTER O +0050;Na # LATIN CAPITAL LETTER P +0051;Na # LATIN CAPITAL LETTER Q +0052;Na # LATIN CAPITAL LETTER R +0053;Na # LATIN CAPITAL LETTER S +0054;Na # LATIN CAPITAL LETTER T +0055;Na # LATIN CAPITAL LETTER U +0056;Na # LATIN CAPITAL LETTER V +0057;Na # LATIN CAPITAL LETTER W +0058;Na # LATIN CAPITAL LETTER X +0059;Na # LATIN CAPITAL LETTER Y +005A;Na # LATIN CAPITAL LETTER Z +005B;Na # LEFT SQUARE BRACKET +005C;Na # REVERSE SOLIDUS +005D;Na # RIGHT SQUARE BRACKET +005E;Na # CIRCUMFLEX ACCENT +005F;Na # LOW LINE +0060;Na # GRAVE ACCENT +0061;Na # LATIN SMALL LETTER A +0062;Na # LATIN SMALL LETTER B +0063;Na # LATIN SMALL LETTER C +0064;Na # LATIN SMALL LETTER D +0065;Na # LATIN SMALL LETTER E +0066;Na # LATIN SMALL LETTER F +0067;Na # LATIN SMALL LETTER G +0068;Na # LATIN SMALL LETTER H +0069;Na # LATIN SMALL LETTER I +006A;Na # LATIN SMALL LETTER J +006B;Na # LATIN SMALL LETTER K +006C;Na # LATIN SMALL LETTER L +006D;Na # LATIN SMALL LETTER M +006E;Na # LATIN SMALL LETTER N +006F;Na # LATIN SMALL LETTER O +0070;Na # LATIN SMALL LETTER P +0071;Na # LATIN SMALL LETTER Q +0072;Na # LATIN SMALL LETTER R +0073;Na # LATIN SMALL LETTER S +0074;Na # LATIN SMALL LETTER T +0075;Na # LATIN SMALL LETTER U +0076;Na # LATIN SMALL LETTER V +0077;Na # LATIN SMALL LETTER W +0078;Na # LATIN SMALL LETTER X +0079;Na # LATIN SMALL LETTER Y +007A;Na # LATIN SMALL LETTER Z +007B;Na # LEFT CURLY BRACKET +007C;Na # VERTICAL LINE +007D;Na # RIGHT CURLY BRACKET +007E;Na # TILDE +007F;N # <control> +0080;N # <control> +0081;N # <control> +0082;N # <control> +0083;N # <control> +0084;N # <control> +0085;N # <control> +0086;N # <control> +0087;N # <control> +0088;N # <control> +0089;N # <control> +008A;N # <control> +008B;N # <control> +008C;N # <control> +008D;N # <control> +008E;N # <control> +008F;N # <control> +0090;N # <control> +0091;N # <control> +0092;N # <control> +0093;N # <control> +0094;N # <control> +0095;N # <control> +0096;N # <control> +0097;N # <control> +0098;N # <control> +0099;N # <control> +009A;N # <control> +009B;N # <control> +009C;N # <control> +009D;N # <control> +009E;N # <control> +009F;N # <control> +00A0;N # NO-BREAK SPACE +00A1;A # INVERTED EXCLAMATION MARK +00A2;Na # CENT SIGN +00A3;Na # POUND SIGN +00A4;A # CURRENCY SIGN +00A5;Na # YEN SIGN +00A6;Na # BROKEN BAR +00A7;A # SECTION SIGN +00A8;A # DIAERESIS +00A9;N # COPYRIGHT SIGN +00AA;A # FEMININE ORDINAL INDICATOR +00AB;N # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +00AC;Na # NOT SIGN +00AD;A # SOFT HYPHEN +00AE;A # REGISTERED SIGN +00AF;Na # MACRON +00B0;A # DEGREE SIGN +00B1;A # PLUS-MINUS SIGN +00B2;A # SUPERSCRIPT TWO +00B3;A # SUPERSCRIPT THREE +00B4;A # ACUTE ACCENT +00B5;N # MICRO SIGN +00B6;A # PILCROW SIGN +00B7;A # MIDDLE DOT +00B8;A # CEDILLA +00B9;A # SUPERSCRIPT ONE +00BA;A # MASCULINE ORDINAL INDICATOR +00BB;N # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK +00BC;A # VULGAR FRACTION ONE QUARTER +00BD;A # VULGAR FRACTION ONE HALF +00BE;A # VULGAR FRACTION THREE QUARTERS +00BF;A # INVERTED QUESTION MARK +00C0;N # LATIN CAPITAL LETTER A WITH GRAVE +00C1;N # LATIN CAPITAL LETTER A WITH ACUTE +00C2;N # LATIN CAPITAL LETTER A WITH CIRCUMFLEX +00C3;N # LATIN CAPITAL LETTER A WITH TILDE +00C4;N # LATIN CAPITAL LETTER A WITH DIAERESIS +00C5;N # LATIN CAPITAL LETTER A WITH RING ABOVE +00C6;A # LATIN CAPITAL LETTER AE +00C7;N # LATIN CAPITAL LETTER C WITH CEDILLA +00C8;N # LATIN CAPITAL LETTER E WITH GRAVE +00C9;N # LATIN CAPITAL LETTER E WITH ACUTE +00CA;N # LATIN CAPITAL LETTER E WITH CIRCUMFLEX +00CB;N # LATIN CAPITAL LETTER E WITH DIAERESIS +00CC;N # LATIN CAPITAL LETTER I WITH GRAVE +00CD;N # LATIN CAPITAL LETTER I WITH ACUTE +00CE;N # LATIN CAPITAL LETTER I WITH CIRCUMFLEX +00CF;N # LATIN CAPITAL LETTER I WITH DIAERESIS +00D0;A # LATIN CAPITAL LETTER ETH +00D1;N # LATIN CAPITAL LETTER N WITH TILDE +00D2;N # LATIN CAPITAL LETTER O WITH GRAVE +00D3;N # LATIN CAPITAL LETTER O WITH ACUTE +00D4;N # LATIN CAPITAL LETTER O WITH CIRCUMFLEX +00D5;N # LATIN CAPITAL LETTER O WITH TILDE +00D6;N # LATIN CAPITAL LETTER O WITH DIAERESIS +00D7;A # MULTIPLICATION SIGN +00D8;A # LATIN CAPITAL LETTER O WITH STROKE +00D9;N # LATIN CAPITAL LETTER U WITH GRAVE +00DA;N # LATIN CAPITAL LETTER U WITH ACUTE +00DB;N # LATIN CAPITAL LETTER U WITH CIRCUMFLEX +00DC;N # LATIN CAPITAL LETTER U WITH DIAERESIS +00DD;N # LATIN CAPITAL LETTER Y WITH ACUTE +00DE;A # LATIN CAPITAL LETTER THORN +00DF;A # LATIN SMALL LETTER SHARP S +00E0;A # LATIN SMALL LETTER A WITH GRAVE +00E1;A # LATIN SMALL LETTER A WITH ACUTE +00E2;N # LATIN SMALL LETTER A WITH CIRCUMFLEX +00E3;N # LATIN SMALL LETTER A WITH TILDE +00E4;N # LATIN SMALL LETTER A WITH DIAERESIS +00E5;N # LATIN SMALL LETTER A WITH RING ABOVE +00E6;A # LATIN SMALL LETTER AE +00E7;N # LATIN SMALL LETTER C WITH CEDILLA +00E8;A # LATIN SMALL LETTER E WITH GRAVE +00E9;A # LATIN SMALL LETTER E WITH ACUTE +00EA;A # LATIN SMALL LETTER E WITH CIRCUMFLEX +00EB;N # LATIN SMALL LETTER E WITH DIAERESIS +00EC;A # LATIN SMALL LETTER I WITH GRAVE +00ED;A # LATIN SMALL LETTER I WITH ACUTE +00EE;N # LATIN SMALL LETTER I WITH CIRCUMFLEX +00EF;N # LATIN SMALL LETTER I WITH DIAERESIS +00F0;A # LATIN SMALL LETTER ETH +00F1;N # LATIN SMALL LETTER N WITH TILDE +00F2;A # LATIN SMALL LETTER O WITH GRAVE +00F3;A # LATIN SMALL LETTER O WITH ACUTE +00F4;N # LATIN SMALL LETTER O WITH CIRCUMFLEX +00F5;N # LATIN SMALL LETTER O WITH TILDE +00F6;N # LATIN SMALL LETTER O WITH DIAERESIS +00F7;A # DIVISION SIGN +00F8;A # LATIN SMALL LETTER O WITH STROKE +00F9;A # LATIN SMALL LETTER U WITH GRAVE +00FA;A # LATIN SMALL LETTER U WITH ACUTE +00FB;N # LATIN SMALL LETTER U WITH CIRCUMFLEX +00FC;A # LATIN SMALL LETTER U WITH DIAERESIS +00FD;N # LATIN SMALL LETTER Y WITH ACUTE +00FE;A # LATIN SMALL LETTER THORN +00FF;N # LATIN SMALL LETTER Y WITH DIAERESIS +0100;N # LATIN CAPITAL LETTER A WITH MACRON +0101;A # LATIN SMALL LETTER A WITH MACRON +0102;N # LATIN CAPITAL LETTER A WITH BREVE +0103;N # LATIN SMALL LETTER A WITH BREVE +0104;N # LATIN CAPITAL LETTER A WITH OGONEK +0105;N # LATIN SMALL LETTER A WITH OGONEK +0106;N # LATIN CAPITAL LETTER C WITH ACUTE +0107;N # LATIN SMALL LETTER C WITH ACUTE +0108;N # LATIN CAPITAL LETTER C WITH CIRCUMFLEX +0109;N # LATIN SMALL LETTER C WITH CIRCUMFLEX +010A;N # LATIN CAPITAL LETTER C WITH DOT ABOVE +010B;N # LATIN SMALL LETTER C WITH DOT ABOVE +010C;N # LATIN CAPITAL LETTER C WITH CARON +010D;N # LATIN SMALL LETTER C WITH CARON +010E;N # LATIN CAPITAL LETTER D WITH CARON +010F;N # LATIN SMALL LETTER D WITH CARON +0110;N # LATIN CAPITAL LETTER D WITH STROKE +0111;A # LATIN SMALL LETTER D WITH STROKE +0112;N # LATIN CAPITAL LETTER E WITH MACRON +0113;A # LATIN SMALL LETTER E WITH MACRON +0114;N # LATIN CAPITAL LETTER E WITH BREVE +0115;N # LATIN SMALL LETTER E WITH BREVE +0116;N # LATIN CAPITAL LETTER E WITH DOT ABOVE +0117;N # LATIN SMALL LETTER E WITH DOT ABOVE +0118;N # LATIN CAPITAL LETTER E WITH OGONEK +0119;N # LATIN SMALL LETTER E WITH OGONEK +011A;N # LATIN CAPITAL LETTER E WITH CARON +011B;A # LATIN SMALL LETTER E WITH CARON +011C;N # LATIN CAPITAL LETTER G WITH CIRCUMFLEX +011D;N # LATIN SMALL LETTER G WITH CIRCUMFLEX +011E;N # LATIN CAPITAL LETTER G WITH BREVE +011F;N # LATIN SMALL LETTER G WITH BREVE +0120;N # LATIN CAPITAL LETTER G WITH DOT ABOVE +0121;N # LATIN SMALL LETTER G WITH DOT ABOVE +0122;N # LATIN CAPITAL LETTER G WITH CEDILLA +0123;N # LATIN SMALL LETTER G WITH CEDILLA +0124;N # LATIN CAPITAL LETTER H WITH CIRCUMFLEX +0125;N # LATIN SMALL LETTER H WITH CIRCUMFLEX +0126;A # LATIN CAPITAL LETTER H WITH STROKE +0127;A # LATIN SMALL LETTER H WITH STROKE +0128;N # LATIN CAPITAL LETTER I WITH TILDE +0129;N # LATIN SMALL LETTER I WITH TILDE +012A;N # LATIN CAPITAL LETTER I WITH MACRON +012B;A # LATIN SMALL LETTER I WITH MACRON +012C;N # LATIN CAPITAL LETTER I WITH BREVE +012D;N # LATIN SMALL LETTER I WITH BREVE +012E;N # LATIN CAPITAL LETTER I WITH OGONEK +012F;N # LATIN SMALL LETTER I WITH OGONEK +0130;N # LATIN CAPITAL LETTER I WITH DOT ABOVE +0131;A # LATIN SMALL LETTER DOTLESS I +0132;A # LATIN CAPITAL LIGATURE IJ +0133;A # LATIN SMALL LIGATURE IJ +0134;N # LATIN CAPITAL LETTER J WITH CIRCUMFLEX +0135;N # LATIN SMALL LETTER J WITH CIRCUMFLEX +0136;N # LATIN CAPITAL LETTER K WITH CEDILLA +0137;N # LATIN SMALL LETTER K WITH CEDILLA +0138;A # LATIN SMALL LETTER KRA +0139;N # LATIN CAPITAL LETTER L WITH ACUTE +013A;N # LATIN SMALL LETTER L WITH ACUTE +013B;N # LATIN CAPITAL LETTER L WITH CEDILLA +013C;N # LATIN SMALL LETTER L WITH CEDILLA +013D;N # LATIN CAPITAL LETTER L WITH CARON +013E;N # LATIN SMALL LETTER L WITH CARON +013F;A # LATIN CAPITAL LETTER L WITH MIDDLE DOT +0140;A # LATIN SMALL LETTER L WITH MIDDLE DOT +0141;A # LATIN CAPITAL LETTER L WITH STROKE +0142;A # LATIN SMALL LETTER L WITH STROKE +0143;N # LATIN CAPITAL LETTER N WITH ACUTE +0144;A # LATIN SMALL LETTER N WITH ACUTE +0145;N # LATIN CAPITAL LETTER N WITH CEDILLA +0146;N # LATIN SMALL LETTER N WITH CEDILLA +0147;N # LATIN CAPITAL LETTER N WITH CARON +0148;A # LATIN SMALL LETTER N WITH CARON +0149;A # LATIN SMALL LETTER N PRECEDED BY APOSTROPHE +014A;A # LATIN CAPITAL LETTER ENG +014B;A # LATIN SMALL LETTER ENG +014C;N # LATIN CAPITAL LETTER O WITH MACRON +014D;A # LATIN SMALL LETTER O WITH MACRON +014E;N # LATIN CAPITAL LETTER O WITH BREVE +014F;N # LATIN SMALL LETTER O WITH BREVE +0150;N # LATIN CAPITAL LETTER O WITH DOUBLE ACUTE +0151;N # LATIN SMALL LETTER O WITH DOUBLE ACUTE +0152;A # LATIN CAPITAL LIGATURE OE +0153;A # LATIN SMALL LIGATURE OE +0154;N # LATIN CAPITAL LETTER R WITH ACUTE +0155;N # LATIN SMALL LETTER R WITH ACUTE +0156;N # LATIN CAPITAL LETTER R WITH CEDILLA +0157;N # LATIN SMALL LETTER R WITH CEDILLA +0158;N # LATIN CAPITAL LETTER R WITH CARON +0159;N # LATIN SMALL LETTER R WITH CARON +015A;N # LATIN CAPITAL LETTER S WITH ACUTE +015B;N # LATIN SMALL LETTER S WITH ACUTE +015C;N # LATIN CAPITAL LETTER S WITH CIRCUMFLEX +015D;N # LATIN SMALL LETTER S WITH CIRCUMFLEX +015E;N # LATIN CAPITAL LETTER S WITH CEDILLA +015F;N # LATIN SMALL LETTER S WITH CEDILLA +0160;N # LATIN CAPITAL LETTER S WITH CARON +0161;N # LATIN SMALL LETTER S WITH CARON +0162;N # LATIN CAPITAL LETTER T WITH CEDILLA +0163;N # LATIN SMALL LETTER T WITH CEDILLA +0164;N # LATIN CAPITAL LETTER T WITH CARON +0165;N # LATIN SMALL LETTER T WITH CARON +0166;A # LATIN CAPITAL LETTER T WITH STROKE +0167;A # LATIN SMALL LETTER T WITH STROKE +0168;N # LATIN CAPITAL LETTER U WITH TILDE +0169;N # LATIN SMALL LETTER U WITH TILDE +016A;N # LATIN CAPITAL LETTER U WITH MACRON +016B;A # LATIN SMALL LETTER U WITH MACRON +016C;N # LATIN CAPITAL LETTER U WITH BREVE +016D;N # LATIN SMALL LETTER U WITH BREVE +016E;N # LATIN CAPITAL LETTER U WITH RING ABOVE +016F;N # LATIN SMALL LETTER U WITH RING ABOVE +0170;N # LATIN CAPITAL LETTER U WITH DOUBLE ACUTE +0171;N # LATIN SMALL LETTER U WITH DOUBLE ACUTE +0172;N # LATIN CAPITAL LETTER U WITH OGONEK +0173;N # LATIN SMALL LETTER U WITH OGONEK +0174;N # LATIN CAPITAL LETTER W WITH CIRCUMFLEX +0175;N # LATIN SMALL LETTER W WITH CIRCUMFLEX +0176;N # LATIN CAPITAL LETTER Y WITH CIRCUMFLEX +0177;N # LATIN SMALL LETTER Y WITH CIRCUMFLEX +0178;N # LATIN CAPITAL LETTER Y WITH DIAERESIS +0179;N # LATIN CAPITAL LETTER Z WITH ACUTE +017A;N # LATIN SMALL LETTER Z WITH ACUTE +017B;N # LATIN CAPITAL LETTER Z WITH DOT ABOVE +017C;N # LATIN SMALL LETTER Z WITH DOT ABOVE +017D;N # LATIN CAPITAL LETTER Z WITH CARON +017E;N # LATIN SMALL LETTER Z WITH CARON +017F;N # LATIN SMALL LETTER LONG S +0180;N # LATIN SMALL LETTER B WITH STROKE +0181;N # LATIN CAPITAL LETTER B WITH HOOK +0182;N # LATIN CAPITAL LETTER B WITH TOPBAR +0183;N # LATIN SMALL LETTER B WITH TOPBAR +0184;N # LATIN CAPITAL LETTER TONE SIX +0185;N # LATIN SMALL LETTER TONE SIX +0186;N # LATIN CAPITAL LETTER OPEN O +0187;N # LATIN CAPITAL LETTER C WITH HOOK +0188;N # LATIN SMALL LETTER C WITH HOOK +0189;N # LATIN CAPITAL LETTER AFRICAN D +018A;N # LATIN CAPITAL LETTER D WITH HOOK +018B;N # LATIN CAPITAL LETTER D WITH TOPBAR +018C;N # LATIN SMALL LETTER D WITH TOPBAR +018D;N # LATIN SMALL LETTER TURNED DELTA +018E;N # LATIN CAPITAL LETTER REVERSED E +018F;N # LATIN CAPITAL LETTER SCHWA +0190;N # LATIN CAPITAL LETTER OPEN E +0191;N # LATIN CAPITAL LETTER F WITH HOOK +0192;N # LATIN SMALL LETTER F WITH HOOK +0193;N # LATIN CAPITAL LETTER G WITH HOOK +0194;N # LATIN CAPITAL LETTER GAMMA +0195;N # LATIN SMALL LETTER HV +0196;N # LATIN CAPITAL LETTER IOTA +0197;N # LATIN CAPITAL LETTER I WITH STROKE +0198;N # LATIN CAPITAL LETTER K WITH HOOK +0199;N # LATIN SMALL LETTER K WITH HOOK +019A;N # LATIN SMALL LETTER L WITH BAR +019B;N # LATIN SMALL LETTER LAMBDA WITH STROKE +019C;N # LATIN CAPITAL LETTER TURNED M +019D;N # LATIN CAPITAL LETTER N WITH LEFT HOOK +019E;N # LATIN SMALL LETTER N WITH LONG RIGHT LEG +019F;N # LATIN CAPITAL LETTER O WITH MIDDLE TILDE +01A0;N # LATIN CAPITAL LETTER O WITH HORN +01A1;N # LATIN SMALL LETTER O WITH HORN +01A2;N # LATIN CAPITAL LETTER OI +01A3;N # LATIN SMALL LETTER OI +01A4;N # LATIN CAPITAL LETTER P WITH HOOK +01A5;N # LATIN SMALL LETTER P WITH HOOK +01A6;N # LATIN LETTER YR +01A7;N # LATIN CAPITAL LETTER TONE TWO +01A8;N # LATIN SMALL LETTER TONE TWO +01A9;N # LATIN CAPITAL LETTER ESH +01AA;N # LATIN LETTER REVERSED ESH LOOP +01AB;N # LATIN SMALL LETTER T WITH PALATAL HOOK +01AC;N # LATIN CAPITAL LETTER T WITH HOOK +01AD;N # LATIN SMALL LETTER T WITH HOOK +01AE;N # LATIN CAPITAL LETTER T WITH RETROFLEX HOOK +01AF;N # LATIN CAPITAL LETTER U WITH HORN +01B0;N # LATIN SMALL LETTER U WITH HORN +01B1;N # LATIN CAPITAL LETTER UPSILON +01B2;N # LATIN CAPITAL LETTER V WITH HOOK +01B3;N # LATIN CAPITAL LETTER Y WITH HOOK +01B4;N # LATIN SMALL LETTER Y WITH HOOK +01B5;N # LATIN CAPITAL LETTER Z WITH STROKE +01B6;N # LATIN SMALL LETTER Z WITH STROKE +01B7;N # LATIN CAPITAL LETTER EZH +01B8;N # LATIN CAPITAL LETTER EZH REVERSED +01B9;N # LATIN SMALL LETTER EZH REVERSED +01BA;N # LATIN SMALL LETTER EZH WITH TAIL +01BB;N # LATIN LETTER TWO WITH STROKE +01BC;N # LATIN CAPITAL LETTER TONE FIVE +01BD;N # LATIN SMALL LETTER TONE FIVE +01BE;N # LATIN LETTER INVERTED GLOTTAL STOP WITH STROKE +01BF;N # LATIN LETTER WYNN +01C0;N # LATIN LETTER DENTAL CLICK +01C1;N # LATIN LETTER LATERAL CLICK +01C2;N # LATIN LETTER ALVEOLAR CLICK +01C3;N # LATIN LETTER RETROFLEX CLICK +01C4;N # LATIN CAPITAL LETTER DZ WITH CARON +01C5;N # LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON +01C6;N # LATIN SMALL LETTER DZ WITH CARON +01C7;N # LATIN CAPITAL LETTER LJ +01C8;N # LATIN CAPITAL LETTER L WITH SMALL LETTER J +01C9;N # LATIN SMALL LETTER LJ +01CA;N # LATIN CAPITAL LETTER NJ +01CB;N # LATIN CAPITAL LETTER N WITH SMALL LETTER J +01CC;N # LATIN SMALL LETTER NJ +01CD;N # LATIN CAPITAL LETTER A WITH CARON +01CE;A # LATIN SMALL LETTER A WITH CARON +01CF;N # LATIN CAPITAL LETTER I WITH CARON +01D0;A # LATIN SMALL LETTER I WITH CARON +01D1;N # LATIN CAPITAL LETTER O WITH CARON +01D2;A # LATIN SMALL LETTER O WITH CARON +01D3;N # LATIN CAPITAL LETTER U WITH CARON +01D4;A # LATIN SMALL LETTER U WITH CARON +01D5;N # LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON +01D6;A # LATIN SMALL LETTER U WITH DIAERESIS AND MACRON +01D7;N # LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE +01D8;A # LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE +01D9;N # LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON +01DA;A # LATIN SMALL LETTER U WITH DIAERESIS AND CARON +01DB;N # LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE +01DC;A # LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE +01DD;N # LATIN SMALL LETTER TURNED E +01DE;N # LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON +01DF;N # LATIN SMALL LETTER A WITH DIAERESIS AND MACRON +01E0;N # LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON +01E1;N # LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON +01E2;N # LATIN CAPITAL LETTER AE WITH MACRON +01E3;N # LATIN SMALL LETTER AE WITH MACRON +01E4;N # LATIN CAPITAL LETTER G WITH STROKE +01E5;N # LATIN SMALL LETTER G WITH STROKE +01E6;N # LATIN CAPITAL LETTER G WITH CARON +01E7;N # LATIN SMALL LETTER G WITH CARON +01E8;N # LATIN CAPITAL LETTER K WITH CARON +01E9;N # LATIN SMALL LETTER K WITH CARON +01EA;N # LATIN CAPITAL LETTER O WITH OGONEK +01EB;N # LATIN SMALL LETTER O WITH OGONEK +01EC;N # LATIN CAPITAL LETTER O WITH OGONEK AND MACRON +01ED;N # LATIN SMALL LETTER O WITH OGONEK AND MACRON +01EE;N # LATIN CAPITAL LETTER EZH WITH CARON +01EF;N # LATIN SMALL LETTER EZH WITH CARON +01F0;N # LATIN SMALL LETTER J WITH CARON +01F1;N # LATIN CAPITAL LETTER DZ +01F2;N # LATIN CAPITAL LETTER D WITH SMALL LETTER Z +01F3;N # LATIN SMALL LETTER DZ +01F4;N # LATIN CAPITAL LETTER G WITH ACUTE +01F5;N # LATIN SMALL LETTER G WITH ACUTE +01F6;N # LATIN CAPITAL LETTER HWAIR +01F7;N # LATIN CAPITAL LETTER WYNN +01F8;N # LATIN CAPITAL LETTER N WITH GRAVE +01F9;N # LATIN SMALL LETTER N WITH GRAVE +01FA;N # LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE +01FB;N # LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE +01FC;N # LATIN CAPITAL LETTER AE WITH ACUTE +01FD;N # LATIN SMALL LETTER AE WITH ACUTE +01FE;N # LATIN CAPITAL LETTER O WITH STROKE AND ACUTE +01FF;N # LATIN SMALL LETTER O WITH STROKE AND ACUTE +0200;N # LATIN CAPITAL LETTER A WITH DOUBLE GRAVE +0201;N # LATIN SMALL LETTER A WITH DOUBLE GRAVE +0202;N # LATIN CAPITAL LETTER A WITH INVERTED BREVE +0203;N # LATIN SMALL LETTER A WITH INVERTED BREVE +0204;N # LATIN CAPITAL LETTER E WITH DOUBLE GRAVE +0205;N # LATIN SMALL LETTER E WITH DOUBLE GRAVE +0206;N # LATIN CAPITAL LETTER E WITH INVERTED BREVE +0207;N # LATIN SMALL LETTER E WITH INVERTED BREVE +0208;N # LATIN CAPITAL LETTER I WITH DOUBLE GRAVE +0209;N # LATIN SMALL LETTER I WITH DOUBLE GRAVE +020A;N # LATIN CAPITAL LETTER I WITH INVERTED BREVE +020B;N # LATIN SMALL LETTER I WITH INVERTED BREVE +020C;N # LATIN CAPITAL LETTER O WITH DOUBLE GRAVE +020D;N # LATIN SMALL LETTER O WITH DOUBLE GRAVE +020E;N # LATIN CAPITAL LETTER O WITH INVERTED BREVE +020F;N # LATIN SMALL LETTER O WITH INVERTED BREVE +0210;N # LATIN CAPITAL LETTER R WITH DOUBLE GRAVE +0211;N # LATIN SMALL LETTER R WITH DOUBLE GRAVE +0212;N # LATIN CAPITAL LETTER R WITH INVERTED BREVE +0213;N # LATIN SMALL LETTER R WITH INVERTED BREVE +0214;N # LATIN CAPITAL LETTER U WITH DOUBLE GRAVE +0215;N # LATIN SMALL LETTER U WITH DOUBLE GRAVE +0216;N # LATIN CAPITAL LETTER U WITH INVERTED BREVE +0217;N # LATIN SMALL LETTER U WITH INVERTED BREVE +0218;N # LATIN CAPITAL LETTER S WITH COMMA BELOW +0219;N # LATIN SMALL LETTER S WITH COMMA BELOW +021A;N # LATIN CAPITAL LETTER T WITH COMMA BELOW +021B;N # LATIN SMALL LETTER T WITH COMMA BELOW +021C;N # LATIN CAPITAL LETTER YOGH +021D;N # LATIN SMALL LETTER YOGH +021E;N # LATIN CAPITAL LETTER H WITH CARON +021F;N # LATIN SMALL LETTER H WITH CARON +0220;N # LATIN CAPITAL LETTER N WITH LONG RIGHT LEG +0221;N # LATIN SMALL LETTER D WITH CURL +0222;N # LATIN CAPITAL LETTER OU +0223;N # LATIN SMALL LETTER OU +0224;N # LATIN CAPITAL LETTER Z WITH HOOK +0225;N # LATIN SMALL LETTER Z WITH HOOK +0226;N # LATIN CAPITAL LETTER A WITH DOT ABOVE +0227;N # LATIN SMALL LETTER A WITH DOT ABOVE +0228;N # LATIN CAPITAL LETTER E WITH CEDILLA +0229;N # LATIN SMALL LETTER E WITH CEDILLA +022A;N # LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON +022B;N # LATIN SMALL LETTER O WITH DIAERESIS AND MACRON +022C;N # LATIN CAPITAL LETTER O WITH TILDE AND MACRON +022D;N # LATIN SMALL LETTER O WITH TILDE AND MACRON +022E;N # LATIN CAPITAL LETTER O WITH DOT ABOVE +022F;N # LATIN SMALL LETTER O WITH DOT ABOVE +0230;N # LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON +0231;N # LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON +0232;N # LATIN CAPITAL LETTER Y WITH MACRON +0233;N # LATIN SMALL LETTER Y WITH MACRON +0234;N # LATIN SMALL LETTER L WITH CURL +0235;N # LATIN SMALL LETTER N WITH CURL +0236;N # LATIN SMALL LETTER T WITH CURL +0237;N # LATIN SMALL LETTER DOTLESS J +0238;N # LATIN SMALL LETTER DB DIGRAPH +0239;N # LATIN SMALL LETTER QP DIGRAPH +023A;N # LATIN CAPITAL LETTER A WITH STROKE +023B;N # LATIN CAPITAL LETTER C WITH STROKE +023C;N # LATIN SMALL LETTER C WITH STROKE +023D;N # LATIN CAPITAL LETTER L WITH BAR +023E;N # LATIN CAPITAL LETTER T WITH DIAGONAL STROKE +023F;N # LATIN SMALL LETTER S WITH SWASH TAIL +0240;N # LATIN SMALL LETTER Z WITH SWASH TAIL +0241;N # LATIN CAPITAL LETTER GLOTTAL STOP +0250;N # LATIN SMALL LETTER TURNED A +0251;A # LATIN SMALL LETTER ALPHA +0252;N # LATIN SMALL LETTER TURNED ALPHA +0253;N # LATIN SMALL LETTER B WITH HOOK +0254;N # LATIN SMALL LETTER OPEN O +0255;N # LATIN SMALL LETTER C WITH CURL +0256;N # LATIN SMALL LETTER D WITH TAIL +0257;N # LATIN SMALL LETTER D WITH HOOK +0258;N # LATIN SMALL LETTER REVERSED E +0259;N # LATIN SMALL LETTER SCHWA +025A;N # LATIN SMALL LETTER SCHWA WITH HOOK +025B;N # LATIN SMALL LETTER OPEN E +025C;N # LATIN SMALL LETTER REVERSED OPEN E +025D;N # LATIN SMALL LETTER REVERSED OPEN E WITH HOOK +025E;N # LATIN SMALL LETTER CLOSED REVERSED OPEN E +025F;N # LATIN SMALL LETTER DOTLESS J WITH STROKE +0260;N # LATIN SMALL LETTER G WITH HOOK +0261;A # LATIN SMALL LETTER SCRIPT G +0262;N # LATIN LETTER SMALL CAPITAL G +0263;N # LATIN SMALL LETTER GAMMA +0264;N # LATIN SMALL LETTER RAMS HORN +0265;N # LATIN SMALL LETTER TURNED H +0266;N # LATIN SMALL LETTER H WITH HOOK +0267;N # LATIN SMALL LETTER HENG WITH HOOK +0268;N # LATIN SMALL LETTER I WITH STROKE +0269;N # LATIN SMALL LETTER IOTA +026A;N # LATIN LETTER SMALL CAPITAL I +026B;N # LATIN SMALL LETTER L WITH MIDDLE TILDE +026C;N # LATIN SMALL LETTER L WITH BELT +026D;N # LATIN SMALL LETTER L WITH RETROFLEX HOOK +026E;N # LATIN SMALL LETTER LEZH +026F;N # LATIN SMALL LETTER TURNED M +0270;N # LATIN SMALL LETTER TURNED M WITH LONG LEG +0271;N # LATIN SMALL LETTER M WITH HOOK +0272;N # LATIN SMALL LETTER N WITH LEFT HOOK +0273;N # LATIN SMALL LETTER N WITH RETROFLEX HOOK +0274;N # LATIN LETTER SMALL CAPITAL N +0275;N # LATIN SMALL LETTER BARRED O +0276;N # LATIN LETTER SMALL CAPITAL OE +0277;N # LATIN SMALL LETTER CLOSED OMEGA +0278;N # LATIN SMALL LETTER PHI +0279;N # LATIN SMALL LETTER TURNED R +027A;N # LATIN SMALL LETTER TURNED R WITH LONG LEG +027B;N # LATIN SMALL LETTER TURNED R WITH HOOK +027C;N # LATIN SMALL LETTER R WITH LONG LEG +027D;N # LATIN SMALL LETTER R WITH TAIL +027E;N # LATIN SMALL LETTER R WITH FISHHOOK +027F;N # LATIN SMALL LETTER REVERSED R WITH FISHHOOK +0280;N # LATIN LETTER SMALL CAPITAL R +0281;N # LATIN LETTER SMALL CAPITAL INVERTED R +0282;N # LATIN SMALL LETTER S WITH HOOK +0283;N # LATIN SMALL LETTER ESH +0284;N # LATIN SMALL LETTER DOTLESS J WITH STROKE AND HOOK +0285;N # LATIN SMALL LETTER SQUAT REVERSED ESH +0286;N # LATIN SMALL LETTER ESH WITH CURL +0287;N # LATIN SMALL LETTER TURNED T +0288;N # LATIN SMALL LETTER T WITH RETROFLEX HOOK +0289;N # LATIN SMALL LETTER U BAR +028A;N # LATIN SMALL LETTER UPSILON +028B;N # LATIN SMALL LETTER V WITH HOOK +028C;N # LATIN SMALL LETTER TURNED V +028D;N # LATIN SMALL LETTER TURNED W +028E;N # LATIN SMALL LETTER TURNED Y +028F;N # LATIN LETTER SMALL CAPITAL Y +0290;N # LATIN SMALL LETTER Z WITH RETROFLEX HOOK +0291;N # LATIN SMALL LETTER Z WITH CURL +0292;N # LATIN SMALL LETTER EZH +0293;N # LATIN SMALL LETTER EZH WITH CURL +0294;N # LATIN LETTER GLOTTAL STOP +0295;N # LATIN LETTER PHARYNGEAL VOICED FRICATIVE +0296;N # LATIN LETTER INVERTED GLOTTAL STOP +0297;N # LATIN LETTER STRETCHED C +0298;N # LATIN LETTER BILABIAL CLICK +0299;N # LATIN LETTER SMALL CAPITAL B +029A;N # LATIN SMALL LETTER CLOSED OPEN E +029B;N # LATIN LETTER SMALL CAPITAL G WITH HOOK +029C;N # LATIN LETTER SMALL CAPITAL H +029D;N # LATIN SMALL LETTER J WITH CROSSED-TAIL +029E;N # LATIN SMALL LETTER TURNED K +029F;N # LATIN LETTER SMALL CAPITAL L +02A0;N # LATIN SMALL LETTER Q WITH HOOK +02A1;N # LATIN LETTER GLOTTAL STOP WITH STROKE +02A2;N # LATIN LETTER REVERSED GLOTTAL STOP WITH STROKE +02A3;N # LATIN SMALL LETTER DZ DIGRAPH +02A4;N # LATIN SMALL LETTER DEZH DIGRAPH +02A5;N # LATIN SMALL LETTER DZ DIGRAPH WITH CURL +02A6;N # LATIN SMALL LETTER TS DIGRAPH +02A7;N # LATIN SMALL LETTER TESH DIGRAPH +02A8;N # LATIN SMALL LETTER TC DIGRAPH WITH CURL +02A9;N # LATIN SMALL LETTER FENG DIGRAPH +02AA;N # LATIN SMALL LETTER LS DIGRAPH +02AB;N # LATIN SMALL LETTER LZ DIGRAPH +02AC;N # LATIN LETTER BILABIAL PERCUSSIVE +02AD;N # LATIN LETTER BIDENTAL PERCUSSIVE +02AE;N # LATIN SMALL LETTER TURNED H WITH FISHHOOK +02AF;N # LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL +02B0;N # MODIFIER LETTER SMALL H +02B1;N # MODIFIER LETTER SMALL H WITH HOOK +02B2;N # MODIFIER LETTER SMALL J +02B3;N # MODIFIER LETTER SMALL R +02B4;N # MODIFIER LETTER SMALL TURNED R +02B5;N # MODIFIER LETTER SMALL TURNED R WITH HOOK +02B6;N # MODIFIER LETTER SMALL CAPITAL INVERTED R +02B7;N # MODIFIER LETTER SMALL W +02B8;N # MODIFIER LETTER SMALL Y +02B9;N # MODIFIER LETTER PRIME +02BA;N # MODIFIER LETTER DOUBLE PRIME +02BB;N # MODIFIER LETTER TURNED COMMA +02BC;N # MODIFIER LETTER APOSTROPHE +02BD;N # MODIFIER LETTER REVERSED COMMA +02BE;N # MODIFIER LETTER RIGHT HALF RING +02BF;N # MODIFIER LETTER LEFT HALF RING +02C0;N # MODIFIER LETTER GLOTTAL STOP +02C1;N # MODIFIER LETTER REVERSED GLOTTAL STOP +02C2;N # MODIFIER LETTER LEFT ARROWHEAD +02C3;N # MODIFIER LETTER RIGHT ARROWHEAD +02C4;A # MODIFIER LETTER UP ARROWHEAD +02C5;N # MODIFIER LETTER DOWN ARROWHEAD +02C6;N # MODIFIER LETTER CIRCUMFLEX ACCENT +02C7;A # CARON +02C8;N # MODIFIER LETTER VERTICAL LINE +02C9;A # MODIFIER LETTER MACRON +02CA;A # MODIFIER LETTER ACUTE ACCENT +02CB;A # MODIFIER LETTER GRAVE ACCENT +02CC;N # MODIFIER LETTER LOW VERTICAL LINE +02CD;A # MODIFIER LETTER LOW MACRON +02CE;N # MODIFIER LETTER LOW GRAVE ACCENT +02CF;N # MODIFIER LETTER LOW ACUTE ACCENT +02D0;A # MODIFIER LETTER TRIANGULAR COLON +02D1;N # MODIFIER LETTER HALF TRIANGULAR COLON +02D2;N # MODIFIER LETTER CENTRED RIGHT HALF RING +02D3;N # MODIFIER LETTER CENTRED LEFT HALF RING +02D4;N # MODIFIER LETTER UP TACK +02D5;N # MODIFIER LETTER DOWN TACK +02D6;N # MODIFIER LETTER PLUS SIGN +02D7;N # MODIFIER LETTER MINUS SIGN +02D8;A # BREVE +02D9;A # DOT ABOVE +02DA;A # RING ABOVE +02DB;A # OGONEK +02DC;N # SMALL TILDE +02DD;A # DOUBLE ACUTE ACCENT +02DE;N # MODIFIER LETTER RHOTIC HOOK +02DF;A # MODIFIER LETTER CROSS ACCENT +02E0;N # MODIFIER LETTER SMALL GAMMA +02E1;N # MODIFIER LETTER SMALL L +02E2;N # MODIFIER LETTER SMALL S +02E3;N # MODIFIER LETTER SMALL X +02E4;N # MODIFIER LETTER SMALL REVERSED GLOTTAL STOP +02E5;N # MODIFIER LETTER EXTRA-HIGH TONE BAR +02E6;N # MODIFIER LETTER HIGH TONE BAR +02E7;N # MODIFIER LETTER MID TONE BAR +02E8;N # MODIFIER LETTER LOW TONE BAR +02E9;N # MODIFIER LETTER EXTRA-LOW TONE BAR +02EA;N # MODIFIER LETTER YIN DEPARTING TONE MARK +02EB;N # MODIFIER LETTER YANG DEPARTING TONE MARK +02EC;N # MODIFIER LETTER VOICING +02ED;N # MODIFIER LETTER UNASPIRATED +02EE;N # MODIFIER LETTER DOUBLE APOSTROPHE +02EF;N # MODIFIER LETTER LOW DOWN ARROWHEAD +02F0;N # MODIFIER LETTER LOW UP ARROWHEAD +02F1;N # MODIFIER LETTER LOW LEFT ARROWHEAD +02F2;N # MODIFIER LETTER LOW RIGHT ARROWHEAD +02F3;N # MODIFIER LETTER LOW RING +02F4;N # MODIFIER LETTER MIDDLE GRAVE ACCENT +02F5;N # MODIFIER LETTER MIDDLE DOUBLE GRAVE ACCENT +02F6;N # MODIFIER LETTER MIDDLE DOUBLE ACUTE ACCENT +02F7;N # MODIFIER LETTER LOW TILDE +02F8;N # MODIFIER LETTER RAISED COLON +02F9;N # MODIFIER LETTER BEGIN HIGH TONE +02FA;N # MODIFIER LETTER END HIGH TONE +02FB;N # MODIFIER LETTER BEGIN LOW TONE +02FC;N # MODIFIER LETTER END LOW TONE +02FD;N # MODIFIER LETTER SHELF +02FE;N # MODIFIER LETTER OPEN SHELF +02FF;N # MODIFIER LETTER LOW LEFT ARROW +0300;A # COMBINING GRAVE ACCENT +0301;A # COMBINING ACUTE ACCENT +0302;A # COMBINING CIRCUMFLEX ACCENT +0303;A # COMBINING TILDE +0304;A # COMBINING MACRON +0305;A # COMBINING OVERLINE +0306;A # COMBINING BREVE +0307;A # COMBINING DOT ABOVE +0308;A # COMBINING DIAERESIS +0309;A # COMBINING HOOK ABOVE +030A;A # COMBINING RING ABOVE +030B;A # COMBINING DOUBLE ACUTE ACCENT +030C;A # COMBINING CARON +030D;A # COMBINING VERTICAL LINE ABOVE +030E;A # COMBINING DOUBLE VERTICAL LINE ABOVE +030F;A # COMBINING DOUBLE GRAVE ACCENT +0310;A # COMBINING CANDRABINDU +0311;A # COMBINING INVERTED BREVE +0312;A # COMBINING TURNED COMMA ABOVE +0313;A # COMBINING COMMA ABOVE +0314;A # COMBINING REVERSED COMMA ABOVE +0315;A # COMBINING COMMA ABOVE RIGHT +0316;A # COMBINING GRAVE ACCENT BELOW +0317;A # COMBINING ACUTE ACCENT BELOW +0318;A # COMBINING LEFT TACK BELOW +0319;A # COMBINING RIGHT TACK BELOW +031A;A # COMBINING LEFT ANGLE ABOVE +031B;A # COMBINING HORN +031C;A # COMBINING LEFT HALF RING BELOW +031D;A # COMBINING UP TACK BELOW +031E;A # COMBINING DOWN TACK BELOW +031F;A # COMBINING PLUS SIGN BELOW +0320;A # COMBINING MINUS SIGN BELOW +0321;A # COMBINING PALATALIZED HOOK BELOW +0322;A # COMBINING RETROFLEX HOOK BELOW +0323;A # COMBINING DOT BELOW +0324;A # COMBINING DIAERESIS BELOW +0325;A # COMBINING RING BELOW +0326;A # COMBINING COMMA BELOW +0327;A # COMBINING CEDILLA +0328;A # COMBINING OGONEK +0329;A # COMBINING VERTICAL LINE BELOW +032A;A # COMBINING BRIDGE BELOW +032B;A # COMBINING INVERTED DOUBLE ARCH BELOW +032C;A # COMBINING CARON BELOW +032D;A # COMBINING CIRCUMFLEX ACCENT BELOW +032E;A # COMBINING BREVE BELOW +032F;A # COMBINING INVERTED BREVE BELOW +0330;A # COMBINING TILDE BELOW +0331;A # COMBINING MACRON BELOW +0332;A # COMBINING LOW LINE +0333;A # COMBINING DOUBLE LOW LINE +0334;A # COMBINING TILDE OVERLAY +0335;A # COMBINING SHORT STROKE OVERLAY +0336;A # COMBINING LONG STROKE OVERLAY +0337;A # COMBINING SHORT SOLIDUS OVERLAY +0338;A # COMBINING LONG SOLIDUS OVERLAY +0339;A # COMBINING RIGHT HALF RING BELOW +033A;A # COMBINING INVERTED BRIDGE BELOW +033B;A # COMBINING SQUARE BELOW +033C;A # COMBINING SEAGULL BELOW +033D;A # COMBINING X ABOVE +033E;A # COMBINING VERTICAL TILDE +033F;A # COMBINING DOUBLE OVERLINE +0340;A # COMBINING GRAVE TONE MARK +0341;A # COMBINING ACUTE TONE MARK +0342;A # COMBINING GREEK PERISPOMENI +0343;A # COMBINING GREEK KORONIS +0344;A # COMBINING GREEK DIALYTIKA TONOS +0345;A # COMBINING GREEK YPOGEGRAMMENI +0346;A # COMBINING BRIDGE ABOVE +0347;A # COMBINING EQUALS SIGN BELOW +0348;A # COMBINING DOUBLE VERTICAL LINE BELOW +0349;A # COMBINING LEFT ANGLE BELOW +034A;A # COMBINING NOT TILDE ABOVE +034B;A # COMBINING HOMOTHETIC ABOVE +034C;A # COMBINING ALMOST EQUAL TO ABOVE +034D;A # COMBINING LEFT RIGHT ARROW BELOW +034E;A # COMBINING UPWARDS ARROW BELOW +034F;A # COMBINING GRAPHEME JOINER +0350;A # COMBINING RIGHT ARROWHEAD ABOVE +0351;A # COMBINING LEFT HALF RING ABOVE +0352;A # COMBINING FERMATA +0353;A # COMBINING X BELOW +0354;A # COMBINING LEFT ARROWHEAD BELOW +0355;A # COMBINING RIGHT ARROWHEAD BELOW +0356;A # COMBINING RIGHT ARROWHEAD AND UP ARROWHEAD BELOW +0357;A # COMBINING RIGHT HALF RING ABOVE +0358;A # COMBINING DOT ABOVE RIGHT +0359;A # COMBINING ASTERISK BELOW +035A;A # COMBINING DOUBLE RING BELOW +035B;A # COMBINING ZIGZAG ABOVE +035C;A # COMBINING DOUBLE BREVE BELOW +035D;A # COMBINING DOUBLE BREVE +035E;A # COMBINING DOUBLE MACRON +035F;A # COMBINING DOUBLE MACRON BELOW +0360;A # COMBINING DOUBLE TILDE +0361;A # COMBINING DOUBLE INVERTED BREVE +0362;A # COMBINING DOUBLE RIGHTWARDS ARROW BELOW +0363;A # COMBINING LATIN SMALL LETTER A +0364;A # COMBINING LATIN SMALL LETTER E +0365;A # COMBINING LATIN SMALL LETTER I +0366;A # COMBINING LATIN SMALL LETTER O +0367;A # COMBINING LATIN SMALL LETTER U +0368;A # COMBINING LATIN SMALL LETTER C +0369;A # COMBINING LATIN SMALL LETTER D +036A;A # COMBINING LATIN SMALL LETTER H +036B;A # COMBINING LATIN SMALL LETTER M +036C;A # COMBINING LATIN SMALL LETTER R +036D;A # COMBINING LATIN SMALL LETTER T +036E;A # COMBINING LATIN SMALL LETTER V +036F;A # COMBINING LATIN SMALL LETTER X +0374;N # GREEK NUMERAL SIGN +0375;N # GREEK LOWER NUMERAL SIGN +037A;N # GREEK YPOGEGRAMMENI +037E;N # GREEK QUESTION MARK +0384;N # GREEK TONOS +0385;N # GREEK DIALYTIKA TONOS +0386;N # GREEK CAPITAL LETTER ALPHA WITH TONOS +0387;N # GREEK ANO TELEIA +0388;N # GREEK CAPITAL LETTER EPSILON WITH TONOS +0389;N # GREEK CAPITAL LETTER ETA WITH TONOS +038A;N # GREEK CAPITAL LETTER IOTA WITH TONOS +038C;N # GREEK CAPITAL LETTER OMICRON WITH TONOS +038E;N # GREEK CAPITAL LETTER UPSILON WITH TONOS +038F;N # GREEK CAPITAL LETTER OMEGA WITH TONOS +0390;N # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS +0391;A # GREEK CAPITAL LETTER ALPHA +0392;A # GREEK CAPITAL LETTER BETA +0393;A # GREEK CAPITAL LETTER GAMMA +0394;A # GREEK CAPITAL LETTER DELTA +0395;A # GREEK CAPITAL LETTER EPSILON +0396;A # GREEK CAPITAL LETTER ZETA +0397;A # GREEK CAPITAL LETTER ETA +0398;A # GREEK CAPITAL LETTER THETA +0399;A # GREEK CAPITAL LETTER IOTA +039A;A # GREEK CAPITAL LETTER KAPPA +039B;A # GREEK CAPITAL LETTER LAMDA +039C;A # GREEK CAPITAL LETTER MU +039D;A # GREEK CAPITAL LETTER NU +039E;A # GREEK CAPITAL LETTER XI +039F;A # GREEK CAPITAL LETTER OMICRON +03A0;A # GREEK CAPITAL LETTER PI +03A1;A # GREEK CAPITAL LETTER RHO +03A3;A # GREEK CAPITAL LETTER SIGMA +03A4;A # GREEK CAPITAL LETTER TAU +03A5;A # GREEK CAPITAL LETTER UPSILON +03A6;A # GREEK CAPITAL LETTER PHI +03A7;A # GREEK CAPITAL LETTER CHI +03A8;A # GREEK CAPITAL LETTER PSI +03A9;A # GREEK CAPITAL LETTER OMEGA +03AA;N # GREEK CAPITAL LETTER IOTA WITH DIALYTIKA +03AB;N # GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA +03AC;N # GREEK SMALL LETTER ALPHA WITH TONOS +03AD;N # GREEK SMALL LETTER EPSILON WITH TONOS +03AE;N # GREEK SMALL LETTER ETA WITH TONOS +03AF;N # GREEK SMALL LETTER IOTA WITH TONOS +03B0;N # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS +03B1;A # GREEK SMALL LETTER ALPHA +03B2;A # GREEK SMALL LETTER BETA +03B3;A # GREEK SMALL LETTER GAMMA +03B4;A # GREEK SMALL LETTER DELTA +03B5;A # GREEK SMALL LETTER EPSILON +03B6;A # GREEK SMALL LETTER ZETA +03B7;A # GREEK SMALL LETTER ETA +03B8;A # GREEK SMALL LETTER THETA +03B9;A # GREEK SMALL LETTER IOTA +03BA;A # GREEK SMALL LETTER KAPPA +03BB;A # GREEK SMALL LETTER LAMDA +03BC;A # GREEK SMALL LETTER MU +03BD;A # GREEK SMALL LETTER NU +03BE;A # GREEK SMALL LETTER XI +03BF;A # GREEK SMALL LETTER OMICRON +03C0;A # GREEK SMALL LETTER PI +03C1;A # GREEK SMALL LETTER RHO +03C2;N # GREEK SMALL LETTER FINAL SIGMA +03C3;A # GREEK SMALL LETTER SIGMA +03C4;A # GREEK SMALL LETTER TAU +03C5;A # GREEK SMALL LETTER UPSILON +03C6;A # GREEK SMALL LETTER PHI +03C7;A # GREEK SMALL LETTER CHI +03C8;A # GREEK SMALL LETTER PSI +03C9;A # GREEK SMALL LETTER OMEGA +03CA;N # GREEK SMALL LETTER IOTA WITH DIALYTIKA +03CB;N # GREEK SMALL LETTER UPSILON WITH DIALYTIKA +03CC;N # GREEK SMALL LETTER OMICRON WITH TONOS +03CD;N # GREEK SMALL LETTER UPSILON WITH TONOS +03CE;N # GREEK SMALL LETTER OMEGA WITH TONOS +03D0;N # GREEK BETA SYMBOL +03D1;N # GREEK THETA SYMBOL +03D2;N # GREEK UPSILON WITH HOOK SYMBOL +03D3;N # GREEK UPSILON WITH ACUTE AND HOOK SYMBOL +03D4;N # GREEK UPSILON WITH DIAERESIS AND HOOK SYMBOL +03D5;N # GREEK PHI SYMBOL +03D6;N # GREEK PI SYMBOL +03D7;N # GREEK KAI SYMBOL +03D8;N # GREEK LETTER ARCHAIC KOPPA +03D9;N # GREEK SMALL LETTER ARCHAIC KOPPA +03DA;N # GREEK LETTER STIGMA +03DB;N # GREEK SMALL LETTER STIGMA +03DC;N # GREEK LETTER DIGAMMA +03DD;N # GREEK SMALL LETTER DIGAMMA +03DE;N # GREEK LETTER KOPPA +03DF;N # GREEK SMALL LETTER KOPPA +03E0;N # GREEK LETTER SAMPI +03E1;N # GREEK SMALL LETTER SAMPI +03E2;N # COPTIC CAPITAL LETTER SHEI +03E3;N # COPTIC SMALL LETTER SHEI +03E4;N # COPTIC CAPITAL LETTER FEI +03E5;N # COPTIC SMALL LETTER FEI +03E6;N # COPTIC CAPITAL LETTER KHEI +03E7;N # COPTIC SMALL LETTER KHEI +03E8;N # COPTIC CAPITAL LETTER HORI +03E9;N # COPTIC SMALL LETTER HORI +03EA;N # COPTIC CAPITAL LETTER GANGIA +03EB;N # COPTIC SMALL LETTER GANGIA +03EC;N # COPTIC CAPITAL LETTER SHIMA +03ED;N # COPTIC SMALL LETTER SHIMA +03EE;N # COPTIC CAPITAL LETTER DEI +03EF;N # COPTIC SMALL LETTER DEI +03F0;N # GREEK KAPPA SYMBOL +03F1;N # GREEK RHO SYMBOL +03F2;N # GREEK LUNATE SIGMA SYMBOL +03F3;N # GREEK LETTER YOT +03F4;N # GREEK CAPITAL THETA SYMBOL +03F5;N # GREEK LUNATE EPSILON SYMBOL +03F6;N # GREEK REVERSED LUNATE EPSILON SYMBOL +03F7;N # GREEK CAPITAL LETTER SHO +03F8;N # GREEK SMALL LETTER SHO +03F9;N # GREEK CAPITAL LUNATE SIGMA SYMBOL +03FA;N # GREEK CAPITAL LETTER SAN +03FB;N # GREEK SMALL LETTER SAN +03FC;N # GREEK RHO WITH STROKE SYMBOL +03FD;N # GREEK CAPITAL REVERSED LUNATE SIGMA SYMBOL +03FE;N # GREEK CAPITAL DOTTED LUNATE SIGMA SYMBOL +03FF;N # GREEK CAPITAL REVERSED DOTTED LUNATE SIGMA SYMBOL +0400;N # CYRILLIC CAPITAL LETTER IE WITH GRAVE +0401;A # CYRILLIC CAPITAL LETTER IO +0402;N # CYRILLIC CAPITAL LETTER DJE +0403;N # CYRILLIC CAPITAL LETTER GJE +0404;N # CYRILLIC CAPITAL LETTER UKRAINIAN IE +0405;N # CYRILLIC CAPITAL LETTER DZE +0406;N # CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I +0407;N # CYRILLIC CAPITAL LETTER YI +0408;N # CYRILLIC CAPITAL LETTER JE +0409;N # CYRILLIC CAPITAL LETTER LJE +040A;N # CYRILLIC CAPITAL LETTER NJE +040B;N # CYRILLIC CAPITAL LETTER TSHE +040C;N # CYRILLIC CAPITAL LETTER KJE +040D;N # CYRILLIC CAPITAL LETTER I WITH GRAVE +040E;N # CYRILLIC CAPITAL LETTER SHORT U +040F;N # CYRILLIC CAPITAL LETTER DZHE +0410;A # CYRILLIC CAPITAL LETTER A +0411;A # CYRILLIC CAPITAL LETTER BE +0412;A # CYRILLIC CAPITAL LETTER VE +0413;A # CYRILLIC CAPITAL LETTER ... [truncated message content] |
From: <fwi...@us...> - 2008-09-03 01:01:00
|
Revision: 5285 http://jython.svn.sourceforge.net/jython/?rev=5285&view=rev Author: fwierzbicki Date: 2008-09-03 01:00:56 +0000 (Wed, 03 Sep 2008) Log Message: ----------- Removed co_names, co_consts since these are implementation details that may never get implemented, and removed flags since there are implementation differences that may never line up. Still failing on one test for varnames because I think it is possible that the order of varnames might be useful (in order declared) and Jython doesn't quite get that right. Modified Paths: -------------- trunk/jython/Lib/test/test_code.py Modified: trunk/jython/Lib/test/test_code.py =================================================================== --- trunk/jython/Lib/test/test_code.py 2008-09-03 00:25:53 UTC (rev 5284) +++ trunk/jython/Lib/test/test_code.py 2008-09-03 01:00:56 UTC (rev 5285) @@ -1,3 +1,8 @@ +#For Jython, removed co_names, co_consts since these are implementation details +# that may never get implemented, and removed flags since there are implementation +# differences that may never line up. Still failing on one test for varnames +# because I think it is possible that the order of varnames might be useful (in +# order declared) and Jython doesn't quite get that right. """This module includes tests of the code object representation. >>> def f(x): @@ -9,24 +14,18 @@ >>> dump(f.func_code) name: f argcount: 1 -names: () varnames: ('x', 'g') cellvars: ('x',) freevars: () nlocals: 2 -flags: 3 -consts: ('None', '<code object g>') >>> dump(f(4).func_code) name: g argcount: 1 -names: () varnames: ('y',) cellvars: () freevars: ('x',) nlocals: 1 -flags: 19 -consts: ('None',) >>> def h(x, y): ... a = x + y @@ -37,13 +36,10 @@ >>> dump(h.func_code) name: h argcount: 2 -names: () varnames: ('x', 'y', 'a', 'b', 'c') cellvars: () freevars: () nlocals: 5 -flags: 67 -consts: ('None',) >>> def attrs(obj): ... print obj.attr1 @@ -53,13 +49,10 @@ >>> dump(attrs.func_code) name: attrs argcount: 1 -names: ('attr1', 'attr2', 'attr3') varnames: ('obj',) cellvars: () freevars: () nlocals: 1 -flags: 67 -consts: ('None',) >>> def optimize_away(): ... 'doc string' @@ -70,13 +63,10 @@ >>> dump(optimize_away.func_code) name: optimize_away argcount: 0 -names: () varnames: () cellvars: () freevars: () nlocals: 0 -flags: 67 -consts: ("'doc string'", 'None') """ @@ -91,10 +81,9 @@ def dump(co): """Print out a text representation of a code object.""" - for attr in ["name", "argcount", "names", "varnames", "cellvars", - "freevars", "nlocals", "flags"]: + for attr in ["name", "argcount", "varnames", "cellvars", + "freevars", "nlocals"]: print "%s: %s" % (attr, getattr(co, "co_" + attr)) - print "consts:", tuple(consts(co.co_consts)) def test_main(verbose=None): from test.test_support import run_doctest This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fwi...@us...> - 2008-09-03 00:25:58
|
Revision: 5284 http://jython.svn.sourceforge.net/jython/?rev=5284&view=rev Author: fwierzbicki Date: 2008-09-03 00:25:53 +0000 (Wed, 03 Sep 2008) Log Message: ----------- from: http://svn.python.org/projects/python/branches/release25-maint/Lib/test/test_code.py@51333 Added Paths: ----------- trunk/jython/Lib/test/test_code.py Added: trunk/jython/Lib/test/test_code.py =================================================================== --- trunk/jython/Lib/test/test_code.py (rev 0) +++ trunk/jython/Lib/test/test_code.py 2008-09-03 00:25:53 UTC (rev 5284) @@ -0,0 +1,102 @@ +"""This module includes tests of the code object representation. + +>>> def f(x): +... def g(y): +... return x + y +... return g +... + +>>> dump(f.func_code) +name: f +argcount: 1 +names: () +varnames: ('x', 'g') +cellvars: ('x',) +freevars: () +nlocals: 2 +flags: 3 +consts: ('None', '<code object g>') + +>>> dump(f(4).func_code) +name: g +argcount: 1 +names: () +varnames: ('y',) +cellvars: () +freevars: ('x',) +nlocals: 1 +flags: 19 +consts: ('None',) + +>>> def h(x, y): +... a = x + y +... b = x - y +... c = a * b +... return c +... +>>> dump(h.func_code) +name: h +argcount: 2 +names: () +varnames: ('x', 'y', 'a', 'b', 'c') +cellvars: () +freevars: () +nlocals: 5 +flags: 67 +consts: ('None',) + +>>> def attrs(obj): +... print obj.attr1 +... print obj.attr2 +... print obj.attr3 + +>>> dump(attrs.func_code) +name: attrs +argcount: 1 +names: ('attr1', 'attr2', 'attr3') +varnames: ('obj',) +cellvars: () +freevars: () +nlocals: 1 +flags: 67 +consts: ('None',) + +>>> def optimize_away(): +... 'doc string' +... 'not a docstring' +... 53 +... 53L + +>>> dump(optimize_away.func_code) +name: optimize_away +argcount: 0 +names: () +varnames: () +cellvars: () +freevars: () +nlocals: 0 +flags: 67 +consts: ("'doc string'", 'None') + +""" + +def consts(t): + """Yield a doctest-safe sequence of object reprs.""" + for elt in t: + r = repr(elt) + if r.startswith("<code object"): + yield "<code object %s>" % elt.co_name + else: + yield r + +def dump(co): + """Print out a text representation of a code object.""" + for attr in ["name", "argcount", "names", "varnames", "cellvars", + "freevars", "nlocals", "flags"]: + print "%s: %s" % (attr, getattr(co, "co_" + attr)) + print "consts:", tuple(consts(co.co_consts)) + +def test_main(verbose=None): + from test.test_support import run_doctest + from test import test_code + run_doctest(test_code, verbose) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fwi...@us...> - 2008-09-03 00:19:28
|
Revision: 5283 http://jython.svn.sourceforge.net/jython/?rev=5283&view=rev Author: fwierzbicki Date: 2008-09-03 00:19:22 +0000 (Wed, 03 Sep 2008) Log Message: ----------- Remove unused file. Removed Paths: ------------- trunk/jython/src/org/python/compiler/SourceFile.java Deleted: trunk/jython/src/org/python/compiler/SourceFile.java =================================================================== --- trunk/jython/src/org/python/compiler/SourceFile.java 2008-09-02 14:43:50 UTC (rev 5282) +++ trunk/jython/src/org/python/compiler/SourceFile.java 2008-09-03 00:19:22 UTC (rev 5283) @@ -1,24 +0,0 @@ -// Copyright (c) Corporation for National Research Initiatives - -package org.python.compiler; -import java.io.DataOutputStream; -import java.io.IOException; - -public class SourceFile { - String attName; - String filename; - - public SourceFile(String name) throws IOException { - //this.attName = pool.UTF8("SourceFile"); - //this.filename = pool.UTF8(name); - this.attName = "SourceFile"; - this.filename = name; - } - - public void write(DataOutputStream stream) throws IOException { - //FIXME: need to LDC the att and name. - //FJW stream.writeShort(attName); - //FJW stream.writeInt(2); - //FJW stream.writeShort(filename); - } -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fwi...@us...> - 2008-09-02 14:43:53
|
Revision: 5282 http://jython.svn.sourceforge.net/jython/?rev=5282&view=rev Author: fwierzbicki Date: 2008-09-02 14:43:50 +0000 (Tue, 02 Sep 2008) Log Message: ----------- accidentally commented out call to dump() which is turned off by default anyway. Modified Paths: -------------- trunk/jython/src/org/python/compiler/ScopesCompiler.java Modified: trunk/jython/src/org/python/compiler/ScopesCompiler.java =================================================================== --- trunk/jython/src/org/python/compiler/ScopesCompiler.java 2008-09-02 14:41:10 UTC (rev 5281) +++ trunk/jython/src/org/python/compiler/ScopesCompiler.java 2008-09-02 14:43:50 UTC (rev 5282) @@ -53,7 +53,7 @@ referenceable = ((ScopeInfo)scopes.get(i)); } cur.cook(referenceable, dist, code_compiler); - //cur.dump(); // debug + cur.dump(); // debug cur = up; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fwi...@us...> - 2008-09-02 14:41:12
|
Revision: 5281 http://jython.svn.sourceforge.net/jython/?rev=5281&view=rev Author: fwierzbicki Date: 2008-09-02 14:41:10 +0000 (Tue, 02 Sep 2008) Log Message: ----------- Coding standards and cosmetic changes. Modified Paths: -------------- trunk/jython/src/org/python/compiler/ScopesCompiler.java Modified: trunk/jython/src/org/python/compiler/ScopesCompiler.java =================================================================== --- trunk/jython/src/org/python/compiler/ScopesCompiler.java 2008-09-01 14:33:42 UTC (rev 5280) +++ trunk/jython/src/org/python/compiler/ScopesCompiler.java 2008-09-02 14:41:10 UTC (rev 5281) @@ -18,29 +18,33 @@ private int func_level = 0; public ScopesCompiler(CompilationContext code_compiler, - Hashtable nodeScopes) - { + Hashtable nodeScopes) { this.code_compiler = code_compiler; this.nodeScopes = nodeScopes; scopes = new Stack(); } public void beginScope(String name, int kind, PythonTree node, - ArgListCompiler ac) - { + ArgListCompiler ac) { if (cur != null) { scopes.push(cur); } - if (kind == FUNCSCOPE) func_level++; - cur = new ScopeInfo(name, node, level++, kind, - func_level, ac); + if (kind == FUNCSCOPE) { + func_level++; + } + cur = new ScopeInfo(name, node, level++, kind, func_level, ac); nodeScopes.put(node, cur); } public void endScope() throws Exception { - if (cur.kind == FUNCSCOPE) func_level--; + if (cur.kind == FUNCSCOPE) { + func_level--; + } level--; - ScopeInfo up = (!scopes.empty())?(ScopeInfo)scopes.pop():null; + ScopeInfo up = null; + if (!scopes.empty()) { + up = (ScopeInfo)scopes.pop(); + } //Go into the stack to find a non class containing scope to use making the closure //See PEP 227 int dist = 1; @@ -49,7 +53,7 @@ referenceable = ((ScopeInfo)scopes.get(i)); } cur.cook(referenceable, dist, code_compiler); - cur.dump(); // dbg + //cur.dump(); // debug cur = up; } @@ -95,8 +99,7 @@ ac.visitArgs(node.args); exprType[] defaults = ac.getDefaults(); - int defc = defaults.length; - for (int i = 0; i < defc; i++) { + for (int i = 0; i < defaults.length; i++) { visit(defaults[i]); } @@ -119,18 +122,17 @@ ac.visitArgs(node.args); PythonTree[] defaults = ac.getDefaults(); - int defc = defaults.length; - for (int i = 0; i < defc; i++) { + for (int i = 0; i < defaults.length; i++) { visit(defaults[i]); } beginScope("<lambda>", FUNCSCOPE, node, ac); - int n = ac.names.size(); - for (int i = 0; i < n; i++) { - cur.addParam((String)ac.names.elementAt(i)); + for (Object o : ac.names) { + cur.addParam((String)o); } - for (int i = 0; i < ac.init_code.size(); i++) - visit((stmtType) ac.init_code.elementAt(i)); + for (Object o : ac.init_code) { + visit((stmtType)o); + } cur.markFromParam(); visit(node.body); endScope(); @@ -138,20 +140,19 @@ } public void suite(stmtType[] stmts) throws Exception { - int n = stmts.length; - for (int i = 0; i < n; i++) + for (int i = 0; i < stmts.length; i++) visit(stmts[i]); } public Object visitImport(Import node) throws Exception { - int n = node.names.length; - for (int i = 0; i < n; i++) { - if (node.names[i].asname != null) + for (int i = 0; i < node.names.length; i++) { + if (node.names[i].asname != null) { cur.addBound(node.names[i].asname); - else { + } else { String name = node.names[i].name; - if (name.indexOf('.') > 0) + if (name.indexOf('.') > 0) { name = name.substring(0, name.indexOf('.')); + } cur.addBound(name); } } @@ -166,10 +167,11 @@ return null; } for (int i = 0; i < n; i++) { - if (node.names[i].asname != null) + if (node.names[i].asname != null) { cur.addBound(node.names[i].asname); - else + } else { cur.addBound(node.names[i].name); + } } return null; } @@ -180,14 +182,21 @@ String name = node.names[i]; int prev = cur.addGlobal(name); if (prev >= 0) { - if ((prev&FROM_PARAM) != 0) + if ((prev&FROM_PARAM) != 0) { code_compiler.error("name '"+name+"' is local and global", true,node); - if ((prev&GLOBAL) != 0) continue; + } + if ((prev&GLOBAL) != 0) { + continue; + } String what; - if ((prev&BOUND) != 0) what = "assignment"; else what = "use"; + if ((prev&BOUND) != 0) { + what = "assignment"; + } else { + what = "use"; + } code_compiler.error("name '"+name+"' declared global after "+ - what,false,node); + what, false, node); } } return null; @@ -195,29 +204,19 @@ public Object visitExec(Exec node) throws Exception { cur.exec = true; - if (node.globals == null && node.locals == null) + if (node.globals == null && node.locals == null) { cur.unqual_exec = true; + } traverse(node); return null; } -/* - private static void illassign(PythonTree node) throws Exception { - String target = "operator"; - if (node.id == PythonGrammarTreeConstants.JJTCALL_OP) { - target = "function call"; - } else if ((node.id == PythonGrammarTreeConstants.JJTFOR_STMT)) { - target = "list comprehension"; - } - throw new ParseException("can't assign to "+target,node); - } -*/ - public Object visitClassDef(ClassDef node) throws Exception { def(node.name); int n = node.bases.length; - for (int i = 0; i < n; i++) + for (int i = 0; i < n; i++) { visit(node.bases[i]); + } beginScope(node.name, CLASSSCOPE, node, null); suite(node.body); endScope(); @@ -227,11 +226,13 @@ public Object visitName(Name node) throws Exception { String name = node.id; if (node.ctx != expr_contextType.Load) { - if (name.equals("__debug__")) + if (name.equals("__debug__")) { code_compiler.error("can not assign to __debug__", true,node); + } cur.addBound(name); + } else { + cur.addUsed(name); } - else cur.addUsed(name); return null; } @@ -260,7 +261,6 @@ cur.addParam(bound_exp); cur.markFromParam(); - //yield stuff cur.generator = true; cur.yield_count++; traverse(node); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <th...@us...> - 2008-09-01 14:34:02
|
Revision: 5280 http://jython.svn.sourceforge.net/jython/?rev=5280&view=rev Author: thobes Date: 2008-09-01 14:33:42 +0000 (Mon, 01 Sep 2008) Log Message: ----------- Manually performing the merge I would have liked svnmerge to do. However I could not figure out how get the merge right. The problem was that the advanced branch is a branch from a branch (asm), and that the branch has been merged into trunk. I wanted to merge in changes that had occured both in the asm branch and in trunk so that I could merge from trunk in the future. This was simply too many circular merges for svnmerge to handle. Anyhow the merge in this commit brings the advanced branch up to the state where the asm branch was merged into trunk. The branch pointer has also been redirected to point to trunk so that svnmerge will work for future merges. Modified Paths: -------------- branches/advanced/.classpath branches/advanced/CPythonLib.includes branches/advanced/CoreExposed.includes branches/advanced/Lib/codeop.py branches/advanced/Lib/datetime.py branches/advanced/Lib/distutils/ccompiler.py branches/advanced/Lib/distutils/command/bdist.py branches/advanced/Lib/distutils/command/bdist_dumb.py branches/advanced/Lib/distutils/command/install.py branches/advanced/Lib/distutils/command/sdist.py branches/advanced/Lib/distutils/file_util.py branches/advanced/Lib/distutils/spawn.py branches/advanced/Lib/distutils/sysconfig.py branches/advanced/Lib/distutils/util.py branches/advanced/Lib/ntpath.py branches/advanced/Lib/os.py branches/advanced/Lib/posixpath.py branches/advanced/Lib/random.py branches/advanced/Lib/site.py branches/advanced/Lib/socket.py branches/advanced/Lib/subprocess.py branches/advanced/Lib/test/list_tests.py branches/advanced/Lib/test/regrtest.py branches/advanced/Lib/test/test__rawffi.py branches/advanced/Lib/test/test_array_jy.py branches/advanced/Lib/test/test_ast.py branches/advanced/Lib/test/test_builtin.py branches/advanced/Lib/test/test_cmd_line.py branches/advanced/Lib/test/test_deque.py branches/advanced/Lib/test/test_descr_jy.py branches/advanced/Lib/test/test_descrtut.py branches/advanced/Lib/test/test_dict_jy.py branches/advanced/Lib/test/test_exceptions_jy.py branches/advanced/Lib/test/test_file_newlines.py branches/advanced/Lib/test/test_float_jy.py branches/advanced/Lib/test/test_format.py branches/advanced/Lib/test/test_functools.py branches/advanced/Lib/test/test_grammar_jy.py branches/advanced/Lib/test/test_importhooks.py branches/advanced/Lib/test/test_inspect.py branches/advanced/Lib/test/test_java_integration.py branches/advanced/Lib/test/test_javashell.py branches/advanced/Lib/test/test_jreload.py branches/advanced/Lib/test/test_jser2.py branches/advanced/Lib/test/test_jy_internals.py branches/advanced/Lib/test/test_re_jy.py branches/advanced/Lib/test/test_select.py branches/advanced/Lib/test/test_select_new.py branches/advanced/Lib/test/test_slots_jy.py branches/advanced/Lib/test/test_socket.py branches/advanced/Lib/test/test_subclasses.py branches/advanced/Lib/test/test_support.py branches/advanced/Lib/test/test_sys_jy.py branches/advanced/Lib/test/test_traceback.py branches/advanced/Lib/threading.py branches/advanced/Misc/make_binops.py branches/advanced/NEWS branches/advanced/README.txt branches/advanced/ast/asdl_antlr.py branches/advanced/ast/astdump.py branches/advanced/build.xml branches/advanced/compiler/org/python/compiler/AdvancedCompiler.java branches/advanced/extlibs/jna-posix.jar branches/advanced/grammar/Python.g branches/advanced/grammar/PythonPartial.g branches/advanced/grammar/PythonWalker.g branches/advanced/src/com/ziclix/python/sql/DataHandler.java branches/advanced/src/com/ziclix/python/sql/Fetch.java branches/advanced/src/com/ziclix/python/sql/PyConnection.java branches/advanced/src/com/ziclix/python/sql/PyCursor.java branches/advanced/src/com/ziclix/python/sql/PyExtendedCursor.java branches/advanced/src/com/ziclix/python/sql/PyStatement.java branches/advanced/src/com/ziclix/python/sql/connect/Connect.java branches/advanced/src/com/ziclix/python/sql/connect/Connectx.java branches/advanced/src/com/ziclix/python/sql/connect/Lookup.java branches/advanced/src/com/ziclix/python/sql/util/BCP.java branches/advanced/src/org/python/antlr/ExpressionParser.java branches/advanced/src/org/python/antlr/InteractiveParser.java branches/advanced/src/org/python/antlr/ModuleParser.java branches/advanced/src/org/python/antlr/ParseException.java branches/advanced/src/org/python/antlr/PythonTokenSource.java branches/advanced/src/org/python/antlr/PythonTree.java branches/advanced/src/org/python/antlr/PythonTreeAdaptor.java branches/advanced/src/org/python/antlr/ast/Assert.java branches/advanced/src/org/python/antlr/ast/Assign.java branches/advanced/src/org/python/antlr/ast/Attribute.java branches/advanced/src/org/python/antlr/ast/AugAssign.java branches/advanced/src/org/python/antlr/ast/BinOp.java branches/advanced/src/org/python/antlr/ast/BoolOp.java branches/advanced/src/org/python/antlr/ast/Break.java branches/advanced/src/org/python/antlr/ast/Call.java branches/advanced/src/org/python/antlr/ast/ClassDef.java branches/advanced/src/org/python/antlr/ast/Compare.java branches/advanced/src/org/python/antlr/ast/Continue.java branches/advanced/src/org/python/antlr/ast/Delete.java branches/advanced/src/org/python/antlr/ast/Dict.java branches/advanced/src/org/python/antlr/ast/Ellipsis.java branches/advanced/src/org/python/antlr/ast/Exec.java branches/advanced/src/org/python/antlr/ast/Expr.java branches/advanced/src/org/python/antlr/ast/Expression.java branches/advanced/src/org/python/antlr/ast/ExtSlice.java branches/advanced/src/org/python/antlr/ast/For.java branches/advanced/src/org/python/antlr/ast/FunctionDef.java branches/advanced/src/org/python/antlr/ast/GeneratorExp.java branches/advanced/src/org/python/antlr/ast/Global.java branches/advanced/src/org/python/antlr/ast/If.java branches/advanced/src/org/python/antlr/ast/IfExp.java branches/advanced/src/org/python/antlr/ast/Import.java branches/advanced/src/org/python/antlr/ast/ImportFrom.java branches/advanced/src/org/python/antlr/ast/Index.java branches/advanced/src/org/python/antlr/ast/Interactive.java branches/advanced/src/org/python/antlr/ast/Lambda.java branches/advanced/src/org/python/antlr/ast/List.java branches/advanced/src/org/python/antlr/ast/ListComp.java branches/advanced/src/org/python/antlr/ast/Module.java branches/advanced/src/org/python/antlr/ast/Name.java branches/advanced/src/org/python/antlr/ast/Num.java branches/advanced/src/org/python/antlr/ast/Pass.java branches/advanced/src/org/python/antlr/ast/Print.java branches/advanced/src/org/python/antlr/ast/Raise.java branches/advanced/src/org/python/antlr/ast/Repr.java branches/advanced/src/org/python/antlr/ast/Return.java branches/advanced/src/org/python/antlr/ast/Slice.java branches/advanced/src/org/python/antlr/ast/Str.java branches/advanced/src/org/python/antlr/ast/Subscript.java branches/advanced/src/org/python/antlr/ast/Suite.java branches/advanced/src/org/python/antlr/ast/TryExcept.java branches/advanced/src/org/python/antlr/ast/TryFinally.java branches/advanced/src/org/python/antlr/ast/Tuple.java branches/advanced/src/org/python/antlr/ast/UnaryOp.java branches/advanced/src/org/python/antlr/ast/Unicode.java branches/advanced/src/org/python/antlr/ast/While.java branches/advanced/src/org/python/antlr/ast/With.java branches/advanced/src/org/python/antlr/ast/Yield.java branches/advanced/src/org/python/antlr/ast/aliasType.java branches/advanced/src/org/python/antlr/ast/argumentsType.java branches/advanced/src/org/python/antlr/ast/comprehensionType.java branches/advanced/src/org/python/antlr/ast/excepthandlerType.java branches/advanced/src/org/python/antlr/ast/keywordType.java branches/advanced/src/org/python/compiler/APIVersion.java branches/advanced/src/org/python/compiler/ClassFile.java branches/advanced/src/org/python/compiler/Code.java branches/advanced/src/org/python/compiler/CodeCompiler.java branches/advanced/src/org/python/compiler/Module.java branches/advanced/src/org/python/compiler/ScopeInfo.java branches/advanced/src/org/python/compiler/ScopesCompiler.java branches/advanced/src/org/python/core/AbstractArray.java branches/advanced/src/org/python/core/ArgParser.java branches/advanced/src/org/python/core/CompilerFacade.java branches/advanced/src/org/python/core/CompilerFlags.java branches/advanced/src/org/python/core/FunctionThread.java branches/advanced/src/org/python/core/ParserFacade.java branches/advanced/src/org/python/core/Py.java branches/advanced/src/org/python/core/PyArray.java branches/advanced/src/org/python/core/PyArrayDerived.java branches/advanced/src/org/python/core/PyBaseException.java branches/advanced/src/org/python/core/PyBaseExceptionDerived.java branches/advanced/src/org/python/core/PyBooleanDerived.java branches/advanced/src/org/python/core/PyClass.java branches/advanced/src/org/python/core/PyClassMethodDerived.java branches/advanced/src/org/python/core/PyComplex.java branches/advanced/src/org/python/core/PyComplexDerived.java branches/advanced/src/org/python/core/PyDictionaryDerived.java branches/advanced/src/org/python/core/PyEnumerateDerived.java branches/advanced/src/org/python/core/PyFileDerived.java branches/advanced/src/org/python/core/PyFloat.java branches/advanced/src/org/python/core/PyFloatDerived.java branches/advanced/src/org/python/core/PyFrame.java branches/advanced/src/org/python/core/PyFrozenSetDerived.java branches/advanced/src/org/python/core/PyGenerator.java branches/advanced/src/org/python/core/PyInstance.java branches/advanced/src/org/python/core/PyInteger.java branches/advanced/src/org/python/core/PyIntegerDerived.java branches/advanced/src/org/python/core/PyJavaClass.java branches/advanced/src/org/python/core/PyJavaPackage.java branches/advanced/src/org/python/core/PyList.java branches/advanced/src/org/python/core/PyListDerived.java branches/advanced/src/org/python/core/PyLong.java branches/advanced/src/org/python/core/PyLongDerived.java branches/advanced/src/org/python/core/PyMethod.java branches/advanced/src/org/python/core/PyModule.java branches/advanced/src/org/python/core/PyModuleDerived.java branches/advanced/src/org/python/core/PyObject.java branches/advanced/src/org/python/core/PyObjectDerived.java branches/advanced/src/org/python/core/PyPropertyDerived.java branches/advanced/src/org/python/core/PySequence.java branches/advanced/src/org/python/core/PySequenceIter.java branches/advanced/src/org/python/core/PySetDerived.java branches/advanced/src/org/python/core/PySlice.java branches/advanced/src/org/python/core/PySliceDerived.java branches/advanced/src/org/python/core/PyString.java branches/advanced/src/org/python/core/PyStringDerived.java branches/advanced/src/org/python/core/PySuper.java branches/advanced/src/org/python/core/PySuperDerived.java branches/advanced/src/org/python/core/PySyntaxError.java branches/advanced/src/org/python/core/PySystemState.java branches/advanced/src/org/python/core/PyTableCode.java branches/advanced/src/org/python/core/PyTraceback.java branches/advanced/src/org/python/core/PyTuple.java branches/advanced/src/org/python/core/PyTupleDerived.java branches/advanced/src/org/python/core/PyType.java branches/advanced/src/org/python/core/PyTypeDerived.java branches/advanced/src/org/python/core/PyUnicode.java branches/advanced/src/org/python/core/PyUnicodeDerived.java branches/advanced/src/org/python/core/StdoutWrapper.java branches/advanced/src/org/python/core/ThreadState.java branches/advanced/src/org/python/core/__builtin__.java branches/advanced/src/org/python/core/imp.java branches/advanced/src/org/python/core/io/FileIO.java branches/advanced/src/org/python/core/io/TextIOBase.java branches/advanced/src/org/python/modules/ArrayModule.java branches/advanced/src/org/python/modules/Setup.java branches/advanced/src/org/python/modules/_codecs.java branches/advanced/src/org/python/modules/_weakref/ProxyType.java branches/advanced/src/org/python/modules/_weakref/ReferenceTypeDerived.java branches/advanced/src/org/python/modules/cPickle.java branches/advanced/src/org/python/modules/cStringIO.java branches/advanced/src/org/python/modules/collections/PyDefaultDictDerived.java branches/advanced/src/org/python/modules/collections/PyDeque.java branches/advanced/src/org/python/modules/collections/PyDequeDerived.java branches/advanced/src/org/python/modules/imp.java branches/advanced/src/org/python/modules/operator.java branches/advanced/src/org/python/modules/random/PyRandomDerived.java branches/advanced/src/org/python/modules/sre/MatchObject.java branches/advanced/src/org/python/modules/sre/PatternObject.java branches/advanced/src/org/python/modules/struct.java branches/advanced/src/org/python/modules/thread/PyLocalDerived.java branches/advanced/src/org/python/modules/thread/thread.java branches/advanced/src/org/python/modules/zipimport/zipimporter.java branches/advanced/src/org/python/modules/zipimport/zipimporterDerived.java branches/advanced/src/org/python/util/InteractiveInterpreter.java branches/advanced/src/org/python/util/PythonInterpreter.java branches/advanced/src/org/python/util/jython.java branches/advanced/src/shell/jython branches/advanced/src/templates/mappings branches/advanced/src/templates/object.derived Added Paths: ----------- branches/advanced/Lib/decimal.py branches/advanced/Lib/distutils/tests/ branches/advanced/Lib/distutils/tests/test_build_py.py branches/advanced/Lib/grp.py branches/advanced/Lib/pkgutil.py branches/advanced/Lib/pwd.py branches/advanced/Lib/test/bad_coding2.py branches/advanced/Lib/test/test_array.py branches/advanced/Lib/test/test_class.py branches/advanced/Lib/test/test_cmp_jy.py branches/advanced/Lib/test/test_codeop.py branches/advanced/Lib/test/test_compile.py branches/advanced/Lib/test/test_cpickle_jy.py branches/advanced/Lib/test/test_generators.py branches/advanced/Lib/test/test_genexps.py branches/advanced/Lib/test/test_iter_jy.py branches/advanced/Lib/test/test_operator.py branches/advanced/Lib/test/test_pkgimport.py branches/advanced/Lib/test/test_subprocess_jy.py branches/advanced/Lib/test/test_syntax.py branches/advanced/Lib/test/test_tuple.py branches/advanced/extlibs/antlr-3.1.jar branches/advanced/extlibs/antlr-runtime-3.1.jar branches/advanced/extlibs/stringtemplate-3.2.jar branches/advanced/src/com/ziclix/python/sql/Jython22DataHandler.java branches/advanced/src/org/python/antlr/BaseParser.java branches/advanced/src/org/python/antlr/ErrorHandler.java branches/advanced/src/org/python/antlr/FailFastHandler.java branches/advanced/src/org/python/antlr/GrammarActions.java branches/advanced/src/org/python/antlr/ListErrorHandler.java branches/advanced/src/org/python/antlr/PythonErrorNode.java branches/advanced/src/org/python/antlr/ast/ErrorExpr.java branches/advanced/src/org/python/antlr/ast/ErrorMod.java branches/advanced/src/org/python/antlr/ast/ErrorSlice.java branches/advanced/src/org/python/antlr/ast/ErrorStmt.java branches/advanced/src/org/python/core/APIReader.java branches/advanced/src/org/python/core/PyFastSequenceIter.java branches/advanced/src/org/python/core/PyIndentationError.java branches/advanced/src/org/python/core/io/TextIOInputStream.java branches/advanced/src/org/python/modules/_csv/ branches/advanced/src/org/python/modules/_csv/PyDialect.java branches/advanced/src/org/python/modules/_csv/PyDialectDerived.java branches/advanced/src/org/python/modules/_csv/PyReader.java branches/advanced/src/org/python/modules/_csv/PyWriter.java branches/advanced/src/org/python/modules/_csv/QuoteStyle.java branches/advanced/src/org/python/modules/_csv/_csv.java branches/advanced/src/org/python/modules/_functools/ branches/advanced/src/org/python/modules/_functools/PyPartial.java branches/advanced/src/org/python/modules/_functools/PyPartialDerived.java branches/advanced/src/org/python/modules/_functools/_functools.java branches/advanced/src/org/python/modules/_systemrestart.java branches/advanced/src/shell/jython.bat branches/advanced/src/templates/dialect.derived branches/advanced/src/templates/partial.derived branches/advanced/tests/java/org/python/antlr/ branches/advanced/tests/java/org/python/antlr/GrammarTester.java branches/advanced/tests/java/org/python/antlr/PythonPartialTester.java branches/advanced/tests/java/org/python/antlr/PythonTreeTester.java branches/advanced/tests/java/org/python/antlr/WalkerTester.java Removed Paths: ------------- branches/advanced/Lib/UserList.py branches/advanced/Lib/distutils/tests/test_build_py.py branches/advanced/Lib/functools.py branches/advanced/Lib/test/output/test_array_jy branches/advanced/Lib/test/output/test_re branches/advanced/Lib/test/seq_tests.py branches/advanced/Lib/test/test_userlist.py branches/advanced/extlibs/antlr-3.1b1.jar branches/advanced/extlibs/antlr-runtime-3.1b1.jar branches/advanced/extlibs/stringtemplate-3.1b1.jar branches/advanced/src/org/python/antlr/GrammarTester.java branches/advanced/src/org/python/antlr/IParserHost.java branches/advanced/src/org/python/antlr/ImaginaryToken.java branches/advanced/src/org/python/antlr/LeadingSpaceSkippingStream.java branches/advanced/src/org/python/antlr/PythonPartialTester.java branches/advanced/src/org/python/antlr/PythonPartialTokenSource.java branches/advanced/src/org/python/antlr/PythonTreeTester.java branches/advanced/src/org/python/antlr/WalkerTester.java branches/advanced/src/org/python/modules/_csv/PyDialect.java branches/advanced/src/org/python/modules/_csv/PyDialectDerived.java branches/advanced/src/org/python/modules/_csv/PyReader.java branches/advanced/src/org/python/modules/_csv/PyWriter.java branches/advanced/src/org/python/modules/_csv/QuoteStyle.java branches/advanced/src/org/python/modules/_csv/_csv.java branches/advanced/src/org/python/modules/_functools/PyPartial.java branches/advanced/src/org/python/modules/_functools/PyPartialDerived.java branches/advanced/src/org/python/modules/_functools/_functools.java branches/advanced/src/org/python/modules/xreadlines.java branches/advanced/tests/java/org/python/antlr/GrammarTester.java branches/advanced/tests/java/org/python/antlr/PythonPartialTester.java branches/advanced/tests/java/org/python/antlr/PythonTreeTester.java branches/advanced/tests/java/org/python/antlr/WalkerTester.java Property Changed: ---------------- branches/advanced/ Property changes on: branches/advanced ___________________________________________________________________ Modified: svnmerge-integrated - /branches/asm:1-4928 /trunk/jython:1-4899 + /trunk/jython:1-5210 Modified: branches/advanced/.classpath =================================================================== --- branches/advanced/.classpath 2008-09-01 06:32:39 UTC (rev 5279) +++ branches/advanced/.classpath 2008-09-01 14:33:42 UTC (rev 5280) @@ -19,6 +19,6 @@ <classpathentry kind="lib" path="extlibs/servlet-api-2.5.jar"/> <classpathentry kind="lib" path="build/jarjar"/> <classpathentry kind="var" path="Ant"/> - <classpathentry kind="lib" path="extlibs/antlr-3.1b1.jar"/> + <classpathentry kind="lib" path="extlibs/antlr-runtime-3.1.jar"/> <classpathentry kind="output" path="bugtests/classes"/> </classpath> Modified: branches/advanced/CPythonLib.includes =================================================================== --- branches/advanced/CPythonLib.includes 2008-09-01 06:32:39 UTC (rev 5279) +++ branches/advanced/CPythonLib.includes 2008-09-01 14:33:42 UTC (rev 5280) @@ -43,11 +43,12 @@ copy.py copy_reg.py Cookie.py -decimal.py +csv.py difflib.py dircache.py dircmp.py dis.py +DocXMLRPCServer.py dospath.py dumbdbm.py exceptions.py @@ -57,6 +58,7 @@ formatter.py fpformat.py ftplib.py +functools.py getopt.py gettext.py glob.py @@ -69,6 +71,7 @@ htmllib.py HTMLParser.py httplib.py +ihooks.py imaplib.py imghdr.py inspect.py @@ -116,6 +119,7 @@ repr.py rfc822.py rlcompleter.py +robotparser.py runpy.py sched.py sha.py @@ -136,6 +140,7 @@ string.py StringIO.py symbol.py +tabnanny.py this.py threading.py textwrap.py @@ -151,6 +156,7 @@ urlparse.py user.py UserDict.py +UserList.py UserString.py uu.py uuid.py Modified: branches/advanced/CoreExposed.includes =================================================================== --- branches/advanced/CoreExposed.includes 2008-09-01 06:32:39 UTC (rev 5279) +++ branches/advanced/CoreExposed.includes 2008-09-01 14:33:42 UTC (rev 5280) @@ -35,6 +35,11 @@ org/python/core/PyType.class org/python/core/PyUnicode.class org/python/core/PyXRange.class +org/python/modules/_codecs$EncodingMap.class +org/python/modules/_csv/PyDialect.class +org/python/modules/_csv/PyReader.class +org/python/modules/_csv/PyWriter.class +org/python/modules/_functools/PyPartial.class org/python/modules/_weakref/CallableProxyType.class org/python/modules/_weakref/ReferenceType.class org/python/modules/_weakref/ProxyType.class Deleted: branches/advanced/Lib/UserList.py =================================================================== --- branches/advanced/Lib/UserList.py 2008-09-01 06:32:39 UTC (rev 5279) +++ branches/advanced/Lib/UserList.py 2008-09-01 14:33:42 UTC (rev 5280) @@ -1,94 +0,0 @@ -"""A more or less complete user-defined wrapper around list objects.""" - -#Imported from Python 2.3.5 and added _fixindex -class UserList: - def __init__(self, initlist=None): - self.data = [] - if initlist is not None: - # XXX should this accept an arbitrary sequence? - if type(initlist) == type(self.data): - self.data[:] = initlist - elif isinstance(initlist, UserList): - self.data[:] = initlist.data[:] - else: - self.data = list(initlist) - def __repr__(self): return repr(self.data) - def __lt__(self, other): return self.data < self.__cast(other) - def __le__(self, other): return self.data <= self.__cast(other) - def __eq__(self, other): return self.data == self.__cast(other) - def __ne__(self, other): return self.data != self.__cast(other) - def __gt__(self, other): return self.data > self.__cast(other) - def __ge__(self, other): return self.data >= self.__cast(other) - def __cast(self, other): - if isinstance(other, UserList): return other.data - else: return other - def __cmp__(self, other): - return cmp(self.data, self.__cast(other)) - def __contains__(self, item): return item in self.data - def __len__(self): return len(self.data) - def __getitem__(self, i): return self.data[i] - def __setitem__(self, i, item): self.data[i] = item - def __delitem__(self, i): del self.data[i] - def __getslice__(self, i, j): - i = self._fixindex(i); j = self._fixindex(j) - return self.__class__(self.data[i:j]) - def __setslice__(self, i, j, other): - i = self._fixindex(i); j = self._fixindex(j) - if isinstance(other, UserList): - self.data[i:j] = other.data - elif isinstance(other, type(self.data)): - self.data[i:j] = other - else: - self.data[i:j] = list(other) - def __delslice__(self, i, j): - i = self._fixindex(i); j = self._fixindex(j) - del self.data[i:j] - def __add__(self, other): - if isinstance(other, UserList): - return self.__class__(self.data + other.data) - elif isinstance(other, type(self.data)): - return self.__class__(self.data + other) - else: - return self.__class__(self.data + list(other)) - def __radd__(self, other): - if isinstance(other, UserList): - return self.__class__(other.data + self.data) - elif isinstance(other, type(self.data)): - return self.__class__(other + self.data) - else: - return self.__class__(list(other) + self.data) - def __iadd__(self, other): - if isinstance(other, UserList): - self.data += other.data - elif isinstance(other, type(self.data)): - self.data += other - else: - self.data += list(other) - return self - def __mul__(self, n): - return self.__class__(self.data*n) - __rmul__ = __mul__ - def __imul__(self, n): - self.data *= n - return self - def append(self, item): self.data.append(item) - def insert(self, i, item): self.data.insert(i, item) - def pop(self, i=-1): return self.data.pop(i) - def remove(self, item): self.data.remove(item) - def count(self, item): return self.data.count(item) - def index(self, item, *args): return self.data.index(item, *args) - def reverse(self): self.data.reverse() - def sort(self, *args): self.data.sort(*args) - def extend(self, other): - if isinstance(other, UserList): - self.data.extend(other.data) - else: - self.data.extend(other) - def _fixindex(self, index): - if index < 0: - index += len(self.data) - elif index > len(self.data): - index = len(self.data) - index = max(index, 0) - return index - Modified: branches/advanced/Lib/codeop.py =================================================================== --- branches/advanced/Lib/codeop.py 2008-09-01 06:32:39 UTC (rev 5279) +++ branches/advanced/Lib/codeop.py 2008-09-01 14:33:42 UTC (rev 5280) @@ -58,6 +58,7 @@ # import internals, not guaranteed interface from org.python.core import Py,CompilerFlags +from org.python.core.CompilerFlags import PyCF_DONT_IMPLY_DEDENT # public interface Modified: branches/advanced/Lib/datetime.py =================================================================== --- branches/advanced/Lib/datetime.py 2008-09-01 06:32:39 UTC (rev 5279) +++ branches/advanced/Lib/datetime.py 2008-09-01 14:33:42 UTC (rev 5280) @@ -981,6 +981,24 @@ def __reduce__(self): return (self.__class__, self.__getstate()) + def __tojava__(self, java_class): + from java.lang import Object + from java.sql import Date + from java.util import Calendar + from org.python.core import Py + + if java_class not in (Calendar, Date, Object): + return Py.NoConversion + + calendar = Calendar.getInstance() + calendar.clear() + calendar.set(self.year, self.month - 1, self.day) + if java_class == Calendar: + return calendar + else: + return Date(calendar.getTimeInMillis()) + + _date_class = date # so functions w/ args named "date" can get at the class date.min = date(1, 1, 1) @@ -1346,6 +1364,28 @@ def __reduce__(self): return (time, self.__getstate()) + def __tojava__(self, java_class): + # TODO, if self.tzinfo is not None, convert time to UTC + from java.lang import Object + from java.sql import Time + from java.util import Calendar + from org.python.core import Py + + if java_class not in (Calendar, Time, Object): + return Py.NoConversion + + calendar = Calendar.getInstance() + calendar.clear() + calendar.set(Calendar.HOUR_OF_DAY, self.hour) + calendar.set(Calendar.MINUTE, self.minute) + calendar.set(Calendar.SECOND, self.second) + calendar.set(Calendar.MILLISECOND, self.microsecond // 1000) + if java_class == Calendar: + return calendar + else: + return Time(calendar.getTimeInMillis()) + + _time_class = time # so functions w/ args named "time" can get at the class time.min = time(0, 0, 0) @@ -1799,7 +1839,28 @@ def __reduce__(self): return (self.__class__, self.__getstate()) + def __tojava__(self, java_class): + # TODO, if self.tzinfo is not None, convert time to UTC + from java.lang import Object + from java.sql import Timestamp + from java.util import Calendar + from org.python.core import Py + if java_class not in (Calendar, Timestamp, Object): + return Py.NoConversion + + calendar = Calendar.getInstance() + calendar.clear() + calendar.set(self.year, self.month - 1, self.day, + self.hour, self.minute, self.second) + calendar.set(Calendar.MILLISECOND, self.microsecond // 1000) + + if java_class == Calendar: + return calendar + else: + return Timestamp(calendar.getTimeInMillis()) + + datetime.min = datetime(1, 1, 1) datetime.max = datetime(9999, 12, 31, 23, 59, 59, 999999) datetime.resolution = timedelta(microseconds=1) Copied: branches/advanced/Lib/decimal.py (from rev 4988, branches/asm/Lib/decimal.py) =================================================================== --- branches/advanced/Lib/decimal.py (rev 0) +++ branches/advanced/Lib/decimal.py 2008-09-01 14:33:42 UTC (rev 5280) @@ -0,0 +1,5173 @@ +# Copyright (c) 2004 Python Software Foundation. +# All rights reserved. + +# Written by Eric Price <eprice at tjhsst.edu> +# and Facundo Batista <facundo at taniquetil.com.ar> +# and Raymond Hettinger <python at rcn.com> +# and Aahz <aahz at pobox.com> +# and Tim Peters + +# This module is currently Py2.3 compatible and should be kept that way +# unless a major compelling advantage arises. IOW, 2.3 compatibility is +# strongly preferred, but not guaranteed. + +# Also, this module should be kept in sync with the latest updates of +# the IBM specification as it evolves. Those updates will be treated +# as bug fixes (deviation from the spec is a compatibility, usability +# bug) and will be backported. At this point the spec is stabilizing +# and the updates are becoming fewer, smaller, and less significant. + +""" +This is a Py2.3 implementation of decimal floating point arithmetic based on +the General Decimal Arithmetic Specification: + + www2.hursley.ibm.com/decimal/decarith.html + +and IEEE standard 854-1987: + + www.cs.berkeley.edu/~ejr/projects/754/private/drafts/854-1987/dir.html + +Decimal floating point has finite precision with arbitrarily large bounds. + +The purpose of this module is to support arithmetic using familiar +"schoolhouse" rules and to avoid some of the tricky representation +issues associated with binary floating point. The package is especially +useful for financial applications or for contexts where users have +expectations that are at odds with binary floating point (for instance, +in binary floating point, 1.00 % 0.1 gives 0.09999999999999995 instead +of the expected Decimal("0.00") returned by decimal floating point). + +Here are some examples of using the decimal module: + +>>> from decimal import * +>>> setcontext(ExtendedContext) +>>> Decimal(0) +Decimal("0") +>>> Decimal("1") +Decimal("1") +>>> Decimal("-.0123") +Decimal("-0.0123") +>>> Decimal(123456) +Decimal("123456") +>>> Decimal("123.45e12345678901234567890") +Decimal("1.2345E+12345678901234567892") +>>> Decimal("1.33") + Decimal("1.27") +Decimal("2.60") +>>> Decimal("12.34") + Decimal("3.87") - Decimal("18.41") +Decimal("-2.20") +>>> dig = Decimal(1) +>>> print dig / Decimal(3) +0.333333333 +>>> getcontext().prec = 18 +>>> print dig / Decimal(3) +0.333333333333333333 +>>> print dig.sqrt() +1 +>>> print Decimal(3).sqrt() +1.73205080756887729 +>>> print Decimal(3) ** 123 +4.85192780976896427E+58 +>>> inf = Decimal(1) / Decimal(0) +>>> print inf +Infinity +>>> neginf = Decimal(-1) / Decimal(0) +>>> print neginf +-Infinity +>>> print neginf + inf +NaN +>>> print neginf * inf +-Infinity +>>> print dig / 0 +Infinity +>>> getcontext().traps[DivisionByZero] = 1 +>>> print dig / 0 +Traceback (most recent call last): + ... + ... + ... +DivisionByZero: x / 0 +>>> c = Context() +>>> c.traps[InvalidOperation] = 0 +>>> print c.flags[InvalidOperation] +0 +>>> c.divide(Decimal(0), Decimal(0)) +Decimal("NaN") +>>> c.traps[InvalidOperation] = 1 +>>> print c.flags[InvalidOperation] +1 +>>> c.flags[InvalidOperation] = 0 +>>> print c.flags[InvalidOperation] +0 +>>> print c.divide(Decimal(0), Decimal(0)) +Traceback (most recent call last): + ... + ... + ... +InvalidOperation: 0 / 0 +>>> print c.flags[InvalidOperation] +1 +>>> c.flags[InvalidOperation] = 0 +>>> c.traps[InvalidOperation] = 0 +>>> print c.divide(Decimal(0), Decimal(0)) +NaN +>>> print c.flags[InvalidOperation] +1 +>>> +""" + +__all__ = [ + # Two major classes + 'Decimal', 'Context', + + # Contexts + 'DefaultContext', 'BasicContext', 'ExtendedContext', + + # Exceptions + 'DecimalException', 'Clamped', 'InvalidOperation', 'DivisionByZero', + 'Inexact', 'Rounded', 'Subnormal', 'Overflow', 'Underflow', + + # Constants for use in setting up contexts + 'ROUND_DOWN', 'ROUND_HALF_UP', 'ROUND_HALF_EVEN', 'ROUND_CEILING', + 'ROUND_FLOOR', 'ROUND_UP', 'ROUND_HALF_DOWN', 'ROUND_05UP', + + # Functions for manipulating contexts + 'setcontext', 'getcontext', 'localcontext' +] + +import copy as _copy + +# Rounding +ROUND_DOWN = 'ROUND_DOWN' +ROUND_HALF_UP = 'ROUND_HALF_UP' +ROUND_HALF_EVEN = 'ROUND_HALF_EVEN' +ROUND_CEILING = 'ROUND_CEILING' +ROUND_FLOOR = 'ROUND_FLOOR' +ROUND_UP = 'ROUND_UP' +ROUND_HALF_DOWN = 'ROUND_HALF_DOWN' +ROUND_05UP = 'ROUND_05UP' + +# Errors + +class DecimalException(ArithmeticError): + """Base exception class. + + Used exceptions derive from this. + If an exception derives from another exception besides this (such as + Underflow (Inexact, Rounded, Subnormal) that indicates that it is only + called if the others are present. This isn't actually used for + anything, though. + + handle -- Called when context._raise_error is called and the + trap_enabler is set. First argument is self, second is the + context. More arguments can be given, those being after + the explanation in _raise_error (For example, + context._raise_error(NewError, '(-x)!', self._sign) would + call NewError().handle(context, self._sign).) + + To define a new exception, it should be sufficient to have it derive + from DecimalException. + """ + def handle(self, context, *args): + pass + + +class Clamped(DecimalException): + """Exponent of a 0 changed to fit bounds. + + This occurs and signals clamped if the exponent of a result has been + altered in order to fit the constraints of a specific concrete + representation. This may occur when the exponent of a zero result would + be outside the bounds of a representation, or when a large normal + number would have an encoded exponent that cannot be represented. In + this latter case, the exponent is reduced to fit and the corresponding + number of zero digits are appended to the coefficient ("fold-down"). + """ + +class InvalidOperation(DecimalException): + """An invalid operation was performed. + + Various bad things cause this: + + Something creates a signaling NaN + -INF + INF + 0 * (+-)INF + (+-)INF / (+-)INF + x % 0 + (+-)INF % x + x._rescale( non-integer ) + sqrt(-x) , x > 0 + 0 ** 0 + x ** (non-integer) + x ** (+-)INF + An operand is invalid + + The result of the operation after these is a quiet positive NaN, + except when the cause is a signaling NaN, in which case the result is + also a quiet NaN, but with the original sign, and an optional + diagnostic information. + """ + def handle(self, context, *args): + if args: + ans = _dec_from_triple(args[0]._sign, args[0]._int, 'n', True) + return ans._fix_nan(context) + return NaN + +class ConversionSyntax(InvalidOperation): + """Trying to convert badly formed string. + + This occurs and signals invalid-operation if an string is being + converted to a number and it does not conform to the numeric string + syntax. The result is [0,qNaN]. + """ + def handle(self, context, *args): + return NaN + +class DivisionByZero(DecimalException, ZeroDivisionError): + """Division by 0. + + This occurs and signals division-by-zero if division of a finite number + by zero was attempted (during a divide-integer or divide operation, or a + power operation with negative right-hand operand), and the dividend was + not zero. + + The result of the operation is [sign,inf], where sign is the exclusive + or of the signs of the operands for divide, or is 1 for an odd power of + -0, for power. + """ + + def handle(self, context, sign, *args): + return Infsign[sign] + +class DivisionImpossible(InvalidOperation): + """Cannot perform the division adequately. + + This occurs and signals invalid-operation if the integer result of a + divide-integer or remainder operation had too many digits (would be + longer than precision). The result is [0,qNaN]. + """ + + def handle(self, context, *args): + return NaN + +class DivisionUndefined(InvalidOperation, ZeroDivisionError): + """Undefined result of division. + + This occurs and signals invalid-operation if division by zero was + attempted (during a divide-integer, divide, or remainder operation), and + the dividend is also zero. The result is [0,qNaN]. + """ + + def handle(self, context, *args): + return NaN + +class Inexact(DecimalException): + """Had to round, losing information. + + This occurs and signals inexact whenever the result of an operation is + not exact (that is, it needed to be rounded and any discarded digits + were non-zero), or if an overflow or underflow condition occurs. The + result in all cases is unchanged. + + The inexact signal may be tested (or trapped) to determine if a given + operation (or sequence of operations) was inexact. + """ + +class InvalidContext(InvalidOperation): + """Invalid context. Unknown rounding, for example. + + This occurs and signals invalid-operation if an invalid context was + detected during an operation. This can occur if contexts are not checked + on creation and either the precision exceeds the capability of the + underlying concrete representation or an unknown or unsupported rounding + was specified. These aspects of the context need only be checked when + the values are required to be used. The result is [0,qNaN]. + """ + + def handle(self, context, *args): + return NaN + +class Rounded(DecimalException): + """Number got rounded (not necessarily changed during rounding). + + This occurs and signals rounded whenever the result of an operation is + rounded (that is, some zero or non-zero digits were discarded from the + coefficient), or if an overflow or underflow condition occurs. The + result in all cases is unchanged. + + The rounded signal may be tested (or trapped) to determine if a given + operation (or sequence of operations) caused a loss of precision. + """ + +class Subnormal(DecimalException): + """Exponent < Emin before rounding. + + This occurs and signals subnormal whenever the result of a conversion or + operation is subnormal (that is, its adjusted exponent is less than + Emin, before any rounding). The result in all cases is unchanged. + + The subnormal signal may be tested (or trapped) to determine if a given + or operation (or sequence of operations) yielded a subnormal result. + """ + +class Overflow(Inexact, Rounded): + """Numerical overflow. + + This occurs and signals overflow if the adjusted exponent of a result + (from a conversion or from an operation that is not an attempt to divide + by zero), after rounding, would be greater than the largest value that + can be handled by the implementation (the value Emax). + + The result depends on the rounding mode: + + For round-half-up and round-half-even (and for round-half-down and + round-up, if implemented), the result of the operation is [sign,inf], + where sign is the sign of the intermediate result. For round-down, the + result is the largest finite number that can be represented in the + current precision, with the sign of the intermediate result. For + round-ceiling, the result is the same as for round-down if the sign of + the intermediate result is 1, or is [0,inf] otherwise. For round-floor, + the result is the same as for round-down if the sign of the intermediate + result is 0, or is [1,inf] otherwise. In all cases, Inexact and Rounded + will also be raised. + """ + + def handle(self, context, sign, *args): + if context.rounding in (ROUND_HALF_UP, ROUND_HALF_EVEN, + ROUND_HALF_DOWN, ROUND_UP): + return Infsign[sign] + if sign == 0: + if context.rounding == ROUND_CEILING: + return Infsign[sign] + return _dec_from_triple(sign, '9'*context.prec, + context.Emax-context.prec+1) + if sign == 1: + if context.rounding == ROUND_FLOOR: + return Infsign[sign] + return _dec_from_triple(sign, '9'*context.prec, + context.Emax-context.prec+1) + + +class Underflow(Inexact, Rounded, Subnormal): + """Numerical underflow with result rounded to 0. + + This occurs and signals underflow if a result is inexact and the + adjusted exponent of the result would be smaller (more negative) than + the smallest value that can be handled by the implementation (the value + Emin). That is, the result is both inexact and subnormal. + + The result after an underflow will be a subnormal number rounded, if + necessary, so that its exponent is not less than Etiny. This may result + in 0 with the sign of the intermediate result and an exponent of Etiny. + + In all cases, Inexact, Rounded, and Subnormal will also be raised. + """ + +# List of public traps and flags +_signals = [Clamped, DivisionByZero, Inexact, Overflow, Rounded, + Underflow, InvalidOperation, Subnormal] + +# Map conditions (per the spec) to signals +_condition_map = {ConversionSyntax:InvalidOperation, + DivisionImpossible:InvalidOperation, + DivisionUndefined:InvalidOperation, + InvalidContext:InvalidOperation} + +##### Context Functions ################################################## + +# The getcontext() and setcontext() function manage access to a thread-local +# current context. Py2.4 offers direct support for thread locals. If that +# is not available, use threading.currentThread() which is slower but will +# work for older Pythons. If threads are not part of the build, create a +# mock threading object with threading.local() returning the module namespace. + +try: + import threading +except ImportError: + # Python was compiled without threads; create a mock object instead + import sys + class MockThreading(object): + def local(self, sys=sys): + return sys.modules[__name__] + threading = MockThreading() + del sys, MockThreading + +try: + threading.local + +except AttributeError: + + # To fix reloading, force it to create a new context + # Old contexts have different exceptions in their dicts, making problems. + if hasattr(threading.currentThread(), '__decimal_context__'): + del threading.currentThread().__decimal_context__ + + def setcontext(context): + """Set this thread's context to context.""" + if context in (DefaultContext, BasicContext, ExtendedContext): + context = context.copy() + context.clear_flags() + threading.currentThread().__decimal_context__ = context + + def getcontext(): + """Returns this thread's context. + + If this thread does not yet have a context, returns + a new context and sets this thread's context. + New contexts are copies of DefaultContext. + """ + try: + return threading.currentThread().__decimal_context__ + except AttributeError: + context = Context() + threading.currentThread().__decimal_context__ = context + return context + +else: + + local = threading.local() + if hasattr(local, '__decimal_context__'): + del local.__decimal_context__ + + def getcontext(_local=local): + """Returns this thread's context. + + If this thread does not yet have a context, returns + a new context and sets this thread's context. + New contexts are copies of DefaultContext. + """ + try: + return _local.__decimal_context__ + except AttributeError: + context = Context() + _local.__decimal_context__ = context + return context + + def setcontext(context, _local=local): + """Set this thread's context to context.""" + if context in (DefaultContext, BasicContext, ExtendedContext): + context = context.copy() + context.clear_flags() + _local.__decimal_context__ = context + + del threading, local # Don't contaminate the namespace + +def localcontext(ctx=None): + """Return a context manager for a copy of the supplied context + + Uses a copy of the current context if no context is specified + The returned context manager creates a local decimal context + in a with statement: + def sin(x): + with localcontext() as ctx: + ctx.prec += 2 + # Rest of sin calculation algorithm + # uses a precision 2 greater than normal + return +s # Convert result to normal precision + + def sin(x): + with localcontext(ExtendedContext): + # Rest of sin calculation algorithm + # uses the Extended Context from the + # General Decimal Arithmetic Specification + return +s # Convert result to normal context + + """ + # The string below can't be included in the docstring until Python 2.6 + # as the doctest module doesn't understand __future__ statements + """ + >>> from __future__ import with_statement + >>> print getcontext().prec + 28 + >>> with localcontext(): + ... ctx = getcontext() + ... ctx.prec += 2 + ... print ctx.prec + ... + 30 + >>> with localcontext(ExtendedContext): + ... print getcontext().prec + ... + 9 + >>> print getcontext().prec + 28 + """ + if ctx is None: ctx = getcontext() + return _ContextManager(ctx) + + +##### Decimal class ####################################################### + +class Decimal(object): + """Floating point class for decimal arithmetic.""" + + __slots__ = ('_exp','_int','_sign', '_is_special') + # Generally, the value of the Decimal instance is given by + # (-1)**_sign * _int * 10**_exp + # Special values are signified by _is_special == True + + # We're immutable, so use __new__ not __init__ + def __new__(cls, value="0", context=None): + """Create a decimal point instance. + + >>> Decimal('3.14') # string input + Decimal("3.14") + >>> Decimal((0, (3, 1, 4), -2)) # tuple (sign, digit_tuple, exponent) + Decimal("3.14") + >>> Decimal(314) # int or long + Decimal("314") + >>> Decimal(Decimal(314)) # another decimal instance + Decimal("314") + """ + + # Note that the coefficient, self._int, is actually stored as + # a string rather than as a tuple of digits. This speeds up + # the "digits to integer" and "integer to digits" conversions + # that are used in almost every arithmetic operation on + # Decimals. This is an internal detail: the as_tuple function + # and the Decimal constructor still deal with tuples of + # digits. + + self = object.__new__(cls) + + # From a string + # REs insist on real strings, so we can too. + if isinstance(value, basestring): + m = _parser(value) + if m is None: + if context is None: + context = getcontext() + return context._raise_error(ConversionSyntax, + "Invalid literal for Decimal: %r" % value) + + if m.group('sign') == "-": + self._sign = 1 + else: + self._sign = 0 + intpart = m.group('int') + if intpart is not None: + # finite number + fracpart = m.group('frac') + exp = int(m.group('exp') or '0') + if fracpart is not None: + self._int = str((intpart+fracpart).lstrip('0') or '0') + self._exp = exp - len(fracpart) + else: + self._int = str(intpart.lstrip('0') or '0') + self._exp = exp + self._is_special = False + else: + diag = m.group('diag') + if diag is not None: + # NaN + self._int = str(diag.lstrip('0')) + if m.group('signal'): + self._exp = 'N' + else: + self._exp = 'n' + else: + # infinity + self._int = '0' + self._exp = 'F' + self._is_special = True + return self + + # From an integer + if isinstance(value, (int,long)): + if value >= 0: + self._sign = 0 + else: + self._sign = 1 + self._exp = 0 + self._int = str(abs(value)) + self._is_special = False + return self + + # From another decimal + if isinstance(value, Decimal): + self._exp = value._exp + self._sign = value._sign + self._int = value._int + self._is_special = value._is_special + return self + + # From an internal working value + if isinstance(value, _WorkRep): + self._sign = value.sign + self._int = str(value.int) + self._exp = int(value.exp) + self._is_special = False + return self + + # tuple/list conversion (possibly from as_tuple()) + if isinstance(value, (list,tuple)): + if len(value) != 3: + raise ValueError('Invalid tuple size in creation of Decimal ' + 'from list or tuple. The list or tuple ' + 'should have exactly three elements.') + # process sign. The isinstance test rejects floats + if not (isinstance(value[0], (int, long)) and value[0] in (0,1)): + raise ValueError("Invalid sign. The first value in the tuple " + "should be an integer; either 0 for a " + "positive number or 1 for a negative number.") + self._sign = value[0] + if value[2] == 'F': + # infinity: value[1] is ignored + self._int = '0' + self._exp = value[2] + self._is_special = True + else: + # process and validate the digits in value[1] + digits = [] + for digit in value[1]: + if isinstance(digit, (int, long)) and 0 <= digit <= 9: + # skip leading zeros + if digits or digit != 0: + digits.append(digit) + else: + raise ValueError("The second value in the tuple must " + "be composed of integers in the range " + "0 through 9.") + if value[2] in ('n', 'N'): + # NaN: digits form the diagnostic + self._int = ''.join(map(str, digits)) + self._exp = value[2] + self._is_special = True + elif isinstance(value[2], (int, long)): + # finite number: digits give the coefficient + self._int = ''.join(map(str, digits or [0])) + self._exp = value[2] + self._is_special = False + else: + raise ValueError("The third value in the tuple must " + "be an integer, or one of the " + "strings 'F', 'n', 'N'.") + return self + + if isinstance(value, float): + raise TypeError("Cannot convert float to Decimal. " + + "First convert the float to a string") + + raise TypeError("Cannot convert %r to Decimal" % value) + + def _isnan(self): + """Returns whether the number is not actually one. + + 0 if a number + 1 if NaN + 2 if sNaN + """ + if self._is_special: + exp = self._exp + if exp == 'n': + return 1 + elif exp == 'N': + return 2 + return 0 + + def _isinfinity(self): + """Returns whether the number is infinite + + 0 if finite or not a number + 1 if +INF + -1 if -INF + """ + if self._exp == 'F': + if self._sign: + return -1 + return 1 + return 0 + + def _check_nans(self, other=None, context=None): + """Returns whether the number is not actually one. + + if self, other are sNaN, signal + if self, other are NaN return nan + return 0 + + Done before operations. + """ + + self_is_nan = self._isnan() + if other is None: + other_is_nan = False + else: + other_is_nan = other._isnan() + + if self_is_nan or other_is_nan: + if context is None: + context = getcontext() + + if self_is_nan == 2: + return context._raise_error(InvalidOperation, 'sNaN', + self) + if other_is_nan == 2: + return context._raise_error(InvalidOperation, 'sNaN', + other) + if self_is_nan: + return self._fix_nan(context) + + return other._fix_nan(context) + return 0 + + def __nonzero__(self): + """Return True if self is nonzero; otherwise return False. + + NaNs and infinities are considered nonzero. + """ + return self._is_special or self._int != '0' + + def __cmp__(self, other): + other = _convert_other(other) + if other is NotImplemented: + # Never return NotImplemented + return 1 + + if self._is_special or other._is_special: + # check for nans, without raising on a signaling nan + if self._isnan() or other._isnan(): + return 1 # Comparison involving NaN's always reports self > other + + # INF = INF + return cmp(self._isinfinity(), other._isinfinity()) + + # check for zeros; note that cmp(0, -0) should return 0 + if not self: + if not other: + return 0 + else: + return -((-1)**other._sign) + if not other: + return (-1)**self._sign + + # If different signs, neg one is less + if other._sign < self._sign: + return -1 + if self._sign < other._sign: + return 1 + + self_adjusted = self.adjusted() + other_adjusted = other.adjusted() + if self_adjusted == other_adjusted: + self_padded = self._int + '0'*(self._exp - other._exp) + other_padded = other._int + '0'*(other._exp - self._exp) + return cmp(self_padded, other_padded) * (-1)**self._sign + elif self_adjusted > other_adjusted: + return (-1)**self._sign + else: # self_adjusted < other_adjusted + return -((-1)**self._sign) + + def __eq__(self, other): + if not isinstance(other, (Decimal, int, long)): + return NotImplemented + return self.__cmp__(other) == 0 + + def __ne__(self, other): + if not isinstance(other, (Decimal, int, long)): + return NotImplemented + return self.__cmp__(other) != 0 + + def compare(self, other, context=None): + """Compares one to another. + + -1 => a < b + 0 => a = b + 1 => a > b + NaN => one is NaN + Like __cmp__, but returns Decimal instances. + """ + other = _convert_other(other, raiseit=True) + + # Compare(NaN, NaN) = NaN + if (self._is_special or other and other._is_special): + ans = self._check_nans(other, context) + if ans: + return ans + + return Decimal(self.__cmp__(other)) + + def __hash__(self): + """x.__hash__() <==> hash(x)""" + # Decimal integers must hash the same as the ints + # + # The hash of a nonspecial noninteger Decimal must depend only + # on the value of that Decimal, and not on its representation. + # For example: hash(Decimal("100E-1")) == hash(Decimal("10")). + if self._is_special: + if self._isnan(): + raise TypeError('Cannot hash a NaN value.') + return hash(str(self)) + if not self: + return 0 + if self._isinteger(): + op = _WorkRep(self.to_integral_value()) + return hash((-1)**op.sign*op.int*10**op.exp) + # The value of a nonzero nonspecial Decimal instance is + # faithfully represented by the triple consisting of its sign, + # its adjusted exponent, and its coefficient with trailing + # zeros removed. + return hash((self._sign, + self._exp+len(self._int), + self._int.rstrip('0'))) + + def as_tuple(self): + """Represents the number as a triple tuple. + + To show the internals exactly as they are. + """ + return (self._sign, tuple(map(int, self._int)), self._exp) + + def __repr__(self): + """Represents the number as an instance of Decimal.""" + # Invariant: eval(repr(d)) == d + return 'Decimal("%s")' % str(self) + + def __str__(self, eng=False, context=None): + """Return string representation of the number in scientific notation. + + Captures all of the information in the underlying representation. + """ + + sign = ['', '-'][self._sign] + if self._is_special: + if self._exp == 'F': + return sign + 'Infinity' + elif self._exp == 'n': + return sign + 'NaN' + self._int + else: # self._exp == 'N' + return sign + 'sNaN' + self._int + + # number of digits of self._int to left of decimal point + leftdigits = self._exp + len(self._int) + + # dotplace is number of digits of self._int to the left of the + # decimal point in the mantissa of the output string (that... [truncated message content] |
From: <zy...@us...> - 2008-09-01 06:32:49
|
Revision: 5279 http://jython.svn.sourceforge.net/jython/?rev=5279&view=rev Author: zyasoft Date: 2008-09-01 06:32:39 +0000 (Mon, 01 Sep 2008) Log Message: ----------- The compile builtin function now can take an AST node, as produced by a previous usage of compile with the compiler flag _ast.PyCF_ONLY_AST. Generally this would be after some modification of the AST itself. Another 2.6 feature. Modified Paths: -------------- trunk/jython/src/org/python/core/Py.java trunk/jython/src/org/python/core/__builtin__.java Modified: trunk/jython/src/org/python/core/Py.java =================================================================== --- trunk/jython/src/org/python/core/Py.java 2008-09-01 04:21:27 UTC (rev 5278) +++ trunk/jython/src/org/python/core/Py.java 2008-09-01 06:32:39 UTC (rev 5279) @@ -1677,7 +1677,16 @@ } return Py.compile_flags(node, getName(), filename, true, printResults, cflags); } - + + public static PyObject compile_flags(modType node, String filename, + String kind, CompilerFlags cflags) { + boolean printResults = false; + if (kind.equals("single")) { + printResults = true; + } + return Py.compile_flags(node, getName(), filename, true, printResults, cflags); + } + public static PyObject compile_flags(String data, String filename, String kind, @@ -1941,7 +1950,6 @@ return (PyObject[]) objs.getArray(); } } - /** @deprecated */ class FixedFileWrapper extends StdoutWrapper { Modified: trunk/jython/src/org/python/core/__builtin__.java =================================================================== --- trunk/jython/src/org/python/core/__builtin__.java 2008-09-01 04:21:27 UTC (rev 5278) +++ trunk/jython/src/org/python/core/__builtin__.java 2008-09-01 06:32:39 UTC (rev 5279) @@ -5,6 +5,7 @@ import java.util.Iterator; import java.util.Map; +import org.python.antlr.ast.modType; import org.python.core.util.RelativeFile; import org.python.expose.ExposedGet; @@ -459,6 +460,10 @@ return Py.compile_flags(data, filename, kind, Py.getCompilerFlags()); } + public static PyObject compile(modType node, String filename, String kind) { + return Py.compile_flags(node, filename, kind, Py.getCompilerFlags()); + } + public static PyObject compile(String data, String filename, String kind, int flags, boolean dont_inherit) { if ((flags & ~PyTableCode.CO_ALL_FEATURES) != 0) { throw Py.ValueError("compile(): unrecognised flags"); @@ -466,6 +471,13 @@ return Py.compile_flags(data, filename, kind, Py.getCompilerFlags(flags, dont_inherit)); } + public static PyObject compile(modType node, String filename, String kind, int flags, boolean dont_inherit) { + if ((flags & ~PyTableCode.CO_ALL_FEATURES) != 0) { + throw Py.ValueError("compile(): unrecognised flags"); + } + return Py.compile_flags(node, filename, kind, Py.getCompilerFlags(flags, dont_inherit)); + } + public static void delattr(PyObject o, String n) { o.__delattr__(n); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fwi...@us...> - 2008-09-01 04:21:35
|
Revision: 5278 http://jython.svn.sourceforge.net/jython/?rev=5278&view=rev Author: fwierzbicki Date: 2008-09-01 04:21:27 +0000 (Mon, 01 Sep 2008) Log Message: ----------- Check for EOF in file_input. Comment cleanup. Modified Paths: -------------- trunk/jython/grammar/Python.g trunk/jython/src/org/python/antlr/PythonTokenSource.java Modified: trunk/jython/grammar/Python.g =================================================================== --- trunk/jython/grammar/Python.g 2008-09-01 04:03:21 UTC (rev 5277) +++ trunk/jython/grammar/Python.g 2008-09-01 04:21:27 UTC (rev 5278) @@ -288,7 +288,7 @@ } : (NEWLINE | stmt {stypes.addAll($stmt.stypes);} - )* { + )* EOF { mtype = new Module($file_input.start, actions.makeStmts(stypes)); } ; Modified: trunk/jython/src/org/python/antlr/PythonTokenSource.java =================================================================== --- trunk/jython/src/org/python/antlr/PythonTokenSource.java 2008-09-01 04:03:21 UTC (rev 5277) +++ trunk/jython/src/org/python/antlr/PythonTokenSource.java 2008-09-01 04:21:27 UTC (rev 5278) @@ -324,7 +324,6 @@ return buf.toString(); } - //FIXME: needed this for the Antlr 3.1b interface change. public String getSourceName() { return filename; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fwi...@us...> - 2008-09-01 04:03:33
|
Revision: 5277 http://jython.svn.sourceforge.net/jython/?rev=5277&view=rev Author: fwierzbicki Date: 2008-09-01 04:03:21 +0000 (Mon, 01 Sep 2008) Log Message: ----------- update "bare" grammar. Modified Paths: -------------- trunk/sandbox/wierzbicki/antlr/grammar/Python.g trunk/sandbox/wierzbicki/antlr/regr trunk/sandbox/wierzbicki/antlr/run trunk/sandbox/wierzbicki/antlr/src/Main.java trunk/sandbox/wierzbicki/antlr/src/PythonTokenSource.java Added Paths: ----------- trunk/sandbox/wierzbicki/antlr/lib/antlr-3.1.jar trunk/sandbox/wierzbicki/antlr/lib/antlr-runtime-3.1.jar trunk/sandbox/wierzbicki/antlr/lib/stringtemplate-3.2.jar Removed Paths: ------------- trunk/sandbox/wierzbicki/antlr/lib/antlr-3.0.1.jar trunk/sandbox/wierzbicki/antlr/lib/stringtemplate-3.1b1.jar Modified: trunk/sandbox/wierzbicki/antlr/grammar/Python.g =================================================================== --- trunk/sandbox/wierzbicki/antlr/grammar/Python.g 2008-08-31 01:00:57 UTC (rev 5276) +++ trunk/sandbox/wierzbicki/antlr/grammar/Python.g 2008-09-01 04:03:21 UTC (rev 5277) @@ -52,7 +52,16 @@ * * I (Terence) tested this by running it on the jython-2.1/Lib * directory of 40k lines of Python. - * + * + * REQUIRES ANTLR v3 + * + * + * Updated the original parser for Python 2.5 features. The parser has been + * altered to produce an AST - the AST work started from tne newcompiler + * grammar from Jim Baker. The current parsing and compiling strategy looks + * like this: + * + * Python source->Python.g->AST (org/python/parser/ast/*)->CodeCompiler(ASM)->.class */ grammar Python; @@ -72,60 +81,127 @@ int startPos=-1; } -single_input : NEWLINE - | simple_stmt - | compound_stmt NEWLINE - ; +single_input + : NEWLINE* EOF + | simple_stmt NEWLINE* EOF + | compound_stmt NEWLINE+ EOF + ; -file_input : (NEWLINE | stmt)* - ; +file_input + : (NEWLINE + | stmt + )* + ; -eval_input : (NEWLINE)* testlist (NEWLINE)* - ; +eval_input + : LEADING_WS? (NEWLINE)* testlist (NEWLINE)* EOF + ; -decorators: decorator+ - ; +dotted_attr + : NAME + ( (DOT NAME)+ + | + ) + ; -decorator: AT dotted_attr (LPAREN arglist? RPAREN)? NEWLINE - ; +//attr is here for Java compatibility. A Java foo.getIf() can be called from Jython as foo.if +// so we need to support any keyword as an attribute. +attr + : NAME + | AND + | AS + | ASSERT + | BREAK + | CLASS + | CONTINUE + | DEF + | DELETE + | ELIF + | EXCEPT + | EXEC + | FINALLY + | FROM + | FOR + | GLOBAL + | IF + | IMPORT + | IN + | IS + | LAMBDA + | NOT + | OR + | ORELSE + | PASS + | PRINT + | RAISE + | RETURN + | TRY + | WHILE + | WITH + | YIELD + ; -dotted_attr - : NAME (DOT NAME)* +decorator + : AT dotted_attr + ( LPAREN + ( arglist + | + ) + RPAREN + | + ) NEWLINE ; -funcdef : decorators? 'def' NAME parameters COLON suite - ; +decorators + : decorator+ + ; -parameters : LPAREN (varargslist)? RPAREN - ; +funcdef + : decorators? DEF NAME parameters COLON suite + ; -varargslist : defparameter (options {greedy=true;}:COMMA defparameter)* - (COMMA - ( STAR NAME (COMMA DOUBLESTAR NAME)? - | DOUBLESTAR NAME - )? - )? - | STAR NAME (COMMA DOUBLESTAR NAME)? - | DOUBLESTAR NAME - ; +parameters + : LPAREN + (varargslist + | + ) + RPAREN + ; -defparameter : fpdef (ASSIGN test)? - ; +defparameter + : fpdef (ASSIGN test)? + ; -fpdef : NAME - | LPAREN fplist RPAREN - ; +varargslist + : defparameter (options {greedy=true;}:COMMA defparameter)* + (COMMA + (STAR NAME (COMMA DOUBLESTAR NAME)? + | DOUBLESTAR NAME + )? + )? + | STAR NAME (COMMA DOUBLESTAR NAME)? + | DOUBLESTAR NAME + ; -fplist : fpdef (options {greedy=true;}:COMMA fpdef)* (COMMA)? - ; +fpdef + : NAME + | LPAREN fplist RPAREN + ; -stmt : simple_stmt - | compound_stmt - ; +fplist + : fpdef + (options {greedy=true;}:COMMA fpdef)* (COMMA)? + ; -simple_stmt : small_stmt (options {greedy=true;}:SEMI small_stmt)* (SEMI)? NEWLINE - ; +stmt + : simple_stmt + | compound_stmt + ; +simple_stmt + : small_stmt (options {greedy=true;}:SEMI small_stmt)* (SEMI)? NEWLINE + ; + small_stmt : expr_stmt | print_stmt | del_stmt @@ -137,308 +213,515 @@ | assert_stmt ; -expr_stmt : testlist - ( augassign yield_expr - | augassign testlist - | assigns - )? - ; +expr_stmt + : ((testlist augassign) => lhs=testlist + ( (augassign yield_expr + ) + | (augassign testlist + ) + ) + | (testlist ASSIGN) => lhs=testlist + ( + | ((ASSIGN testlist)+ + ) + | ((ASSIGN yield_expr)+ + ) + ) + | lhs=testlist + ) + ; -assigns - : assign_testlist+ - | assign_yield+ +augassign + : PLUSEQUAL + | MINUSEQUAL + | STAREQUAL + | SLASHEQUAL + | PERCENTEQUAL + | AMPEREQUAL + | VBAREQUAL + | CIRCUMFLEXEQUAL + | LEFTSHIFTEQUAL + | RIGHTSHIFTEQUAL + | DOUBLESTAREQUAL + | DOUBLESLASHEQUAL ; -assign_testlist - : ASSIGN testlist - ; +print_stmt + : PRINT + (printlist + | RIGHTSHIFT printlist2 + | + ) + ; -assign_yield - : ASSIGN yield_expr +//not in CPython's Grammar file +printlist + : (test COMMA) => + test (options {k=2;}: COMMA test)* + (trailcomma=COMMA)? + | test ; -augassign : PLUSEQUAL - | MINUSEQUAL - | STAREQUAL - | SLASHEQUAL - | PERCENTEQUAL - | AMPEREQUAL - | VBAREQUAL - | CIRCUMFLEXEQUAL - | LEFTSHIFTEQUAL - | RIGHTSHIFTEQUAL - | DOUBLESTAREQUAL - | DOUBLESLASHEQUAL - ; +//XXX: would be nice if printlist and printlist2 could be merged. +//not in CPython's Grammar file +printlist2 + : (test COMMA test) => + test (options {k=2;}: COMMA test)* + (trailcomma=COMMA)? + | test + ; -print_stmt : 'print' (printlist | RIGHTSHIFT printlist)? - ; +del_stmt + : DELETE del_list + ; -printlist returns [boolean newline] - : test (options {k=2;}: COMMA test)* (COMMA)? +pass_stmt + : PASS ; +flow_stmt + : break_stmt + | continue_stmt + | return_stmt + | raise_stmt + | yield_stmt + ; -del_stmt : 'del' exprlist - ; +break_stmt + : BREAK + ; -pass_stmt : 'pass' - ; +continue_stmt + : CONTINUE + ; -flow_stmt : break_stmt - | continue_stmt - | return_stmt - | raise_stmt - | yield_stmt - ; +return_stmt + : RETURN + (testlist + | + ) + ; -break_stmt : 'break' - ; +yield_stmt + : yield_expr + ; -continue_stmt : 'continue' - ; +raise_stmt + : RAISE (test (COMMA test + (COMMA test)?)?)? + ; -return_stmt : 'return' (testlist)? - ; +import_stmt + : import_name + | import_from + ; -yield_stmt : yield_expr - ; +import_name + : IMPORT dotted_as_names + ; -raise_stmt: 'raise' (test (COMMA test (COMMA test)?)?)? - ; +import_from + : FROM (DOT* dotted_name | DOT+) IMPORT + (STAR + | import_as_names + | LPAREN import_as_names COMMA? RPAREN + ) + ; -import_stmt : import_name - | import_from - ; +import_as_names + : import_as_name (COMMA import_as_name)* + ; -import_name : 'import' dotted_as_names - ; +import_as_name + : name=NAME (AS asname=NAME)? + ; -import_from: 'from' (DOT* dotted_name | DOT+) 'import' - (STAR - | import_as_names - | LPAREN import_as_names RPAREN - ) - ; +dotted_as_name + : dotted_name (AS NAME)? + ; -import_as_names : import_as_name (COMMA import_as_name)* (COMMA)? - ; +dotted_as_names + : dotted_as_name (COMMA dotted_as_name)* + ; -import_as_name : NAME ('as' NAME)? - ; +dotted_name + : NAME (DOT attr)* + ; -dotted_as_name : dotted_name ('as' NAME)? - ; +global_stmt + : GLOBAL NAME (COMMA NAME)* + ; -dotted_as_names : dotted_as_name (COMMA dotted_as_name)* - ; -dotted_name : NAME (DOT NAME)* - ; +exec_stmt + : EXEC expr (IN test + (COMMA test)?)? + ; -global_stmt : 'global' NAME (COMMA NAME)* - ; +assert_stmt + : ASSERT test (COMMA test)? + ; -exec_stmt : 'exec' expr ('in' test (COMMA test)?)? - ; +compound_stmt + : if_stmt + | while_stmt + | for_stmt + | try_stmt + | with_stmt + | funcdef + | classdef + ; -assert_stmt : 'assert' test (COMMA test)? - ; +if_stmt + : IF test COLON suite elif_clause* + (ORELSE COLON suite)? + ; -compound_stmt : if_stmt - | while_stmt - | for_stmt - | try_stmt - | with_stmt - | funcdef - | classdef - ; +//not in CPython's Grammar file +elif_clause + : ELIF test COLON suite + ; -if_stmt: 'if' test COLON suite elif_clause* ('else' COLON suite)? - ; +while_stmt + : WHILE test COLON suite (ORELSE COLON suite)? + ; -elif_clause : 'elif' test COLON suite - ; +for_stmt + : FOR exprlist IN testlist COLON suite + (ORELSE COLON suite)? + ; -while_stmt : 'while' test COLON suite ('else' COLON suite)? - ; +try_stmt + : TRY COLON suite + ( except_clause+ (ORELSE COLON suite)? (FINALLY COLON suite)? + | FINALLY COLON suite + ) + ; -for_stmt : 'for' exprlist 'in' testlist COLON suite ('else' COLON suite)? - ; +with_stmt + : WITH test (with_var)? COLON suite + ; -try_stmt : 'try' COLON suite - ( except_clause+ ('else' COLON suite)? ('finally' COLON suite)? - | 'finally' COLON suite - ) - ; +with_var + : (AS | NAME) expr + ; -with_stmt: 'with' test (with_var)? COLON suite - ; +except_clause + : EXCEPT (test (COMMA test)?)? COLON suite + ; -with_var: ('as' | NAME) expr - ; +suite + : simple_stmt + | NEWLINE INDENT + (stmt + )+ DEDENT + ; -except_clause : 'except' (test (COMMA test)?)? COLON suite - ; +test + :or_test + ( (IF or_test ORELSE) => IF o2=or_test ORELSE e=test + | + ) + | lambdef + ; -suite : simple_stmt - | NEWLINE INDENT (stmt)+ DEDENT - ; +or_test + : left=and_test + ( (OR and_test + )+ + | + ) + ; -test: or_test - ( ('if' or_test 'else') => 'if' or_test 'else' test)? - | lambdef +and_test + : not_test + ( (AND not_test + )+ + | + ) ; -or_test : and_test (OR and_test)* - ; +not_test + : NOT nt=not_test + | comparison + ; -and_test : not_test (AND not_test)* - ; +comparison + : left=expr + ( ( comp_op expr + )+ + | + ) + ; -not_test : NOT not_test - | comparison - ; +comp_op + : LESS + | GREATER + | EQUAL + | GREATEREQUAL + | LESSEQUAL + | ALT_NOTEQUAL + | NOTEQUAL + | IN + | NOT IN + | IS + | IS NOT + ; -comparison: expr (comp_op expr)* - ; +expr + : left=xor_expr + ( (VBAR xor_expr + )+ + | + ) + ; -comp_op : LESS - | GREATER - | EQUAL - | GREATEREQUAL - | LESSEQUAL - | ALT_NOTEQUAL - | NOTEQUAL - | 'in' - | NOT 'in' - | 'is' - | 'is' NOT - ; +xor_expr + : left=and_expr + ( (CIRCUMFLEX and_expr + )+ + | + ) + ; -expr : xor_expr (VBAR xor_expr)* - ; +and_expr + : shift_expr + ( (AMPER shift_expr + )+ + | + ) + ; -xor_expr : and_expr (CIRCUMFLEX and_expr)* - ; +shift_expr + : left=arith_expr + ( ( shift_op arith_expr + )+ + | + ) + ; -and_expr : shift_expr (AMPER shift_expr)* - ; +shift_op + : LEFTSHIFT + | RIGHTSHIFT + ; -shift_expr : arith_expr ((LEFTSHIFT|RIGHTSHIFT) arith_expr)* - ; +arith_expr + : left=term + ( (arith_op term + )+ + | + ) + ; -arith_expr: term ((PLUS|MINUS) term)* - ; +arith_op + : PLUS + | MINUS + ; -term : factor ((STAR | SLASH | PERCENT | DOUBLESLASH ) factor)* - ; +term + : factor + ( (term_op factor + )+ + | + ) + ; -factor : PLUS factor - | MINUS factor - | TILDE factor - | power - ; +term_op + :STAR + |SLASH + |PERCENT + |DOUBLESLASH + ; -power : atom (trailer)* (options {greedy=true;}:DOUBLESTAR factor)? - ; +factor + : PLUS factor + | MINUS factor + | TILDE factor + | power + ; -atom : LPAREN - ( yield_expr - | testlist_gexp - )? - RPAREN - | LBRACK (listmaker)? RBRACK - | LCURLY (dictmaker)? RCURLY +power + : atom (trailer)* (options {greedy=true;}:DOUBLESTAR factor)? + ; + +atom + : LPAREN + ( yield_expr + | testlist_gexp + | + ) + RPAREN + | LBRACK + (listmaker + | + ) + RBRACK + | LCURLY + (dictmaker + | + ) + RCURLY | BACKQUOTE testlist BACKQUOTE | NAME | INT | LONGINT | FLOAT | COMPLEX - | (STRING)+ + | (STRING)+ ; -listmaker : test - ( list_for - | (options {greedy=true;}:COMMA test)* - ) (COMMA)? +listmaker + : test + (list_for + | (options {greedy=true;}:COMMA test)* + ) (COMMA)? ; testlist_gexp - : test ( (options {k=2;}: COMMA test)* (COMMA)? - | gen_for - ) - + : test + ( ((options {k=2;}: COMMA test)* (COMMA)? + ) + | (gen_for + ) + ) ; -lambdef: 'lambda' (varargslist)? COLON test - ; +lambdef + : LAMBDA (varargslist)? COLON test + ; -trailer : LPAREN (arglist)? RPAREN - | LBRACK subscriptlist RBRACK - | DOT NAME - ; +trailer + : LPAREN + (arglist + | + ) + RPAREN + | LBRACK subscriptlist RBRACK + | DOT attr + ; -subscriptlist : subscript (options {greedy=true;}:COMMA subscript)* (COMMA)? - ; +subscriptlist + : subscript (options {greedy=true;}:COMMA subscript)* (COMMA)? + ; -subscript : DOT DOT DOT - | test (COLON (test)? (sliceop)?)? - | COLON (test)? (sliceop)? - ; +subscript + : DOT DOT DOT + | (test COLON) + => test (COLON (test)? (sliceop)?)? + | (COLON) + => COLON (test)? (sliceop)? + | test + ; -sliceop : COLON (test)? - ; +sliceop + : COLON + (test + )? + ; -exprlist : expr (options {k=2;}: COMMA expr)* (COMMA)? - ; +exprlist + : (expr COMMA) => expr (options {k=2;}: COMMA expr)* (COMMA)? + | expr + ; +//not in CPython's Grammar file +del_list + : expr (options {k=2;}: COMMA expr)* (COMMA)? + ; + testlist - : test (options {k=2;}: COMMA test)* (COMMA)? + : (test COMMA) + => test (options {k=2;}: COMMA test)* (COMMA)? + | test ; -dictmaker : test COLON test (options {k=2;}:COMMA test COLON test)* (COMMA)? - ; +dictmaker + : test COLON test + (options {k=2;}:COMMA test COLON test)* + (COMMA)? + ; -classdef: 'class' NAME (LPAREN testlist? RPAREN)? COLON suite - ; +classdef + : CLASS NAME (LPAREN testlist? RPAREN)? COLON suite + ; -arglist : argument (COMMA argument)* - ( COMMA - ( STAR test (COMMA DOUBLESTAR test)? - | DOUBLESTAR test - )? +arglist + : argument (COMMA argument)* + (COMMA + ( STAR test (COMMA DOUBLESTAR test)? + | DOUBLESTAR test + )? )? - | STAR test (COMMA DOUBLESTAR test)? - | DOUBLESTAR test - ; + | STAR test (COMMA DOUBLESTAR test)? + | DOUBLESTAR test + ; -argument : test ( (ASSIGN test) | gen_for)? - ; +argument + : t1=test + ((ASSIGN t2=test) + | gen_for + | + ) + ; -list_iter : list_for - | list_if - ; +list_iter + : list_for + | list_if + ; -list_for : 'for' exprlist 'in' testlist (list_iter)? - ; +list_for + : FOR exprlist IN testlist (list_iter)? + ; -list_if : 'if' test (list_iter)? - ; +list_if + : IF test (list_iter)? + ; -gen_iter: gen_for - | gen_if - ; +gen_iter + : gen_for + | gen_if + ; -gen_for: 'for' exprlist 'in' or_test gen_iter? - ; +gen_for + : FOR exprlist IN or_test gen_iter? + ; -gen_if: 'if' test gen_iter? - ; +gen_if + : IF test gen_iter? + ; -yield_expr : 'yield' testlist? - ; +yield_expr + : YIELD testlist? + ; +AS : 'as' ; +ASSERT : 'assert' ; +BREAK : 'break' ; +CLASS : 'class' ; +CONTINUE : 'continue' ; +DEF : 'def' ; +DELETE : 'del' ; +ELIF : 'elif' ; +EXCEPT : 'except' ; +EXEC : 'exec' ; +FINALLY : 'finally' ; +FROM : 'from' ; +FOR : 'for' ; +GLOBAL : 'global' ; +IF : 'if' ; +IMPORT : 'import' ; +IN : 'in' ; +IS : 'is' ; +LAMBDA : 'lambda' ; +ORELSE : 'else' ; +PASS : 'pass' ; +PRINT : 'print' ; +RAISE : 'raise' ; +RETURN : 'return' ; +TRY : 'try' ; +WHILE : 'while' ; +WITH : 'with' ; +YIELD : 'yield' ; + LPAREN : '(' {implicitLineJoiningLevel++;} ; RPAREN : ')' {implicitLineJoiningLevel--;} ; @@ -553,12 +836,12 @@ INT : // Hex '0' ('x' | 'X') ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )+ | // Octal - '0' DIGITS* + '0' ( '0' .. '7' )* | '1'..'9' DIGITS* ; COMPLEX - : INT ('j'|'J') + : DIGITS+ ('j'|'J') | FLOAT ('j'|'J') ; @@ -573,12 +856,17 @@ * should make us exit loop not continue. */ STRING - : ('r'|'u'|'ur')? + : ('r'|'u'|'ur'|'R'|'U'|'UR'|'uR'|'Ur')? ( '\'\'\'' (options {greedy=false;}:TRIAPOS)* '\'\'\'' | '"""' (options {greedy=false;}:TRIQUOTE)* '"""' | '"' (ESC|~('\\'|'\n'|'"'))* '"' | '\'' (ESC|~('\\'|'\n'|'\''))* '\'' - ) + ) { + if (state.tokenStartLine != input.getLine()) { + state.tokenStartLine = input.getLine(); + state.tokenStartCharPositionInLine = -2; + } + } ; /** the two '"'? cause a warning -- is there a way to avoid that? */ @@ -604,7 +892,7 @@ */ CONTINUED_LINE : '\\' ('\r')? '\n' (' '|'\t')* { $channel=HIDDEN; } - ( nl=NEWLINE {emit(new ClassicToken(NEWLINE,nl.getText()));} + ( nl=NEWLINE {emit(new CommonToken(NEWLINE,nl.getText()));} | ) ; @@ -616,8 +904,11 @@ * Frank Wierzbicki added: Also ignore FORMFEEDS (\u000C). */ NEWLINE - : (('\u000C')?('\r')? '\n' )+ - {if ( startPos==0 || implicitLineJoiningLevel>0 ) +@init { + int newlines = 0; +} + : (('\u000C')?('\r')? '\n' {newlines++; } )+ { + if ( startPos==0 || implicitLineJoiningLevel>0 ) $channel=HIDDEN; } ; @@ -634,24 +925,42 @@ LEADING_WS @init { int spaces = 0; + int newlines = 0; } : {startPos==0}?=> ( {implicitLineJoiningLevel>0}? ( ' ' | '\t' )+ {$channel=HIDDEN;} - | ( ' ' { spaces++; } - | '\t' { spaces += 8; spaces -= (spaces \% 8); } - )+ - { - // make a string of n spaces where n is column number - 1 - char[] indentation = new char[spaces]; - for (int i=0; i<spaces; i++) { - indentation[i] = ' '; - } - String s = new String(indentation); - emit(new ClassicToken(LEADING_WS,new String(indentation))); - } - // kill trailing newline if present and then ignore - ( ('\r')? '\n' {if (token!=null) token.setChannel(HIDDEN); else $channel=HIDDEN;})* - // {token.setChannel(99); } + | ( ' ' { spaces++; } + | '\t' { spaces += 8; spaces -= (spaces \% 8); } + )+ + ( ('\r')? '\n' {newlines++; } + )* { + if (input.LA(1) != -1) { + // make a string of n spaces where n is column number - 1 + char[] indentation = new char[spaces]; + for (int i=0; i<spaces; i++) { + indentation[i] = ' '; + } + CommonToken c = new CommonToken(LEADING_WS,new String(indentation)); + c.setLine(input.getLine()); + c.setCharPositionInLine(input.getCharPositionInLine()); + emit(c); + // kill trailing newline if present and then ignore + if (newlines != 0) { + if (state.token!=null) { + state.token.setChannel(HIDDEN); + } else { + $channel=HIDDEN; + } + } + } else { + // make a string of n newlines + char[] nls = new char[newlines]; + for (int i=0; i<newlines; i++) { + nls[i] = '\n'; + } + emit(new CommonToken(NEWLINE,new String(nls))); + } + } ) ; @@ -677,6 +986,6 @@ $channel=HIDDEN; } : {startPos==0}?=> (' '|'\t')* '#' (~'\n')* '\n'+ - | {startPos>0}?=> '#' (~'\n')* // let NEWLINE handle \n unless char pos==0 for '#' + | '#' (~'\n')* // let NEWLINE handle \n unless char pos==0 for '#' ; Property changes on: trunk/sandbox/wierzbicki/antlr/lib/antlr-3.1.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/sandbox/wierzbicki/antlr/lib/antlr-runtime-3.1.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/sandbox/wierzbicki/antlr/lib/stringtemplate-3.2.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/sandbox/wierzbicki/antlr/regr =================================================================== --- trunk/sandbox/wierzbicki/antlr/regr 2008-08-31 01:00:57 UTC (rev 5276) +++ trunk/sandbox/wierzbicki/antlr/regr 2008-09-01 04:03:21 UTC (rev 5277) @@ -7,18 +7,21 @@ ./run $RELEASE25/Lib/_MozillaCookieJar.py ./run $RELEASE25/Lib/_strptime.py ./run $RELEASE25/Lib/_threading_local.py +echo Lib/a ./run $RELEASE25/Lib/aifc.py ./run $RELEASE25/Lib/anydbm.py ./run $RELEASE25/Lib/asynchat.py ./run $RELEASE25/Lib/asyncore.py ./run $RELEASE25/Lib/atexit.py ./run $RELEASE25/Lib/audiodev.py +echo Lib/b ./run $RELEASE25/Lib/base64.py ./run $RELEASE25/Lib/BaseHTTPServer.py ./run $RELEASE25/Lib/Bastion.py ./run $RELEASE25/Lib/bdb.py ./run $RELEASE25/Lib/binhex.py ./run $RELEASE25/Lib/bisect.py +echo Lib/bsddb ./run $RELEASE25/Lib/bsddb/__init__.py ./run $RELEASE25/Lib/bsddb/db.py ./run $RELEASE25/Lib/bsddb/dbobj.py @@ -26,6 +29,7 @@ ./run $RELEASE25/Lib/bsddb/dbshelve.py ./run $RELEASE25/Lib/bsddb/dbtables.py ./run $RELEASE25/Lib/bsddb/dbutils.py +echo Lib/bsddb/test ./run $RELEASE25/Lib/bsddb/test/__init__.py ./run $RELEASE25/Lib/bsddb/test/test_1413192.py ./run $RELEASE25/Lib/bsddb/test/test_all.py @@ -562,6 +566,7 @@ ./run $RELEASE25/Lib/plat-linux2/TYPES.py echo Lib/plat-mac ./run $RELEASE25/Lib/plat-mac/aepack.py +#aetools uses 'as' not as a keyword #./run $RELEASE25/Lib/plat-mac/aetools.py ./run $RELEASE25/Lib/plat-mac/aetypes.py ./run $RELEASE25/Lib/plat-mac/applesingle.py @@ -677,6 +682,7 @@ ./run $RELEASE25/Lib/plat-mac/lib-scriptpackages/Netscape/Text.py ./run $RELEASE25/Lib/plat-mac/lib-scriptpackages/Netscape/WorldWideWeb_suite.py ./run $RELEASE25/Lib/plat-mac/lib-scriptpackages/StdSuites/__init__.py +#AppleScript_Suite.py uses 'as' not as a keyword #./run $RELEASE25/Lib/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py ./run $RELEASE25/Lib/plat-mac/lib-scriptpackages/StdSuites/Macintosh_Connectivity_Clas.py ./run $RELEASE25/Lib/plat-mac/lib-scriptpackages/StdSuites/QuickDraw_Graphics_Suite.py @@ -722,6 +728,7 @@ ./run $RELEASE25/Lib/plat-sunos5/CDIO.py ./run $RELEASE25/Lib/plat-sunos5/DLFCN.py ./run $RELEASE25/Lib/plat-sunos5/IN.py +#STROPTS.py uses 'as' not as a keyword #./run $RELEASE25/Lib/plat-sunos5/STROPTS.py ./run $RELEASE25/Lib/plat-sunos5/SUNAUDIODEV.py ./run $RELEASE25/Lib/plat-sunos5/TYPES.py @@ -739,6 +746,7 @@ ./run $RELEASE25/Lib/py_compile.py ./run $RELEASE25/Lib/pyclbr.py ./run $RELEASE25/Lib/pydoc.py +echo Lib/q ./run $RELEASE25/Lib/Queue.py ./run $RELEASE25/Lib/quopri.py ./run $RELEASE25/Lib/random.py @@ -811,18 +819,15 @@ ./run $RELEASE25/Lib/test/crashers/bogus_code_obj.py ./run $RELEASE25/Lib/test/crashers/borrowed_ref_1.py ./run $RELEASE25/Lib/test/crashers/borrowed_ref_2.py -./run $RELEASE25/Lib/test/crashers/dangerous_subclassing.py ./run $RELEASE25/Lib/test/crashers/gc_inspection.py ./run $RELEASE25/Lib/test/crashers/infinite_rec_1.py ./run $RELEASE25/Lib/test/crashers/infinite_rec_2.py ./run $RELEASE25/Lib/test/crashers/infinite_rec_4.py ./run $RELEASE25/Lib/test/crashers/infinite_rec_5.py ./run $RELEASE25/Lib/test/crashers/loosing_dict_ref.py -./run $RELEASE25/Lib/test/crashers/modify_dict_attr.py ./run $RELEASE25/Lib/test/crashers/nasty_eq_vs_dict.py ./run $RELEASE25/Lib/test/crashers/recursion_limit_too_high.py ./run $RELEASE25/Lib/test/crashers/recursive_call.py -./run $RELEASE25/Lib/test/crashers/weakref_in_del.py ./run $RELEASE25/Lib/test/doctest_aliases.py ./run $RELEASE25/Lib/test/double_const.py echo Lib/test/f @@ -979,13 +984,13 @@ ./run $RELEASE25/Lib/test/test_gl.py ./run $RELEASE25/Lib/test/test_glob.py ./run $RELEASE25/Lib/test/test_global.py -#./run $RELEASE25/Lib/test/test_grammar.py +./run $RELEASE25/Lib/test/test_grammar.py ./run $RELEASE25/Lib/test/test_grp.py ./run $RELEASE25/Lib/test/test_gzip.py ./run $RELEASE25/Lib/test/test_hash.py ./run $RELEASE25/Lib/test/test_hashlib.py ./run $RELEASE25/Lib/test/test_heapq.py -#./run $RELEASE25/Lib/test/test_hexoct.py +./run $RELEASE25/Lib/test/test_hexoct.py ./run $RELEASE25/Lib/test/test_hmac.py ./run $RELEASE25/Lib/test/test_hotshot.py ./run $RELEASE25/Lib/test/test_htmllib.py @@ -1027,7 +1032,7 @@ ./run $RELEASE25/Lib/test/test_minidom.py ./run $RELEASE25/Lib/test/test_mmap.py ./run $RELEASE25/Lib/test/test_module.py -#./run $RELEASE25/Lib/test/test_multibytecodec.py +./run $RELEASE25/Lib/test/test_multibytecodec.py ./run $RELEASE25/Lib/test/test_multibytecodec_support.py ./run $RELEASE25/Lib/test/test_multifile.py ./run $RELEASE25/Lib/test/test_mutants.py @@ -1109,7 +1114,7 @@ ./run $RELEASE25/Lib/test/test_stringprep.py ./run $RELEASE25/Lib/test/test_strop.py ./run $RELEASE25/Lib/test/test_strptime.py -#./run $RELEASE25/Lib/test/test_struct.py +./run $RELEASE25/Lib/test/test_struct.py ./run $RELEASE25/Lib/test/test_structmembers.py ./run $RELEASE25/Lib/test/test_structseq.py ./run $RELEASE25/Lib/test/test_subprocess.py @@ -1196,8 +1201,8 @@ ./run $RELEASE25/Lib/types.py echo Lib/u ./run $RELEASE25/Lib/unittest.py -#./run $RELEASE25/Lib/urllib.py -#./run $RELEASE25/Lib/urllib2.py +./run $RELEASE25/Lib/urllib.py +./run $RELEASE25/Lib/urllib2.py ./run $RELEASE25/Lib/urlparse.py ./run $RELEASE25/Lib/user.py ./run $RELEASE25/Lib/UserDict.py Modified: trunk/sandbox/wierzbicki/antlr/run =================================================================== --- trunk/sandbox/wierzbicki/antlr/run 2008-08-31 01:00:57 UTC (rev 5276) +++ trunk/sandbox/wierzbicki/antlr/run 2008-09-01 04:03:21 UTC (rev 5277) @@ -1 +1 @@ -java -classpath lib/antlr-3.0.1.jar:build Main $* +java -classpath lib/antlr-3.1.jar:build Main $* Modified: trunk/sandbox/wierzbicki/antlr/src/Main.java =================================================================== --- trunk/sandbox/wierzbicki/antlr/src/Main.java 2008-08-31 01:00:57 UTC (rev 5276) +++ trunk/sandbox/wierzbicki/antlr/src/Main.java 2008-09-01 04:03:21 UTC (rev 5277) @@ -20,7 +20,7 @@ PythonLexer lexer = new MyLexer(input); CommonTokenStream tokens = new CommonTokenStream(lexer); tokens.discardOffChannelTokens(true); - PythonTokenSource indentedSource = new PythonTokenSource(tokens); + PythonTokenSource indentedSource = new PythonTokenSource(tokens, "<test>"); tokens = new CommonTokenStream(indentedSource); //System.out.println("tokens="+tokens.getTokens()); PythonParser parser = new PythonParser(tokens); Modified: trunk/sandbox/wierzbicki/antlr/src/PythonTokenSource.java =================================================================== --- trunk/sandbox/wierzbicki/antlr/src/PythonTokenSource.java 2008-08-31 01:00:57 UTC (rev 5276) +++ trunk/sandbox/wierzbicki/antlr/src/PythonTokenSource.java 2008-09-01 04:03:21 UTC (rev 5277) @@ -70,184 +70,263 @@ February 2004 */ public class PythonTokenSource implements TokenSource { - public static final int MAX_INDENTS = 100; - public static final int FIRST_CHAR_POSITION = 0; + public static final int MAX_INDENTS = 100; + public static final int FIRST_CHAR_POSITION = 0; - /** The stack of indent levels (column numbers) */ - int[] indentStack = new int[MAX_INDENTS]; - /** stack pointer */ - int sp=-1; // grow upwards + /** The stack of indent levels (column numbers) */ + int[] indentStack = new int[MAX_INDENTS]; + /** stack pointer */ + int sp=-1; // grow upwards - /** The queue of tokens */ - Vector tokens = new Vector(); + /** The queue of tokens */ + Vector tokens = new Vector(); - /** We pull real tokens from this lexer */ - CommonTokenStream stream; + /** We pull real tokens from this lexer */ + CommonTokenStream stream; - int lastTokenAddedIndex = -1; + int lastTokenAddedIndex = -1; - public PythonTokenSource(PythonLexer lexer) { - } + String filename; + boolean inSingle; - public PythonTokenSource(CommonTokenStream stream) { - this.stream = stream; - // "state" of indent level is FIRST_CHAR_POSITION - push(FIRST_CHAR_POSITION); - } + public PythonTokenSource(PythonLexer lexer) { + } - /** From http://www.python.org/doc/2.2.3/ref/indentation.html - "Before the first line of the file is read, a single zero is - pushed on the stack; this will never be popped off again. The - numbers pushed on the stack will always be strictly increasing - from bottom to top. At the beginning of each logical line, the - line's indentation level is compared to the top of the - stack. If it is equal, nothing happens. If it is larger, it is - pushed on the stack, and one INDENT token is generated. If it - is smaller, it must be one of the numbers occurring on the - stack; all numbers on the stack that are larger are popped - off, and for each number popped off a DEDENT token is - generated. At the end of the file, a DEDENT token is generated - for each number remaining on the stack that is larger than - zero." + public PythonTokenSource(CommonTokenStream stream, String filename) { + this(stream, filename, false); + } - I use char position in line 0..n-1 instead. + public PythonTokenSource(CommonTokenStream stream, String filename, boolean single) { + this.stream = stream; + this.filename = filename; + this.inSingle = single; + // "state" of indent level is FIRST_CHAR_POSITION + push(FIRST_CHAR_POSITION); + } - The DEDENTS possibly needed at EOF are gracefully handled by forcing - EOF to have char pos 0 even though with UNIX it's hard to get EOF - at a non left edge. - */ - public Token nextToken() { - // if something in queue, just remove and return it - if ( tokens.size()>0 ) { - Token t = (Token)tokens.firstElement(); - tokens.removeElementAt(0); - // System.out.println(t); - return t; - } + /** From http://www.python.org/doc/2.2.3/ref/indentation.html - insertImaginaryIndentDedentTokens(); + "Before the first line of the file is read, a single zero is + pushed on the stack; this will never be popped off again. The + numbers pushed on the stack will always be strictly increasing + from bottom to top. At the beginning of each logical line, the + line's indentation level is compared to the top of the + stack. If it is equal, nothing happens. If it is larger, it is + pushed on the stack, and one INDENT token is generated. If it + is smaller, it must be one of the numbers occurring on the + stack; all numbers on the stack that are larger are popped + off, and for each number popped off a DEDENT token is + generated. At the end of the file, a DEDENT token is generated + for each number remaining on the stack that is larger than + zero." - return nextToken(); - } + I use char position in line 0..n-1 instead. - protected void insertImaginaryIndentDedentTokens() - { - Token t = stream.LT(1); - stream.consume(); + The DEDENTS possibly needed at EOF are gracefully handled by forcing + EOF to have char pos 0 even though with UNIX it's hard to get EOF + at a non left edge. + */ + public Token nextToken() { + // if something in queue, just remove and return it + if (tokens.size() > 0) { + Token t = (Token)tokens.firstElement(); + tokens.removeElementAt(0); + //System.out.println(filename + t); + return t; + } - // if not a NEWLINE, doesn't signal indent/dedent work; just enqueue - if ( t.getType()!=PythonLexer.NEWLINE ) { - List hiddenTokens = stream.getTokens(lastTokenAddedIndex+1,t.getTokenIndex()-1); - if ( hiddenTokens!=null ) { - tokens.addAll(hiddenTokens); - } - lastTokenAddedIndex = t.getTokenIndex(); - tokens.addElement(t); - return; - } + insertImaginaryIndentDedentTokens(); - // save NEWLINE in the queue - //System.out.println("found newline: "+t+" stack is "+stackString()); - List hiddenTokens = stream.getTokens(lastTokenAddedIndex+1,t.getTokenIndex()-1); - if ( hiddenTokens!=null ) { - tokens.addAll(hiddenTokens); - } - lastTokenAddedIndex = t.getTokenIndex(); - tokens.addElement(t); + return nextToken(); + } - // grab first token of next line - t = stream.LT(1); - stream.consume(); + private void generateNewline(Token t) { + CommonToken newline = new CommonToken(PythonLexer.NEWLINE, "\n"); + newline.setLine(t.getLine()); + newline.setCharPositionInLine(t.getCharPositionInLine()); + tokens.addElement(newline); + } - hiddenTokens = stream.getTokens(lastTokenAddedIndex+1,t.getTokenIndex()-1); - if ( hiddenTokens!=null ) { - tokens.addAll(hiddenTokens); - } - lastTokenAddedIndex = t.getTokenIndex(); + protected void insertImaginaryIndentDedentTokens() { + Token t = stream.LT(1); + stream.consume(); - // compute cpos as the char pos of next non-WS token in line - int cpos = t.getCharPositionInLine(); // column dictates indent/dedent - if ( t.getType()==Token.EOF ) { - cpos = -1; // pretend EOF always happens at left edge - } - else if ( t.getType()==PythonLexer.LEADING_WS ) { - cpos = t.getText().length(); - } + if (t.getType() == Token.EOF) { + if (!inSingle) { + Token prev = stream.LT(-1); + if (prev == null || prev.getType() != PythonLexer.NEWLINE) { + generateNewline(t); + } + } - //System.out.println("next token is: "+t); + handleDedents(-1, (CommonToken)t); + enqueue(t); + } else if (t.getType() == PythonLexer.NEWLINE) { + // save NEWLINE in the queue + //System.out.println("found newline: "+t+" stack is "+stackString()); + enqueueHiddens(t); + tokens.addElement(t); + Token newline = t; - // compare to last indent level - int lastIndent = peek(); - //System.out.println("cpos, lastIndent = "+cpos+", "+lastIndent); - if ( cpos > lastIndent ) { // they indented; track and gen INDENT - push(cpos); - //System.out.println("push("+cpos+"): "+stackString()); - Token indent = new ClassicToken(PythonParser.INDENT,""); - indent.setCharPositionInLine(t.getCharPositionInLine()); - indent.setLine(t.getLine()); - tokens.addElement(indent); - } - else if ( cpos < lastIndent ) { // they dedented - // how far back did we dedent? - int prevIndex = findPreviousIndent(cpos); - //System.out.println("dedented; prevIndex of cpos="+cpos+" is "+prevIndex); - // generate DEDENTs for each indent level we backed up over - for (int d=sp-1; d>=prevIndex; d--) { - Token dedent = new ClassicToken(PythonParser.DEDENT,""); - dedent.setCharPositionInLine(t.getCharPositionInLine()); - dedent.setLine(t.getLine()); - tokens.addElement(dedent); - } - sp = prevIndex; // pop those off indent level - } - if ( t.getType()!=PythonLexer.LEADING_WS ) { // discard WS - tokens.addElement(t); - } - } + // grab first token of next line + t = stream.LT(1); + stream.consume(); - // T O K E N S T A C K M E T H O D S + enqueueHiddens(t); - protected void push(int i) { - if (sp>=MAX_INDENTS) { - throw new IllegalStateException("stack overflow"); - } - sp++; - indentStack[sp] = i; - } + // compute cpos as the char pos of next non-WS token in line + int cpos = t.getCharPositionInLine(); // column dictates indent/dedent + if (t.getType() == Token.EOF) { + cpos = -1; // pretend EOF always happens at left edge + } + else if (t.getType() == PythonLexer.LEADING_WS) { + Token next = stream.LT(1); + if (next != null && next.getType() == Token.EOF) { + stream.consume(); + return; + } else { + cpos = t.getText().length(); + } + } - protected int pop() { - if (sp<0) { - throw new IllegalStateException("stack underflow"); - } - int top = indentStack[sp]; - sp--; - return top; - } + //System.out.println("next token is: "+t); - protected int peek() { - return indentStack[sp]; - } + // compare to last indent level + int lastIndent = peek(); + //System.out.println("cpos, lastIndent = "+cpos+", "+lastIndent); + if (cpos > lastIndent) { // they indented; track and gen INDENT + handleIndents(cpos, (CommonToken)t); + } + else if (cpos < lastIndent) { // they dedented + handleDedents(cpos, (CommonToken)t); + } - /** Return the index on stack of previous indent level == i else -1 */ - protected int findPreviousIndent(int i) { - for (int j=sp-1; j>=0; j--) { - if ( indentStack[j]==i ) { - return j; - } - } - return FIRST_CHAR_POSITION; - } + if (t.getType() == Token.EOF && inSingle) { + String newlines = newline.getText(); + for(int i=1;i<newlines.length();i++) { + generateNewline(newline); + } + } - public String stackString() { - StringBuffer buf = new StringBuffer(); - for (int j=sp; j>=0; j--) { - buf.append(" "); - buf.append(indentStack[j]); - } - return buf.toString(); - } + if (t.getType() != PythonLexer.LEADING_WS) { // discard WS + tokens.addElement(t); + } + } else { + enqueue(t); + } + } + + private void enqueue(Token t) { + enqueueHiddens(t); + tokens.addElement(t); + } + + private void enqueueHiddens(Token t) { + if (inSingle && t.getType() == Token.EOF) { + if (stream.size() > lastTokenAddedIndex + 1) { + Token hidden = stream.get(lastTokenAddedIndex + 1); + if (hidden.getType() == PythonLexer.COMMENT) { + String text = hidden.getText(); + int i = text.indexOf("\n"); + while(i != -1) { + generateNewline(hidden); + i = text.indexOf("\n", i + 1); + } + } + } + } + List hiddenTokens = stream.getTokens(lastTokenAddedIndex + 1,t.getTokenIndex() - 1); + if (hiddenTokens != null) { + tokens.addAll(hiddenTokens); + } + lastTokenAddedIndex = t.getTokenIndex(); + } + + private void handleIndents(int cpos, CommonToken t) { + push(cpos); + //System.out.println("push("+cpos+"): "+stackString()); + Token indent = new CommonToken(PythonParser.INDENT,""); + indent.setCharPositionInLine(t.getCharPositionInLine()); + indent.setLine(t.getLine()); + tokens.addElement(indent); + } + + private void handleDedents(int cpos, CommonToken t) { + // how far back did we dedent? + int prevIndex = findPreviousIndent(cpos, t); + //System.out.println("dedented; prevIndex of cpos="+cpos+" is "+prevIndex); + // generate DEDENTs for each indent level we backed up over + for (int d = sp - 1; d >= prevIndex; d--) { + CommonToken dedent = new CommonToken(PythonParser.DEDENT,""); + dedent.setCharPositionInLine(t.getCharPositionInLine()); + dedent.setLine(t.getLine()); + + //XXX: this will get messed up by comments. + dedent.setStartIndex(t.getStartIndex()); + dedent.setStopIndex(t.getStopIndex()); + + tokens.addElement(dedent); + } + sp = prevIndex; // pop those off indent level + } + + // T O K E N S T A C K M E T H O D S + + protected void push(int i) { + if (sp >= MAX_INDENTS) { + throw new IllegalStateException("stack overflow"); + } + sp++; + indentStack[sp] = i; + } + + protected int pop() { + if (sp<0) { + throw new IllegalStateException("stack underflow"); + } + int top = indentStack[sp]; + sp--; + return top; + } + + protected int peek() { + return indentStack[sp]; + } + + /** Return the index on stack of previous indent level == i else -1 */ + protected int findPreviousIndent(int i, Token t) { + for (int j = sp - 1; j >= 0; j--) { + if (indentStack[j] == i) { + return j; + } + } + //The -2 is for the special case of getCharPositionInLine in multiline str nodes. + if (i == -1 || i == -2) { + return FIRST_CHAR_POSITION; + } + /* ParseException p = new ParseException("unindent does not match any outer indentation level", t.getLine(), t.getCharPositionInLine()); + p.setType(Py.IndentationError); + throw p; + */ + throw new RuntimeException("unindent does not match any outer indentation level"); + } + + public String stackString() { + StringBuffer buf = new StringBuffer(); + for (int j = sp; j >= 0; j--) { + buf.append(" "); + buf.append(indentStack[j]); + } + return buf.toString(); + } + + //FIXME: needed this for the Antlr 3.1b interface change. + public String getSourceName() { + return filename; + } + } /* More example input / output pairs with code simplified to single chars This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fwi...@us...> - 2008-08-31 01:01:00
|
Revision: 5276 http://jython.svn.sourceforge.net/jython/?rev=5276&view=rev Author: fwierzbicki Date: 2008-08-31 01:00:57 +0000 (Sun, 31 Aug 2008) Log Message: ----------- Test for more than 2 dotted_attr. See http://bugs.jython.org/issue1116. Modified Paths: -------------- trunk/jython/Lib/test/test_jy_compile.py Modified: trunk/jython/Lib/test/test_jy_compile.py =================================================================== --- trunk/jython/Lib/test/test_jy_compile.py 2008-08-31 00:31:36 UTC (rev 5275) +++ trunk/jython/Lib/test/test_jy_compile.py 2008-08-31 01:00:57 UTC (rev 5276) @@ -93,6 +93,9 @@ # this failed under 2.2.1 av("def f():\n try: pass\n finally: [x for x in (1,2)]") + # Failed for Jython 2.5a2. See http://bugs.jython.org/issue1116. + av("@a.b.c\ndef f():\n pass") + def test_incomplete(self): ai = self.assertIncomplete This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fwi...@us...> - 2008-08-31 00:31:38
|
Revision: 5275 http://jython.svn.sourceforge.net/jython/?rev=5275&view=rev Author: fwierzbicki Date: 2008-08-31 00:31:36 +0000 (Sun, 31 Aug 2008) Log Message: ----------- Fixes #1116 -- dotted_attr was calling itself, which does not make sense with +=. Modified Paths: -------------- trunk/jython/grammar/Python.g trunk/jython/src/org/python/antlr/GrammarActions.java Modified: trunk/jython/grammar/Python.g =================================================================== --- trunk/jython/grammar/Python.g 2008-08-30 18:39:59 UTC (rev 5274) +++ trunk/jython/grammar/Python.g 2008-08-31 00:31:36 UTC (rev 5275) @@ -309,8 +309,8 @@ //not in CPython's Grammar file dotted_attr returns [exprType etype] : n1=NAME - ( (DOT n2+=dotted_attr)+ { $etype = actions.makeDottedAttr($n1, $n2); } - | { $etype = new Name($NAME, $NAME.text, expr_contextType.Load); } + ( (DOT n2+=NAME)+ { $etype = actions.makeDottedAttr($n1, $n2); } + | { $etype = new Name($n1, $n1.text, expr_contextType.Load); } ) ; Modified: trunk/jython/src/org/python/antlr/GrammarActions.java =================================================================== --- trunk/jython/src/org/python/antlr/GrammarActions.java 2008-08-30 18:39:59 UTC (rev 5274) +++ trunk/jython/src/org/python/antlr/GrammarActions.java 2008-08-31 00:31:36 UTC (rev 5275) @@ -212,8 +212,8 @@ exprType makeDottedAttr(Token nameToken, List attrs) { exprType current = new Name(nameToken, nameToken.getText(), expr_contextType.Load); - for (int i=attrs.size() - 1; i > -1; i--) { - Token t = ((PythonTree)attrs.get(i)).token; + for (Object o: attrs) { + Token t = (Token)o; current = new Attribute(t, current, t.getText(), expr_contextType.Load); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zy...@us...> - 2008-08-30 18:40:03
|
Revision: 5274 http://jython.svn.sourceforge.net/jython/?rev=5274&view=rev Author: zyasoft Date: 2008-08-30 18:39:59 +0000 (Sat, 30 Aug 2008) Log Message: ----------- Exposed unicode_toString, str_toString so that Jython code can directly access the underlying java.lang.String backing our unicode and str types. This enables writing code like this: return Normalizer.normalize(unistr.toString(), normalizer_form) without Jython automatically encoding the string on our behalf. That's often what we want for CPython compatibility, but not when we are calling methods like this. (Too bad we need to know.) Added unicodedata.py and supporting data files UnicodeData.txt and EastAsianWidth.txt, both from 4.10. (We may wish to update to be more compliant with Java than Python 2.5.) Because the time it takes to import, serious refactoring should be considered, including possibly doing a codegen to Java approach. Currently does not pass MD5 hash tests in test_unicodedata, which by their nature are highly sensitive. Added collections.namedtuple. First 2.6 feature. (We should have a few in Jython 2.5.) This was originally added to support Python version of unicodedata.py, but is now just included. Modified Paths: -------------- trunk/jython/CoreExposed.includes trunk/jython/Lib/test/regrtest.py trunk/jython/src/org/python/core/PyString.java trunk/jython/src/org/python/core/PyUnicode.java trunk/jython/src/org/python/modules/Setup.java Added Paths: ----------- trunk/jython/Lib/EastAsianWidth.txt trunk/jython/Lib/UnicodeData.txt trunk/jython/Lib/collections/ trunk/jython/Lib/collections/__init__.py trunk/jython/Lib/unicodedata.py trunk/jython/src/org/python/modules/_collections/ trunk/jython/src/org/python/modules/_collections/Collections.java trunk/jython/src/org/python/modules/_collections/PyDefaultDict.java trunk/jython/src/org/python/modules/_collections/PyDefaultDictDerived.java trunk/jython/src/org/python/modules/_collections/PyDeque.java trunk/jython/src/org/python/modules/_collections/PyDequeDerived.java Removed Paths: ------------- trunk/jython/src/org/python/modules/_collections/Collections.java trunk/jython/src/org/python/modules/_collections/PyDefaultDict.java trunk/jython/src/org/python/modules/_collections/PyDefaultDictDerived.java trunk/jython/src/org/python/modules/_collections/PyDeque.java trunk/jython/src/org/python/modules/_collections/PyDequeDerived.java trunk/jython/src/org/python/modules/collections/ Modified: trunk/jython/CoreExposed.includes =================================================================== --- trunk/jython/CoreExposed.includes 2008-08-29 23:45:59 UTC (rev 5273) +++ trunk/jython/CoreExposed.includes 2008-08-30 18:39:59 UTC (rev 5274) @@ -44,8 +44,8 @@ org/python/modules/_weakref/ReferenceType.class org/python/modules/_weakref/ProxyType.class org/python/modules/_hashlib$Hash.class -org/python/modules/collections/PyDefaultDict.class -org/python/modules/collections/PyDeque.class +org/python/modules/_collections/PyDefaultDict.class +org/python/modules/_collections/PyDeque.class org/python/modules/operator$PyAttrGetter.class org/python/modules/operator$PyItemGetter.class org/python/modules/random/PyRandom.class Added: trunk/jython/Lib/EastAsianWidth.txt =================================================================== --- trunk/jython/Lib/EastAsianWidth.txt (rev 0) +++ trunk/jython/Lib/EastAsianWidth.txt 2008-08-30 18:39:59 UTC (rev 5274) @@ -0,0 +1,16368 @@ +# EastAsianWidth-4.1.0.txt +# Date: 2005-03-17, 15:21:00 PST [KW] +# +# East Asian Width Properties +# +# This file is an informative contributory data file in the +# Unicode Character Database. +# +# Copyright (c) 1991-2005 Unicode, Inc. +# For terms of use, see http://www.unicode.org/terms_of_use.html +# +# The format is two fields separated by a semicolon. +# Field 0: Unicode value +# Field 1: East Asian Width property, consisting of one of the following values: +# "N", "A", "H", "W", "F", "Na" +# - All code points, assigned or unassigned, that are not listed +# explicitly are given the value "N". +# - Characters ranges are specified as for other property files in +# the Unicode Character Database. +# +# The Unicode name of each character is provided in a comment for help +# in identifying the characters. +# +# See UAX #11: East Asian Character Width, for more information. +0000;N # <control> +0001;N # <control> +0002;N # <control> +0003;N # <control> +0004;N # <control> +0005;N # <control> +0006;N # <control> +0007;N # <control> +0008;N # <control> +0009;N # <control> +000A;N # <control> +000B;N # <control> +000C;N # <control> +000D;N # <control> +000E;N # <control> +000F;N # <control> +0010;N # <control> +0011;N # <control> +0012;N # <control> +0013;N # <control> +0014;N # <control> +0015;N # <control> +0016;N # <control> +0017;N # <control> +0018;N # <control> +0019;N # <control> +001A;N # <control> +001B;N # <control> +001C;N # <control> +001D;N # <control> +001E;N # <control> +001F;N # <control> +0020;Na # SPACE +0021;Na # EXCLAMATION MARK +0022;Na # QUOTATION MARK +0023;Na # NUMBER SIGN +0024;Na # DOLLAR SIGN +0025;Na # PERCENT SIGN +0026;Na # AMPERSAND +0027;Na # APOSTROPHE +0028;Na # LEFT PARENTHESIS +0029;Na # RIGHT PARENTHESIS +002A;Na # ASTERISK +002B;Na # PLUS SIGN +002C;Na # COMMA +002D;Na # HYPHEN-MINUS +002E;Na # FULL STOP +002F;Na # SOLIDUS +0030;Na # DIGIT ZERO +0031;Na # DIGIT ONE +0032;Na # DIGIT TWO +0033;Na # DIGIT THREE +0034;Na # DIGIT FOUR +0035;Na # DIGIT FIVE +0036;Na # DIGIT SIX +0037;Na # DIGIT SEVEN +0038;Na # DIGIT EIGHT +0039;Na # DIGIT NINE +003A;Na # COLON +003B;Na # SEMICOLON +003C;Na # LESS-THAN SIGN +003D;Na # EQUALS SIGN +003E;Na # GREATER-THAN SIGN +003F;Na # QUESTION MARK +0040;Na # COMMERCIAL AT +0041;Na # LATIN CAPITAL LETTER A +0042;Na # LATIN CAPITAL LETTER B +0043;Na # LATIN CAPITAL LETTER C +0044;Na # LATIN CAPITAL LETTER D +0045;Na # LATIN CAPITAL LETTER E +0046;Na # LATIN CAPITAL LETTER F +0047;Na # LATIN CAPITAL LETTER G +0048;Na # LATIN CAPITAL LETTER H +0049;Na # LATIN CAPITAL LETTER I +004A;Na # LATIN CAPITAL LETTER J +004B;Na # LATIN CAPITAL LETTER K +004C;Na # LATIN CAPITAL LETTER L +004D;Na # LATIN CAPITAL LETTER M +004E;Na # LATIN CAPITAL LETTER N +004F;Na # LATIN CAPITAL LETTER O +0050;Na # LATIN CAPITAL LETTER P +0051;Na # LATIN CAPITAL LETTER Q +0052;Na # LATIN CAPITAL LETTER R +0053;Na # LATIN CAPITAL LETTER S +0054;Na # LATIN CAPITAL LETTER T +0055;Na # LATIN CAPITAL LETTER U +0056;Na # LATIN CAPITAL LETTER V +0057;Na # LATIN CAPITAL LETTER W +0058;Na # LATIN CAPITAL LETTER X +0059;Na # LATIN CAPITAL LETTER Y +005A;Na # LATIN CAPITAL LETTER Z +005B;Na # LEFT SQUARE BRACKET +005C;Na # REVERSE SOLIDUS +005D;Na # RIGHT SQUARE BRACKET +005E;Na # CIRCUMFLEX ACCENT +005F;Na # LOW LINE +0060;Na # GRAVE ACCENT +0061;Na # LATIN SMALL LETTER A +0062;Na # LATIN SMALL LETTER B +0063;Na # LATIN SMALL LETTER C +0064;Na # LATIN SMALL LETTER D +0065;Na # LATIN SMALL LETTER E +0066;Na # LATIN SMALL LETTER F +0067;Na # LATIN SMALL LETTER G +0068;Na # LATIN SMALL LETTER H +0069;Na # LATIN SMALL LETTER I +006A;Na # LATIN SMALL LETTER J +006B;Na # LATIN SMALL LETTER K +006C;Na # LATIN SMALL LETTER L +006D;Na # LATIN SMALL LETTER M +006E;Na # LATIN SMALL LETTER N +006F;Na # LATIN SMALL LETTER O +0070;Na # LATIN SMALL LETTER P +0071;Na # LATIN SMALL LETTER Q +0072;Na # LATIN SMALL LETTER R +0073;Na # LATIN SMALL LETTER S +0074;Na # LATIN SMALL LETTER T +0075;Na # LATIN SMALL LETTER U +0076;Na # LATIN SMALL LETTER V +0077;Na # LATIN SMALL LETTER W +0078;Na # LATIN SMALL LETTER X +0079;Na # LATIN SMALL LETTER Y +007A;Na # LATIN SMALL LETTER Z +007B;Na # LEFT CURLY BRACKET +007C;Na # VERTICAL LINE +007D;Na # RIGHT CURLY BRACKET +007E;Na # TILDE +007F;N # <control> +0080;N # <control> +0081;N # <control> +0082;N # <control> +0083;N # <control> +0084;N # <control> +0085;N # <control> +0086;N # <control> +0087;N # <control> +0088;N # <control> +0089;N # <control> +008A;N # <control> +008B;N # <control> +008C;N # <control> +008D;N # <control> +008E;N # <control> +008F;N # <control> +0090;N # <control> +0091;N # <control> +0092;N # <control> +0093;N # <control> +0094;N # <control> +0095;N # <control> +0096;N # <control> +0097;N # <control> +0098;N # <control> +0099;N # <control> +009A;N # <control> +009B;N # <control> +009C;N # <control> +009D;N # <control> +009E;N # <control> +009F;N # <control> +00A0;N # NO-BREAK SPACE +00A1;A # INVERTED EXCLAMATION MARK +00A2;Na # CENT SIGN +00A3;Na # POUND SIGN +00A4;A # CURRENCY SIGN +00A5;Na # YEN SIGN +00A6;Na # BROKEN BAR +00A7;A # SECTION SIGN +00A8;A # DIAERESIS +00A9;N # COPYRIGHT SIGN +00AA;A # FEMININE ORDINAL INDICATOR +00AB;N # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +00AC;Na # NOT SIGN +00AD;A # SOFT HYPHEN +00AE;A # REGISTERED SIGN +00AF;Na # MACRON +00B0;A # DEGREE SIGN +00B1;A # PLUS-MINUS SIGN +00B2;A # SUPERSCRIPT TWO +00B3;A # SUPERSCRIPT THREE +00B4;A # ACUTE ACCENT +00B5;N # MICRO SIGN +00B6;A # PILCROW SIGN +00B7;A # MIDDLE DOT +00B8;A # CEDILLA +00B9;A # SUPERSCRIPT ONE +00BA;A # MASCULINE ORDINAL INDICATOR +00BB;N # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK +00BC;A # VULGAR FRACTION ONE QUARTER +00BD;A # VULGAR FRACTION ONE HALF +00BE;A # VULGAR FRACTION THREE QUARTERS +00BF;A # INVERTED QUESTION MARK +00C0;N # LATIN CAPITAL LETTER A WITH GRAVE +00C1;N # LATIN CAPITAL LETTER A WITH ACUTE +00C2;N # LATIN CAPITAL LETTER A WITH CIRCUMFLEX +00C3;N # LATIN CAPITAL LETTER A WITH TILDE +00C4;N # LATIN CAPITAL LETTER A WITH DIAERESIS +00C5;N # LATIN CAPITAL LETTER A WITH RING ABOVE +00C6;A # LATIN CAPITAL LETTER AE +00C7;N # LATIN CAPITAL LETTER C WITH CEDILLA +00C8;N # LATIN CAPITAL LETTER E WITH GRAVE +00C9;N # LATIN CAPITAL LETTER E WITH ACUTE +00CA;N # LATIN CAPITAL LETTER E WITH CIRCUMFLEX +00CB;N # LATIN CAPITAL LETTER E WITH DIAERESIS +00CC;N # LATIN CAPITAL LETTER I WITH GRAVE +00CD;N # LATIN CAPITAL LETTER I WITH ACUTE +00CE;N # LATIN CAPITAL LETTER I WITH CIRCUMFLEX +00CF;N # LATIN CAPITAL LETTER I WITH DIAERESIS +00D0;A # LATIN CAPITAL LETTER ETH +00D1;N # LATIN CAPITAL LETTER N WITH TILDE +00D2;N # LATIN CAPITAL LETTER O WITH GRAVE +00D3;N # LATIN CAPITAL LETTER O WITH ACUTE +00D4;N # LATIN CAPITAL LETTER O WITH CIRCUMFLEX +00D5;N # LATIN CAPITAL LETTER O WITH TILDE +00D6;N # LATIN CAPITAL LETTER O WITH DIAERESIS +00D7;A # MULTIPLICATION SIGN +00D8;A # LATIN CAPITAL LETTER O WITH STROKE +00D9;N # LATIN CAPITAL LETTER U WITH GRAVE +00DA;N # LATIN CAPITAL LETTER U WITH ACUTE +00DB;N # LATIN CAPITAL LETTER U WITH CIRCUMFLEX +00DC;N # LATIN CAPITAL LETTER U WITH DIAERESIS +00DD;N # LATIN CAPITAL LETTER Y WITH ACUTE +00DE;A # LATIN CAPITAL LETTER THORN +00DF;A # LATIN SMALL LETTER SHARP S +00E0;A # LATIN SMALL LETTER A WITH GRAVE +00E1;A # LATIN SMALL LETTER A WITH ACUTE +00E2;N # LATIN SMALL LETTER A WITH CIRCUMFLEX +00E3;N # LATIN SMALL LETTER A WITH TILDE +00E4;N # LATIN SMALL LETTER A WITH DIAERESIS +00E5;N # LATIN SMALL LETTER A WITH RING ABOVE +00E6;A # LATIN SMALL LETTER AE +00E7;N # LATIN SMALL LETTER C WITH CEDILLA +00E8;A # LATIN SMALL LETTER E WITH GRAVE +00E9;A # LATIN SMALL LETTER E WITH ACUTE +00EA;A # LATIN SMALL LETTER E WITH CIRCUMFLEX +00EB;N # LATIN SMALL LETTER E WITH DIAERESIS +00EC;A # LATIN SMALL LETTER I WITH GRAVE +00ED;A # LATIN SMALL LETTER I WITH ACUTE +00EE;N # LATIN SMALL LETTER I WITH CIRCUMFLEX +00EF;N # LATIN SMALL LETTER I WITH DIAERESIS +00F0;A # LATIN SMALL LETTER ETH +00F1;N # LATIN SMALL LETTER N WITH TILDE +00F2;A # LATIN SMALL LETTER O WITH GRAVE +00F3;A # LATIN SMALL LETTER O WITH ACUTE +00F4;N # LATIN SMALL LETTER O WITH CIRCUMFLEX +00F5;N # LATIN SMALL LETTER O WITH TILDE +00F6;N # LATIN SMALL LETTER O WITH DIAERESIS +00F7;A # DIVISION SIGN +00F8;A # LATIN SMALL LETTER O WITH STROKE +00F9;A # LATIN SMALL LETTER U WITH GRAVE +00FA;A # LATIN SMALL LETTER U WITH ACUTE +00FB;N # LATIN SMALL LETTER U WITH CIRCUMFLEX +00FC;A # LATIN SMALL LETTER U WITH DIAERESIS +00FD;N # LATIN SMALL LETTER Y WITH ACUTE +00FE;A # LATIN SMALL LETTER THORN +00FF;N # LATIN SMALL LETTER Y WITH DIAERESIS +0100;N # LATIN CAPITAL LETTER A WITH MACRON +0101;A # LATIN SMALL LETTER A WITH MACRON +0102;N # LATIN CAPITAL LETTER A WITH BREVE +0103;N # LATIN SMALL LETTER A WITH BREVE +0104;N # LATIN CAPITAL LETTER A WITH OGONEK +0105;N # LATIN SMALL LETTER A WITH OGONEK +0106;N # LATIN CAPITAL LETTER C WITH ACUTE +0107;N # LATIN SMALL LETTER C WITH ACUTE +0108;N # LATIN CAPITAL LETTER C WITH CIRCUMFLEX +0109;N # LATIN SMALL LETTER C WITH CIRCUMFLEX +010A;N # LATIN CAPITAL LETTER C WITH DOT ABOVE +010B;N # LATIN SMALL LETTER C WITH DOT ABOVE +010C;N # LATIN CAPITAL LETTER C WITH CARON +010D;N # LATIN SMALL LETTER C WITH CARON +010E;N # LATIN CAPITAL LETTER D WITH CARON +010F;N # LATIN SMALL LETTER D WITH CARON +0110;N # LATIN CAPITAL LETTER D WITH STROKE +0111;A # LATIN SMALL LETTER D WITH STROKE +0112;N # LATIN CAPITAL LETTER E WITH MACRON +0113;A # LATIN SMALL LETTER E WITH MACRON +0114;N # LATIN CAPITAL LETTER E WITH BREVE +0115;N # LATIN SMALL LETTER E WITH BREVE +0116;N # LATIN CAPITAL LETTER E WITH DOT ABOVE +0117;N # LATIN SMALL LETTER E WITH DOT ABOVE +0118;N # LATIN CAPITAL LETTER E WITH OGONEK +0119;N # LATIN SMALL LETTER E WITH OGONEK +011A;N # LATIN CAPITAL LETTER E WITH CARON +011B;A # LATIN SMALL LETTER E WITH CARON +011C;N # LATIN CAPITAL LETTER G WITH CIRCUMFLEX +011D;N # LATIN SMALL LETTER G WITH CIRCUMFLEX +011E;N # LATIN CAPITAL LETTER G WITH BREVE +011F;N # LATIN SMALL LETTER G WITH BREVE +0120;N # LATIN CAPITAL LETTER G WITH DOT ABOVE +0121;N # LATIN SMALL LETTER G WITH DOT ABOVE +0122;N # LATIN CAPITAL LETTER G WITH CEDILLA +0123;N # LATIN SMALL LETTER G WITH CEDILLA +0124;N # LATIN CAPITAL LETTER H WITH CIRCUMFLEX +0125;N # LATIN SMALL LETTER H WITH CIRCUMFLEX +0126;A # LATIN CAPITAL LETTER H WITH STROKE +0127;A # LATIN SMALL LETTER H WITH STROKE +0128;N # LATIN CAPITAL LETTER I WITH TILDE +0129;N # LATIN SMALL LETTER I WITH TILDE +012A;N # LATIN CAPITAL LETTER I WITH MACRON +012B;A # LATIN SMALL LETTER I WITH MACRON +012C;N # LATIN CAPITAL LETTER I WITH BREVE +012D;N # LATIN SMALL LETTER I WITH BREVE +012E;N # LATIN CAPITAL LETTER I WITH OGONEK +012F;N # LATIN SMALL LETTER I WITH OGONEK +0130;N # LATIN CAPITAL LETTER I WITH DOT ABOVE +0131;A # LATIN SMALL LETTER DOTLESS I +0132;A # LATIN CAPITAL LIGATURE IJ +0133;A # LATIN SMALL LIGATURE IJ +0134;N # LATIN CAPITAL LETTER J WITH CIRCUMFLEX +0135;N # LATIN SMALL LETTER J WITH CIRCUMFLEX +0136;N # LATIN CAPITAL LETTER K WITH CEDILLA +0137;N # LATIN SMALL LETTER K WITH CEDILLA +0138;A # LATIN SMALL LETTER KRA +0139;N # LATIN CAPITAL LETTER L WITH ACUTE +013A;N # LATIN SMALL LETTER L WITH ACUTE +013B;N # LATIN CAPITAL LETTER L WITH CEDILLA +013C;N # LATIN SMALL LETTER L WITH CEDILLA +013D;N # LATIN CAPITAL LETTER L WITH CARON +013E;N # LATIN SMALL LETTER L WITH CARON +013F;A # LATIN CAPITAL LETTER L WITH MIDDLE DOT +0140;A # LATIN SMALL LETTER L WITH MIDDLE DOT +0141;A # LATIN CAPITAL LETTER L WITH STROKE +0142;A # LATIN SMALL LETTER L WITH STROKE +0143;N # LATIN CAPITAL LETTER N WITH ACUTE +0144;A # LATIN SMALL LETTER N WITH ACUTE +0145;N # LATIN CAPITAL LETTER N WITH CEDILLA +0146;N # LATIN SMALL LETTER N WITH CEDILLA +0147;N # LATIN CAPITAL LETTER N WITH CARON +0148;A # LATIN SMALL LETTER N WITH CARON +0149;A # LATIN SMALL LETTER N PRECEDED BY APOSTROPHE +014A;A # LATIN CAPITAL LETTER ENG +014B;A # LATIN SMALL LETTER ENG +014C;N # LATIN CAPITAL LETTER O WITH MACRON +014D;A # LATIN SMALL LETTER O WITH MACRON +014E;N # LATIN CAPITAL LETTER O WITH BREVE +014F;N # LATIN SMALL LETTER O WITH BREVE +0150;N # LATIN CAPITAL LETTER O WITH DOUBLE ACUTE +0151;N # LATIN SMALL LETTER O WITH DOUBLE ACUTE +0152;A # LATIN CAPITAL LIGATURE OE +0153;A # LATIN SMALL LIGATURE OE +0154;N # LATIN CAPITAL LETTER R WITH ACUTE +0155;N # LATIN SMALL LETTER R WITH ACUTE +0156;N # LATIN CAPITAL LETTER R WITH CEDILLA +0157;N # LATIN SMALL LETTER R WITH CEDILLA +0158;N # LATIN CAPITAL LETTER R WITH CARON +0159;N # LATIN SMALL LETTER R WITH CARON +015A;N # LATIN CAPITAL LETTER S WITH ACUTE +015B;N # LATIN SMALL LETTER S WITH ACUTE +015C;N # LATIN CAPITAL LETTER S WITH CIRCUMFLEX +015D;N # LATIN SMALL LETTER S WITH CIRCUMFLEX +015E;N # LATIN CAPITAL LETTER S WITH CEDILLA +015F;N # LATIN SMALL LETTER S WITH CEDILLA +0160;N # LATIN CAPITAL LETTER S WITH CARON +0161;N # LATIN SMALL LETTER S WITH CARON +0162;N # LATIN CAPITAL LETTER T WITH CEDILLA +0163;N # LATIN SMALL LETTER T WITH CEDILLA +0164;N # LATIN CAPITAL LETTER T WITH CARON +0165;N # LATIN SMALL LETTER T WITH CARON +0166;A # LATIN CAPITAL LETTER T WITH STROKE +0167;A # LATIN SMALL LETTER T WITH STROKE +0168;N # LATIN CAPITAL LETTER U WITH TILDE +0169;N # LATIN SMALL LETTER U WITH TILDE +016A;N # LATIN CAPITAL LETTER U WITH MACRON +016B;A # LATIN SMALL LETTER U WITH MACRON +016C;N # LATIN CAPITAL LETTER U WITH BREVE +016D;N # LATIN SMALL LETTER U WITH BREVE +016E;N # LATIN CAPITAL LETTER U WITH RING ABOVE +016F;N # LATIN SMALL LETTER U WITH RING ABOVE +0170;N # LATIN CAPITAL LETTER U WITH DOUBLE ACUTE +0171;N # LATIN SMALL LETTER U WITH DOUBLE ACUTE +0172;N # LATIN CAPITAL LETTER U WITH OGONEK +0173;N # LATIN SMALL LETTER U WITH OGONEK +0174;N # LATIN CAPITAL LETTER W WITH CIRCUMFLEX +0175;N # LATIN SMALL LETTER W WITH CIRCUMFLEX +0176;N # LATIN CAPITAL LETTER Y WITH CIRCUMFLEX +0177;N # LATIN SMALL LETTER Y WITH CIRCUMFLEX +0178;N # LATIN CAPITAL LETTER Y WITH DIAERESIS +0179;N # LATIN CAPITAL LETTER Z WITH ACUTE +017A;N # LATIN SMALL LETTER Z WITH ACUTE +017B;N # LATIN CAPITAL LETTER Z WITH DOT ABOVE +017C;N # LATIN SMALL LETTER Z WITH DOT ABOVE +017D;N # LATIN CAPITAL LETTER Z WITH CARON +017E;N # LATIN SMALL LETTER Z WITH CARON +017F;N # LATIN SMALL LETTER LONG S +0180;N # LATIN SMALL LETTER B WITH STROKE +0181;N # LATIN CAPITAL LETTER B WITH HOOK +0182;N # LATIN CAPITAL LETTER B WITH TOPBAR +0183;N # LATIN SMALL LETTER B WITH TOPBAR +0184;N # LATIN CAPITAL LETTER TONE SIX +0185;N # LATIN SMALL LETTER TONE SIX +0186;N # LATIN CAPITAL LETTER OPEN O +0187;N # LATIN CAPITAL LETTER C WITH HOOK +0188;N # LATIN SMALL LETTER C WITH HOOK +0189;N # LATIN CAPITAL LETTER AFRICAN D +018A;N # LATIN CAPITAL LETTER D WITH HOOK +018B;N # LATIN CAPITAL LETTER D WITH TOPBAR +018C;N # LATIN SMALL LETTER D WITH TOPBAR +018D;N # LATIN SMALL LETTER TURNED DELTA +018E;N # LATIN CAPITAL LETTER REVERSED E +018F;N # LATIN CAPITAL LETTER SCHWA +0190;N # LATIN CAPITAL LETTER OPEN E +0191;N # LATIN CAPITAL LETTER F WITH HOOK +0192;N # LATIN SMALL LETTER F WITH HOOK +0193;N # LATIN CAPITAL LETTER G WITH HOOK +0194;N # LATIN CAPITAL LETTER GAMMA +0195;N # LATIN SMALL LETTER HV +0196;N # LATIN CAPITAL LETTER IOTA +0197;N # LATIN CAPITAL LETTER I WITH STROKE +0198;N # LATIN CAPITAL LETTER K WITH HOOK +0199;N # LATIN SMALL LETTER K WITH HOOK +019A;N # LATIN SMALL LETTER L WITH BAR +019B;N # LATIN SMALL LETTER LAMBDA WITH STROKE +019C;N # LATIN CAPITAL LETTER TURNED M +019D;N # LATIN CAPITAL LETTER N WITH LEFT HOOK +019E;N # LATIN SMALL LETTER N WITH LONG RIGHT LEG +019F;N # LATIN CAPITAL LETTER O WITH MIDDLE TILDE +01A0;N # LATIN CAPITAL LETTER O WITH HORN +01A1;N # LATIN SMALL LETTER O WITH HORN +01A2;N # LATIN CAPITAL LETTER OI +01A3;N # LATIN SMALL LETTER OI +01A4;N # LATIN CAPITAL LETTER P WITH HOOK +01A5;N # LATIN SMALL LETTER P WITH HOOK +01A6;N # LATIN LETTER YR +01A7;N # LATIN CAPITAL LETTER TONE TWO +01A8;N # LATIN SMALL LETTER TONE TWO +01A9;N # LATIN CAPITAL LETTER ESH +01AA;N # LATIN LETTER REVERSED ESH LOOP +01AB;N # LATIN SMALL LETTER T WITH PALATAL HOOK +01AC;N # LATIN CAPITAL LETTER T WITH HOOK +01AD;N # LATIN SMALL LETTER T WITH HOOK +01AE;N # LATIN CAPITAL LETTER T WITH RETROFLEX HOOK +01AF;N # LATIN CAPITAL LETTER U WITH HORN +01B0;N # LATIN SMALL LETTER U WITH HORN +01B1;N # LATIN CAPITAL LETTER UPSILON +01B2;N # LATIN CAPITAL LETTER V WITH HOOK +01B3;N # LATIN CAPITAL LETTER Y WITH HOOK +01B4;N # LATIN SMALL LETTER Y WITH HOOK +01B5;N # LATIN CAPITAL LETTER Z WITH STROKE +01B6;N # LATIN SMALL LETTER Z WITH STROKE +01B7;N # LATIN CAPITAL LETTER EZH +01B8;N # LATIN CAPITAL LETTER EZH REVERSED +01B9;N # LATIN SMALL LETTER EZH REVERSED +01BA;N # LATIN SMALL LETTER EZH WITH TAIL +01BB;N # LATIN LETTER TWO WITH STROKE +01BC;N # LATIN CAPITAL LETTER TONE FIVE +01BD;N # LATIN SMALL LETTER TONE FIVE +01BE;N # LATIN LETTER INVERTED GLOTTAL STOP WITH STROKE +01BF;N # LATIN LETTER WYNN +01C0;N # LATIN LETTER DENTAL CLICK +01C1;N # LATIN LETTER LATERAL CLICK +01C2;N # LATIN LETTER ALVEOLAR CLICK +01C3;N # LATIN LETTER RETROFLEX CLICK +01C4;N # LATIN CAPITAL LETTER DZ WITH CARON +01C5;N # LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON +01C6;N # LATIN SMALL LETTER DZ WITH CARON +01C7;N # LATIN CAPITAL LETTER LJ +01C8;N # LATIN CAPITAL LETTER L WITH SMALL LETTER J +01C9;N # LATIN SMALL LETTER LJ +01CA;N # LATIN CAPITAL LETTER NJ +01CB;N # LATIN CAPITAL LETTER N WITH SMALL LETTER J +01CC;N # LATIN SMALL LETTER NJ +01CD;N # LATIN CAPITAL LETTER A WITH CARON +01CE;A # LATIN SMALL LETTER A WITH CARON +01CF;N # LATIN CAPITAL LETTER I WITH CARON +01D0;A # LATIN SMALL LETTER I WITH CARON +01D1;N # LATIN CAPITAL LETTER O WITH CARON +01D2;A # LATIN SMALL LETTER O WITH CARON +01D3;N # LATIN CAPITAL LETTER U WITH CARON +01D4;A # LATIN SMALL LETTER U WITH CARON +01D5;N # LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON +01D6;A # LATIN SMALL LETTER U WITH DIAERESIS AND MACRON +01D7;N # LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE +01D8;A # LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE +01D9;N # LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON +01DA;A # LATIN SMALL LETTER U WITH DIAERESIS AND CARON +01DB;N # LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE +01DC;A # LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE +01DD;N # LATIN SMALL LETTER TURNED E +01DE;N # LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON +01DF;N # LATIN SMALL LETTER A WITH DIAERESIS AND MACRON +01E0;N # LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON +01E1;N # LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON +01E2;N # LATIN CAPITAL LETTER AE WITH MACRON +01E3;N # LATIN SMALL LETTER AE WITH MACRON +01E4;N # LATIN CAPITAL LETTER G WITH STROKE +01E5;N # LATIN SMALL LETTER G WITH STROKE +01E6;N # LATIN CAPITAL LETTER G WITH CARON +01E7;N # LATIN SMALL LETTER G WITH CARON +01E8;N # LATIN CAPITAL LETTER K WITH CARON +01E9;N # LATIN SMALL LETTER K WITH CARON +01EA;N # LATIN CAPITAL LETTER O WITH OGONEK +01EB;N # LATIN SMALL LETTER O WITH OGONEK +01EC;N # LATIN CAPITAL LETTER O WITH OGONEK AND MACRON +01ED;N # LATIN SMALL LETTER O WITH OGONEK AND MACRON +01EE;N # LATIN CAPITAL LETTER EZH WITH CARON +01EF;N # LATIN SMALL LETTER EZH WITH CARON +01F0;N # LATIN SMALL LETTER J WITH CARON +01F1;N # LATIN CAPITAL LETTER DZ +01F2;N # LATIN CAPITAL LETTER D WITH SMALL LETTER Z +01F3;N # LATIN SMALL LETTER DZ +01F4;N # LATIN CAPITAL LETTER G WITH ACUTE +01F5;N # LATIN SMALL LETTER G WITH ACUTE +01F6;N # LATIN CAPITAL LETTER HWAIR +01F7;N # LATIN CAPITAL LETTER WYNN +01F8;N # LATIN CAPITAL LETTER N WITH GRAVE +01F9;N # LATIN SMALL LETTER N WITH GRAVE +01FA;N # LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE +01FB;N # LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE +01FC;N # LATIN CAPITAL LETTER AE WITH ACUTE +01FD;N # LATIN SMALL LETTER AE WITH ACUTE +01FE;N # LATIN CAPITAL LETTER O WITH STROKE AND ACUTE +01FF;N # LATIN SMALL LETTER O WITH STROKE AND ACUTE +0200;N # LATIN CAPITAL LETTER A WITH DOUBLE GRAVE +0201;N # LATIN SMALL LETTER A WITH DOUBLE GRAVE +0202;N # LATIN CAPITAL LETTER A WITH INVERTED BREVE +0203;N # LATIN SMALL LETTER A WITH INVERTED BREVE +0204;N # LATIN CAPITAL LETTER E WITH DOUBLE GRAVE +0205;N # LATIN SMALL LETTER E WITH DOUBLE GRAVE +0206;N # LATIN CAPITAL LETTER E WITH INVERTED BREVE +0207;N # LATIN SMALL LETTER E WITH INVERTED BREVE +0208;N # LATIN CAPITAL LETTER I WITH DOUBLE GRAVE +0209;N # LATIN SMALL LETTER I WITH DOUBLE GRAVE +020A;N # LATIN CAPITAL LETTER I WITH INVERTED BREVE +020B;N # LATIN SMALL LETTER I WITH INVERTED BREVE +020C;N # LATIN CAPITAL LETTER O WITH DOUBLE GRAVE +020D;N # LATIN SMALL LETTER O WITH DOUBLE GRAVE +020E;N # LATIN CAPITAL LETTER O WITH INVERTED BREVE +020F;N # LATIN SMALL LETTER O WITH INVERTED BREVE +0210;N # LATIN CAPITAL LETTER R WITH DOUBLE GRAVE +0211;N # LATIN SMALL LETTER R WITH DOUBLE GRAVE +0212;N # LATIN CAPITAL LETTER R WITH INVERTED BREVE +0213;N # LATIN SMALL LETTER R WITH INVERTED BREVE +0214;N # LATIN CAPITAL LETTER U WITH DOUBLE GRAVE +0215;N # LATIN SMALL LETTER U WITH DOUBLE GRAVE +0216;N # LATIN CAPITAL LETTER U WITH INVERTED BREVE +0217;N # LATIN SMALL LETTER U WITH INVERTED BREVE +0218;N # LATIN CAPITAL LETTER S WITH COMMA BELOW +0219;N # LATIN SMALL LETTER S WITH COMMA BELOW +021A;N # LATIN CAPITAL LETTER T WITH COMMA BELOW +021B;N # LATIN SMALL LETTER T WITH COMMA BELOW +021C;N # LATIN CAPITAL LETTER YOGH +021D;N # LATIN SMALL LETTER YOGH +021E;N # LATIN CAPITAL LETTER H WITH CARON +021F;N # LATIN SMALL LETTER H WITH CARON +0220;N # LATIN CAPITAL LETTER N WITH LONG RIGHT LEG +0221;N # LATIN SMALL LETTER D WITH CURL +0222;N # LATIN CAPITAL LETTER OU +0223;N # LATIN SMALL LETTER OU +0224;N # LATIN CAPITAL LETTER Z WITH HOOK +0225;N # LATIN SMALL LETTER Z WITH HOOK +0226;N # LATIN CAPITAL LETTER A WITH DOT ABOVE +0227;N # LATIN SMALL LETTER A WITH DOT ABOVE +0228;N # LATIN CAPITAL LETTER E WITH CEDILLA +0229;N # LATIN SMALL LETTER E WITH CEDILLA +022A;N # LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON +022B;N # LATIN SMALL LETTER O WITH DIAERESIS AND MACRON +022C;N # LATIN CAPITAL LETTER O WITH TILDE AND MACRON +022D;N # LATIN SMALL LETTER O WITH TILDE AND MACRON +022E;N # LATIN CAPITAL LETTER O WITH DOT ABOVE +022F;N # LATIN SMALL LETTER O WITH DOT ABOVE +0230;N # LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON +0231;N # LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON +0232;N # LATIN CAPITAL LETTER Y WITH MACRON +0233;N # LATIN SMALL LETTER Y WITH MACRON +0234;N # LATIN SMALL LETTER L WITH CURL +0235;N # LATIN SMALL LETTER N WITH CURL +0236;N # LATIN SMALL LETTER T WITH CURL +0237;N # LATIN SMALL LETTER DOTLESS J +0238;N # LATIN SMALL LETTER DB DIGRAPH +0239;N # LATIN SMALL LETTER QP DIGRAPH +023A;N # LATIN CAPITAL LETTER A WITH STROKE +023B;N # LATIN CAPITAL LETTER C WITH STROKE +023C;N # LATIN SMALL LETTER C WITH STROKE +023D;N # LATIN CAPITAL LETTER L WITH BAR +023E;N # LATIN CAPITAL LETTER T WITH DIAGONAL STROKE +023F;N # LATIN SMALL LETTER S WITH SWASH TAIL +0240;N # LATIN SMALL LETTER Z WITH SWASH TAIL +0241;N # LATIN CAPITAL LETTER GLOTTAL STOP +0250;N # LATIN SMALL LETTER TURNED A +0251;A # LATIN SMALL LETTER ALPHA +0252;N # LATIN SMALL LETTER TURNED ALPHA +0253;N # LATIN SMALL LETTER B WITH HOOK +0254;N # LATIN SMALL LETTER OPEN O +0255;N # LATIN SMALL LETTER C WITH CURL +0256;N # LATIN SMALL LETTER D WITH TAIL +0257;N # LATIN SMALL LETTER D WITH HOOK +0258;N # LATIN SMALL LETTER REVERSED E +0259;N # LATIN SMALL LETTER SCHWA +025A;N # LATIN SMALL LETTER SCHWA WITH HOOK +025B;N # LATIN SMALL LETTER OPEN E +025C;N # LATIN SMALL LETTER REVERSED OPEN E +025D;N # LATIN SMALL LETTER REVERSED OPEN E WITH HOOK +025E;N # LATIN SMALL LETTER CLOSED REVERSED OPEN E +025F;N # LATIN SMALL LETTER DOTLESS J WITH STROKE +0260;N # LATIN SMALL LETTER G WITH HOOK +0261;A # LATIN SMALL LETTER SCRIPT G +0262;N # LATIN LETTER SMALL CAPITAL G +0263;N # LATIN SMALL LETTER GAMMA +0264;N # LATIN SMALL LETTER RAMS HORN +0265;N # LATIN SMALL LETTER TURNED H +0266;N # LATIN SMALL LETTER H WITH HOOK +0267;N # LATIN SMALL LETTER HENG WITH HOOK +0268;N # LATIN SMALL LETTER I WITH STROKE +0269;N # LATIN SMALL LETTER IOTA +026A;N # LATIN LETTER SMALL CAPITAL I +026B;N # LATIN SMALL LETTER L WITH MIDDLE TILDE +026C;N # LATIN SMALL LETTER L WITH BELT +026D;N # LATIN SMALL LETTER L WITH RETROFLEX HOOK +026E;N # LATIN SMALL LETTER LEZH +026F;N # LATIN SMALL LETTER TURNED M +0270;N # LATIN SMALL LETTER TURNED M WITH LONG LEG +0271;N # LATIN SMALL LETTER M WITH HOOK +0272;N # LATIN SMALL LETTER N WITH LEFT HOOK +0273;N # LATIN SMALL LETTER N WITH RETROFLEX HOOK +0274;N # LATIN LETTER SMALL CAPITAL N +0275;N # LATIN SMALL LETTER BARRED O +0276;N # LATIN LETTER SMALL CAPITAL OE +0277;N # LATIN SMALL LETTER CLOSED OMEGA +0278;N # LATIN SMALL LETTER PHI +0279;N # LATIN SMALL LETTER TURNED R +027A;N # LATIN SMALL LETTER TURNED R WITH LONG LEG +027B;N # LATIN SMALL LETTER TURNED R WITH HOOK +027C;N # LATIN SMALL LETTER R WITH LONG LEG +027D;N # LATIN SMALL LETTER R WITH TAIL +027E;N # LATIN SMALL LETTER R WITH FISHHOOK +027F;N # LATIN SMALL LETTER REVERSED R WITH FISHHOOK +0280;N # LATIN LETTER SMALL CAPITAL R +0281;N # LATIN LETTER SMALL CAPITAL INVERTED R +0282;N # LATIN SMALL LETTER S WITH HOOK +0283;N # LATIN SMALL LETTER ESH +0284;N # LATIN SMALL LETTER DOTLESS J WITH STROKE AND HOOK +0285;N # LATIN SMALL LETTER SQUAT REVERSED ESH +0286;N # LATIN SMALL LETTER ESH WITH CURL +0287;N # LATIN SMALL LETTER TURNED T +0288;N # LATIN SMALL LETTER T WITH RETROFLEX HOOK +0289;N # LATIN SMALL LETTER U BAR +028A;N # LATIN SMALL LETTER UPSILON +028B;N # LATIN SMALL LETTER V WITH HOOK +028C;N # LATIN SMALL LETTER TURNED V +028D;N # LATIN SMALL LETTER TURNED W +028E;N # LATIN SMALL LETTER TURNED Y +028F;N # LATIN LETTER SMALL CAPITAL Y +0290;N # LATIN SMALL LETTER Z WITH RETROFLEX HOOK +0291;N # LATIN SMALL LETTER Z WITH CURL +0292;N # LATIN SMALL LETTER EZH +0293;N # LATIN SMALL LETTER EZH WITH CURL +0294;N # LATIN LETTER GLOTTAL STOP +0295;N # LATIN LETTER PHARYNGEAL VOICED FRICATIVE +0296;N # LATIN LETTER INVERTED GLOTTAL STOP +0297;N # LATIN LETTER STRETCHED C +0298;N # LATIN LETTER BILABIAL CLICK +0299;N # LATIN LETTER SMALL CAPITAL B +029A;N # LATIN SMALL LETTER CLOSED OPEN E +029B;N # LATIN LETTER SMALL CAPITAL G WITH HOOK +029C;N # LATIN LETTER SMALL CAPITAL H +029D;N # LATIN SMALL LETTER J WITH CROSSED-TAIL +029E;N # LATIN SMALL LETTER TURNED K +029F;N # LATIN LETTER SMALL CAPITAL L +02A0;N # LATIN SMALL LETTER Q WITH HOOK +02A1;N # LATIN LETTER GLOTTAL STOP WITH STROKE +02A2;N # LATIN LETTER REVERSED GLOTTAL STOP WITH STROKE +02A3;N # LATIN SMALL LETTER DZ DIGRAPH +02A4;N # LATIN SMALL LETTER DEZH DIGRAPH +02A5;N # LATIN SMALL LETTER DZ DIGRAPH WITH CURL +02A6;N # LATIN SMALL LETTER TS DIGRAPH +02A7;N # LATIN SMALL LETTER TESH DIGRAPH +02A8;N # LATIN SMALL LETTER TC DIGRAPH WITH CURL +02A9;N # LATIN SMALL LETTER FENG DIGRAPH +02AA;N # LATIN SMALL LETTER LS DIGRAPH +02AB;N # LATIN SMALL LETTER LZ DIGRAPH +02AC;N # LATIN LETTER BILABIAL PERCUSSIVE +02AD;N # LATIN LETTER BIDENTAL PERCUSSIVE +02AE;N # LATIN SMALL LETTER TURNED H WITH FISHHOOK +02AF;N # LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL +02B0;N # MODIFIER LETTER SMALL H +02B1;N # MODIFIER LETTER SMALL H WITH HOOK +02B2;N # MODIFIER LETTER SMALL J +02B3;N # MODIFIER LETTER SMALL R +02B4;N # MODIFIER LETTER SMALL TURNED R +02B5;N # MODIFIER LETTER SMALL TURNED R WITH HOOK +02B6;N # MODIFIER LETTER SMALL CAPITAL INVERTED R +02B7;N # MODIFIER LETTER SMALL W +02B8;N # MODIFIER LETTER SMALL Y +02B9;N # MODIFIER LETTER PRIME +02BA;N # MODIFIER LETTER DOUBLE PRIME +02BB;N # MODIFIER LETTER TURNED COMMA +02BC;N # MODIFIER LETTER APOSTROPHE +02BD;N # MODIFIER LETTER REVERSED COMMA +02BE;N # MODIFIER LETTER RIGHT HALF RING +02BF;N # MODIFIER LETTER LEFT HALF RING +02C0;N # MODIFIER LETTER GLOTTAL STOP +02C1;N # MODIFIER LETTER REVERSED GLOTTAL STOP +02C2;N # MODIFIER LETTER LEFT ARROWHEAD +02C3;N # MODIFIER LETTER RIGHT ARROWHEAD +02C4;A # MODIFIER LETTER UP ARROWHEAD +02C5;N # MODIFIER LETTER DOWN ARROWHEAD +02C6;N # MODIFIER LETTER CIRCUMFLEX ACCENT +02C7;A # CARON +02C8;N # MODIFIER LETTER VERTICAL LINE +02C9;A # MODIFIER LETTER MACRON +02CA;A # MODIFIER LETTER ACUTE ACCENT +02CB;A # MODIFIER LETTER GRAVE ACCENT +02CC;N # MODIFIER LETTER LOW VERTICAL LINE +02CD;A # MODIFIER LETTER LOW MACRON +02CE;N # MODIFIER LETTER LOW GRAVE ACCENT +02CF;N # MODIFIER LETTER LOW ACUTE ACCENT +02D0;A # MODIFIER LETTER TRIANGULAR COLON +02D1;N # MODIFIER LETTER HALF TRIANGULAR COLON +02D2;N # MODIFIER LETTER CENTRED RIGHT HALF RING +02D3;N # MODIFIER LETTER CENTRED LEFT HALF RING +02D4;N # MODIFIER LETTER UP TACK +02D5;N # MODIFIER LETTER DOWN TACK +02D6;N # MODIFIER LETTER PLUS SIGN +02D7;N # MODIFIER LETTER MINUS SIGN +02D8;A # BREVE +02D9;A # DOT ABOVE +02DA;A # RING ABOVE +02DB;A # OGONEK +02DC;N # SMALL TILDE +02DD;A # DOUBLE ACUTE ACCENT +02DE;N # MODIFIER LETTER RHOTIC HOOK +02DF;A # MODIFIER LETTER CROSS ACCENT +02E0;N # MODIFIER LETTER SMALL GAMMA +02E1;N # MODIFIER LETTER SMALL L +02E2;N # MODIFIER LETTER SMALL S +02E3;N # MODIFIER LETTER SMALL X +02E4;N # MODIFIER LETTER SMALL REVERSED GLOTTAL STOP +02E5;N # MODIFIER LETTER EXTRA-HIGH TONE BAR +02E6;N # MODIFIER LETTER HIGH TONE BAR +02E7;N # MODIFIER LETTER MID TONE BAR +02E8;N # MODIFIER LETTER LOW TONE BAR +02E9;N # MODIFIER LETTER EXTRA-LOW TONE BAR +02EA;N # MODIFIER LETTER YIN DEPARTING TONE MARK +02EB;N # MODIFIER LETTER YANG DEPARTING TONE MARK +02EC;N # MODIFIER LETTER VOICING +02ED;N # MODIFIER LETTER UNASPIRATED +02EE;N # MODIFIER LETTER DOUBLE APOSTROPHE +02EF;N # MODIFIER LETTER LOW DOWN ARROWHEAD +02F0;N # MODIFIER LETTER LOW UP ARROWHEAD +02F1;N # MODIFIER LETTER LOW LEFT ARROWHEAD +02F2;N # MODIFIER LETTER LOW RIGHT ARROWHEAD +02F3;N # MODIFIER LETTER LOW RING +02F4;N # MODIFIER LETTER MIDDLE GRAVE ACCENT +02F5;N # MODIFIER LETTER MIDDLE DOUBLE GRAVE ACCENT +02F6;N # MODIFIER LETTER MIDDLE DOUBLE ACUTE ACCENT +02F7;N # MODIFIER LETTER LOW TILDE +02F8;N # MODIFIER LETTER RAISED COLON +02F9;N # MODIFIER LETTER BEGIN HIGH TONE +02FA;N # MODIFIER LETTER END HIGH TONE +02FB;N # MODIFIER LETTER BEGIN LOW TONE +02FC;N # MODIFIER LETTER END LOW TONE +02FD;N # MODIFIER LETTER SHELF +02FE;N # MODIFIER LETTER OPEN SHELF +02FF;N # MODIFIER LETTER LOW LEFT ARROW +0300;A # COMBINING GRAVE ACCENT +0301;A # COMBINING ACUTE ACCENT +0302;A # COMBINING CIRCUMFLEX ACCENT +0303;A # COMBINING TILDE +0304;A # COMBINING MACRON +0305;A # COMBINING OVERLINE +0306;A # COMBINING BREVE +0307;A # COMBINING DOT ABOVE +0308;A # COMBINING DIAERESIS +0309;A # COMBINING HOOK ABOVE +030A;A # COMBINING RING ABOVE +030B;A # COMBINING DOUBLE ACUTE ACCENT +030C;A # COMBINING CARON +030D;A # COMBINING VERTICAL LINE ABOVE +030E;A # COMBINING DOUBLE VERTICAL LINE ABOVE +030F;A # COMBINING DOUBLE GRAVE ACCENT +0310;A # COMBINING CANDRABINDU +0311;A # COMBINING INVERTED BREVE +0312;A # COMBINING TURNED COMMA ABOVE +0313;A # COMBINING COMMA ABOVE +0314;A # COMBINING REVERSED COMMA ABOVE +0315;A # COMBINING COMMA ABOVE RIGHT +0316;A # COMBINING GRAVE ACCENT BELOW +0317;A # COMBINING ACUTE ACCENT BELOW +0318;A # COMBINING LEFT TACK BELOW +0319;A # COMBINING RIGHT TACK BELOW +031A;A # COMBINING LEFT ANGLE ABOVE +031B;A # COMBINING HORN +031C;A # COMBINING LEFT HALF RING BELOW +031D;A # COMBINING UP TACK BELOW +031E;A # COMBINING DOWN TACK BELOW +031F;A # COMBINING PLUS SIGN BELOW +0320;A # COMBINING MINUS SIGN BELOW +0321;A # COMBINING PALATALIZED HOOK BELOW +0322;A # COMBINING RETROFLEX HOOK BELOW +0323;A # COMBINING DOT BELOW +0324;A # COMBINING DIAERESIS BELOW +0325;A # COMBINING RING BELOW +0326;A # COMBINING COMMA BELOW +0327;A # COMBINING CEDILLA +0328;A # COMBINING OGONEK +0329;A # COMBINING VERTICAL LINE BELOW +032A;A # COMBINING BRIDGE BELOW +032B;A # COMBINING INVERTED DOUBLE ARCH BELOW +032C;A # COMBINING CARON BELOW +032D;A # COMBINING CIRCUMFLEX ACCENT BELOW +032E;A # COMBINING BREVE BELOW +032F;A # COMBINING INVERTED BREVE BELOW +0330;A # COMBINING TILDE BELOW +0331;A # COMBINING MACRON BELOW +0332;A # COMBINING LOW LINE +0333;A # COMBINING DOUBLE LOW LINE +0334;A # COMBINING TILDE OVERLAY +0335;A # COMBINING SHORT STROKE OVERLAY +0336;A # COMBINING LONG STROKE OVERLAY +0337;A # COMBINING SHORT SOLIDUS OVERLAY +0338;A # COMBINING LONG SOLIDUS OVERLAY +0339;A # COMBINING RIGHT HALF RING BELOW +033A;A # COMBINING INVERTED BRIDGE BELOW +033B;A # COMBINING SQUARE BELOW +033C;A # COMBINING SEAGULL BELOW +033D;A # COMBINING X ABOVE +033E;A # COMBINING VERTICAL TILDE +033F;A # COMBINING DOUBLE OVERLINE +0340;A # COMBINING GRAVE TONE MARK +0341;A # COMBINING ACUTE TONE MARK +0342;A # COMBINING GREEK PERISPOMENI +0343;A # COMBINING GREEK KORONIS +0344;A # COMBINING GREEK DIALYTIKA TONOS +0345;A # COMBINING GREEK YPOGEGRAMMENI +0346;A # COMBINING BRIDGE ABOVE +0347;A # COMBINING EQUALS SIGN BELOW +0348;A # COMBINING DOUBLE VERTICAL LINE BELOW +0349;A # COMBINING LEFT ANGLE BELOW +034A;A # COMBINING NOT TILDE ABOVE +034B;A # COMBINING HOMOTHETIC ABOVE +034C;A # COMBINING ALMOST EQUAL TO ABOVE +034D;A # COMBINING LEFT RIGHT ARROW BELOW +034E;A # COMBINING UPWARDS ARROW BELOW +034F;A # COMBINING GRAPHEME JOINER +0350;A # COMBINING RIGHT ARROWHEAD ABOVE +0351;A # COMBINING LEFT HALF RING ABOVE +0352;A # COMBINING FERMATA +0353;A # COMBINING X BELOW +0354;A # COMBINING LEFT ARROWHEAD BELOW +0355;A # COMBINING RIGHT ARROWHEAD BELOW +0356;A # COMBINING RIGHT ARROWHEAD AND UP ARROWHEAD BELOW +0357;A # COMBINING RIGHT HALF RING ABOVE +0358;A # COMBINING DOT ABOVE RIGHT +0359;A # COMBINING ASTERISK BELOW +035A;A # COMBINING DOUBLE RING BELOW +035B;A # COMBINING ZIGZAG ABOVE +035C;A # COMBINING DOUBLE BREVE BELOW +035D;A # COMBINING DOUBLE BREVE +035E;A # COMBINING DOUBLE MACRON +035F;A # COMBINING DOUBLE MACRON BELOW +0360;A # COMBINING DOUBLE TILDE +0361;A # COMBINING DOUBLE INVERTED BREVE +0362;A # COMBINING DOUBLE RIGHTWARDS ARROW BELOW +0363;A # COMBINING LATIN SMALL LETTER A +0364;A # COMBINING LATIN SMALL LETTER E +0365;A # COMBINING LATIN SMALL LETTER I +0366;A # COMBINING LATIN SMALL LETTER O +0367;A # COMBINING LATIN SMALL LETTER U +0368;A # COMBINING LATIN SMALL LETTER C +0369;A # COMBINING LATIN SMALL LETTER D +036A;A # COMBINING LATIN SMALL LETTER H +036B;A # COMBINING LATIN SMALL LETTER M +036C;A # COMBINING LATIN SMALL LETTER R +036D;A # COMBINING LATIN SMALL LETTER T +036E;A # COMBINING LATIN SMALL LETTER V +036F;A # COMBINING LATIN SMALL LETTER X +0374;N # GREEK NUMERAL SIGN +0375;N # GREEK LOWER NUMERAL SIGN +037A;N # GREEK YPOGEGRAMMENI +037E;N # GREEK QUESTION MARK +0384;N # GREEK TONOS +0385;N # GREEK DIALYTIKA TONOS +0386;N # GREEK CAPITAL LETTER ALPHA WITH TONOS +0387;N # GREEK ANO TELEIA +0388;N # GREEK CAPITAL LETTER EPSILON WITH TONOS +0389;N # GREEK CAPITAL LETTER ETA WITH TONOS +038A;N # GREEK CAPITAL LETTER IOTA WITH TONOS +038C;N # GREEK CAPITAL LETTER OMICRON WITH TONOS +038E;N # GREEK CAPITAL LETTER UPSILON WITH TONOS +038F;N # GREEK CAPITAL LETTER OMEGA WITH TONOS +0390;N # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS +0391;A # GREEK CAPITAL LETTER ALPHA +0392;A # GREEK CAPITAL LETTER BETA +0393;A # GREEK CAPITAL LETTER GAMMA +0394;A # GREEK CAPITAL LETTER DELTA +0395;A # GREEK CAPITAL LETTER EPSILON +0396;A # GREEK CAPITAL LETTER ZETA +0397;A # GREEK CAPITAL LETTER ETA +0398;A # GREEK CAPITAL LETTER THETA +0399;A # GREEK CAPITAL LETTER IOTA +039A;A # GREEK CAPITAL LETTER KAPPA +039B;A # GREEK CAPITAL LETTER LAMDA +039C;A # GREEK CAPITAL LETTER MU +039D;A # GREEK CAPITAL LETTER NU +039E;A # GREEK CAPITAL LETTER XI +039F;A # GREEK CAPITAL LETTER OMICRON +03A0;A # GREEK CAPITAL LETTER PI +03A1;A # GREEK CAPITAL LETTER RHO +03A3;A # GREEK CAPITAL LETTER SIGMA +03A4;A # GREEK CAPITAL LETTER TAU +03A5;A # GREEK CAPITAL LETTER UPSILON +03A6;A # GREEK CAPITAL LETTER PHI +03A7;A # GREEK CAPITAL LETTER CHI +03A8;A # GREEK CAPITAL LETTER PSI +03A9;A # GREEK CAPITAL LETTER OMEGA +03AA;N # GREEK CAPITAL LETTER IOTA WITH DIALYTIKA +03AB;N # GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA +03AC;N # GREEK SMALL LETTER ALPHA WITH TONOS +03AD;N # GREEK SMALL LETTER EPSILON WITH TONOS +03AE;N # GREEK SMALL LETTER ETA WITH TONOS +03AF;N # GREEK SMALL LETTER IOTA WITH TONOS +03B0;N # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS +03B1;A # GREEK SMALL LETTER ALPHA +03B2;A # GREEK SMALL LETTER BETA +03B3;A # GREEK SMALL LETTER GAMMA +03B4;A # GREEK SMALL LETTER DELTA +03B5;A # GREEK SMALL LETTER EPSILON +03B6;A # GREEK SMALL LETTER ZETA +03B7;A # GREEK SMALL LETTER ETA +03B8;A # GREEK SMALL LETTER THETA +03B9;A # GREEK SMALL LETTER IOTA +03BA;A # GREEK SMALL LETTER KAPPA +03BB;A # GREEK SMALL LETTER LAMDA +03BC;A # GREEK SMALL LETTER MU +03BD;A # GREEK SMALL LETTER NU +03BE;A # GREEK SMALL LETTER XI +03BF;A # GREEK SMALL LETTER OMICRON +03C0;A # GREEK SMALL LETTER PI +03C1;A # GREEK SMALL LETTER RHO +03C2;N # GREEK SMALL LETTER FINAL SIGMA +03C3;A # GREEK SMALL LETTER SIGMA +03C4;A # GREEK SMALL LETTER TAU +03C5;A # GREEK SMALL LETTER UPSILON +03C6;A # GREEK SMALL LETTER PHI +03C7;A # GREEK SMALL LETTER CHI +03C8;A # GREEK SMALL LETTER PSI +03C9;A # GREEK SMALL LETTER OMEGA +03CA;N # GREEK SMALL LETTER IOTA WITH DIALYTIKA +03CB;N # GREEK SMALL LETTER UPSILON WITH DIALYTIKA +03CC;N # GREEK SMALL LETTER OMICRON WITH TONOS +03CD;N # GREEK SMALL LETTER UPSILON WITH TONOS +03CE;N # GREEK SMALL LETTER OMEGA WITH TONOS +03D0;N # GREEK BETA SYMBOL +03D1;N # GREEK THETA SYMBOL +03D2;N # GREEK UPSILON WITH HOOK SYMBOL +03D3;N # GREEK UPSILON WITH ACUTE AND HOOK SYMBOL +03D4;N # GREEK UPSILON WITH DIAERESIS AND HOOK SYMBOL +03D5;N # GREEK PHI SYMBOL +03D6;N # GREEK PI SYMBOL +03D7;N # GREEK KAI SYMBOL +03D8;N # GREEK LETTER ARCHAIC KOPPA +03D9;N # GREEK SMALL LETTER ARCHAIC KOPPA +03DA;N # GREEK LETTER STIGMA +03DB;N # GREEK SMALL LETTER STIGMA +03DC;N # GREEK LETTER DIGAMMA +03DD;N # GREEK SMALL LETTER DIGAMMA +03DE;N # GREEK LETTER KOPPA +03DF;N # GREEK SMALL LETTER KOPPA +03E0;N # GREEK LETTER SAMPI +03E1;N # GREEK SMALL LETTER SAMPI +03E2;N # COPTIC CAPITAL LETTER SHEI +03E3;N # COPTIC SMALL LETTER SHEI +03E4;N # COPTIC CAPITAL LETTER FEI +03E5;N # COPTIC SMALL LETTER FEI +03E6;N # COPTIC CAPITAL LETTER KHEI +03E7;N # COPTIC SMALL LETTER KHEI +03E8;N # COPTIC CAPITAL LETTER HORI +03E9;N # COPTIC SMALL LETTER HORI +03EA;N # COPTIC CAPITAL LETTER GANGIA +03EB;N # COPTIC SMALL LETTER GANGIA +03EC;N # COPTIC CAPITAL LETTER SHIMA +03ED;N # COPTIC SMALL LETTER SHIMA +03EE;N # COPTIC CAPITAL LETTER DEI +03EF;N # COPTIC SMALL LETTER DEI +03F0;N # GREEK KAPPA SYMBOL +03F1;N # GREEK RHO SYMBOL +03F2;N # GREEK LUNATE SIGMA SYMBOL +03F3;N # GREEK LETTER YOT +03F4;N # GREEK CAPITAL THETA SYMBOL +03F5;N # GREEK LUNATE EPSILON SYMBOL +03F6;N # GREEK REVERSED LUNATE EPSILON SYMBOL +03F7;N # GREEK CAPITAL LETTER SHO +03F8;N # GREEK SMALL LETTER SHO +03F9;N # GREEK CAPITAL LUNATE SIGMA SYMBOL +03FA;N # GREEK CAPITAL LETTER SAN +03FB;N # GREEK SMALL LETTER SAN +03FC;N # GREEK RHO WITH STROKE SYMBOL +03FD;N # GREEK CAPITAL REVERSED LUNATE SIGMA SYMBOL +03FE;N # GREEK CAPITAL DOTTED LUNATE SIGMA SYMBOL +03FF;N # GREEK CAPITAL REVERSED DOTTED LUNATE SIGMA SYMBOL +0400;N # CYRILLIC CAPITAL LETTER IE WITH GRAVE +0401;A # CYRILLIC CAPITAL LETTER IO +0402;N # CYRILLIC CAPITAL LETTER DJE +0403;N # CYRILLIC CAPITAL LETTER GJE +0404;N # CYRILLIC CAPITAL LETTER UKRAINIAN IE +0405;N # CYRILLIC CAPITAL LETTER DZE +0406;N # CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I +0407;N # CYRILLIC CAPITAL LETTER YI +0408;N # CYRILLIC CAPITAL LETTER JE +0409;N # CYRILLIC CAPITAL LETTER LJE +040A;N # CYRILLIC CAPITAL LETTER NJE +040B;N # CYRILLIC CAPITAL LETTER TSHE +040C;N # CYRILLIC CAPITAL LETTER KJE +040D;N # CYRILLIC CAPITAL LETTER I WITH GRAVE +040E;N # CYRILLIC CAPITAL LETTER SHORT U +040F;N # CYRILLIC CAPITAL LETTER DZHE +0410;A # CYRILLIC CAPITAL LETTER A +0411;A # CYRILLIC CAPITAL LETTER BE +0412;A # CYRILLIC CAPITAL LETTER VE +0413;A # CYRILLIC CAPITAL LETTER GHE +0414;A # CYRILLIC CAPITAL LETTER DE +0415;A # CYRILLIC CAPITAL LETTER IE +0416;A # CYRILLIC CAPITAL LETTER ZHE +0417;A # CYRILLIC CAPITAL LETTER ZE +0418;A # CYRILLIC CAPITAL LETTER I +0419;A # CYRILLIC CAPITAL LETTER SHORT I +041A;A # CYRILLIC CAPITAL LETTER KA +041B;A # CYRILLIC CAPITAL LETTER EL +041C;A # CYRILLIC CAPITAL LETTER EM +041D;A # CYRILLIC CAPITAL LETTER EN +041E;A # CYRILLIC CAPITAL LETTER O +041F;A # CYRILLIC CAPITAL LETTER PE +0420;A # CYRILLIC CAPITAL LETTER ER +0421;A # CYRILLIC CAPITAL LETTER ES +0422;A # CYRILLIC CAPITAL LETTER TE +0423;A # CYRILLIC CAPITAL LETTER U +0424;A # CYRILLIC CAPITAL LETTER EF +0425;A # CYRILLIC CAPITAL LETTER HA +0426;A # CYRILLIC CAPITAL LETTER TSE +0427;A # CYRILLIC CAPITAL LETTER CHE +0428;A # CYRILLIC CAPITAL LETTER SHA +0429;A # CYRILLIC CAPITAL LETTER SHCHA +042A;A # CYRILLIC CAPITAL LETTER HARD SIGN +042B;A # CYRILLIC CAPITAL LETTER YERU +042C;A # CYRILLIC CAPITAL LETTER SOFT SIGN +042D;A # CYRILLIC CAPITAL LETTER E +042E;A # CYRILLIC CAPITAL LETTER YU +042F;A # CYRILLIC CAPITAL LETTER YA +0430;A # CYRILLIC SMALL LETTER A +0431;A # CYRILLIC SMALL LETTER BE +0432;A # CYRILLIC SMALL LETTER VE +0433;A # CYRILLIC SMALL LETTER GHE +0434;A # CYRILLIC SMALL LETTER DE +0435;A # CYRILLIC SMALL LETTER IE +0436;A # CYRILLIC SMALL LETTER ZHE +0437;A # CYRILLIC SMALL LETTER ZE +0438;A # CYRILLIC SMALL LETTER I +0439;A # CYRILLIC SMALL LETTER SHORT I +043A;A # CYRILLIC SMALL LETTER KA +043B;A # CYRILLIC SMALL LETTER EL +043C;A # CYRILLIC SMALL LETTER EM +043D;A # CYRILLIC SMALL LETTER EN +043E;A # CYRILLIC SMALL LETTER O +043F;A # CYRILLIC SMALL LETTER PE +0440;A # CYRILLIC SMALL LETTER ER +0441;A # CYRILLIC SMALL LETTER ES +0442;A # CYRILLIC SMALL LETTER TE +0443;A # CYRILLIC SMALL LETTER U +0444;A # CYRILLIC SMALL LETTER EF +0445;A # CYRILLIC SMALL LETTER HA +0446;A # CYRILLIC SMALL LETTER TSE +0447;A # CYRILLIC SMALL LETTER CHE +0448;A # CYRILLIC SMALL LETTER SHA +0449;A # CYRILLIC SMALL LETTER SHCHA +044A;A # CYRILLIC SMALL LETTER HARD SIGN +044B;A # CYRILLIC SMALL LETTER YERU +044C;A # CYRILLIC SMALL LETTER SOFT SIGN +044D;A # CYRILLIC SMALL LETTER E +044E;A # CYRILLIC SMALL LETTER YU +044F;A # CYRILLIC SMALL LETTER YA +0450;N # CYRILLIC SMALL LETTER IE WITH GRAVE +0451;A # CYRILLIC SMALL LETTER IO +0452;N # CYRILLIC SMALL LETTER DJE +0453;N # CYRILLIC SMALL LETTER GJE +0454;N # CYRILLIC SMALL LETTER UKRAINIAN IE +0455;N # CYRILLIC SMALL LETTER DZE +0456;N # CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I +0457;N # CYRILLIC SMALL LETTER YI +0458;N # CYRILLIC SMALL LETTER JE +0459;N # CYRILLIC SMALL LETTER LJE +045A;N # CYRILLIC SMALL LETTER NJE +045B;N # CYRILLIC SMALL LETTER TSHE +045C;N # CYRILLIC SMALL LETTER KJE +045D;N # CYRILLIC SMALL LETTER I WITH GRAVE +045E;N # CYRILLIC SMALL LETTER SHORT U +045F;N # CYRILLIC SMALL LETTER DZHE +0460;N # CYRILLIC CAPITAL LETTER OMEGA +0461;N # CYRILLIC SMALL LETTER OMEGA +0462;N # CYRILLIC CAPITAL LETTER YAT +0463;N # CYRILLIC SMALL LETTER YAT +0464;N # CYRILLIC CAPITAL LETTER IOTIFIED E +0465;N # CYRILLIC SMALL LETTER IOTIFIED E +0466;N # CYRILLIC CAPITAL LETTER LITTLE YUS +0467;N # CYRILLIC SMALL LETTER LITTLE YUS +0468;N # CYRILLIC CAPITAL LETTER IOTIFIED LITTLE YUS +0469;N # CYRILLIC SMALL LETTER IOTIFIED LITTLE YUS +046A;N # CYRILLIC CAPITAL LETTER BIG YUS +046B;N # CYRILLIC SMALL LETTER BIG YUS +046C;N # CYRILLIC CAPITAL LETTER IOTIFIED BIG YUS +046D;N # CYRILLIC SMALL LETTER IOTIFIED BIG YUS +046E;N # CYRILLIC CAPITAL LETTER KSI +046F;N # CYRILLIC SMALL LETTER KSI +0470;N # CYRILLIC CAPITAL LETTER PSI +0471;N # CYRILLIC SMALL LETTER PSI +0472;N # CYRILLIC CAPITAL LETTER FITA +0473;N # CYRILLIC SMALL LETTER FITA +0474;N # CYRILLIC CAPITAL LETTER IZHITSA +0475;N # CYRILLIC SMALL LETTER IZHITSA +0476;N # CYRILLIC CAPITAL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT +0477;N # CYRILLIC SMALL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT +0478;N # CYRILLIC CAPITAL LETTER UK +0479;N # CYRILLIC SMALL LETTER UK +047A;N # CYRILLIC CAPITAL LETTER ROUND OMEGA +047B;N # CYRILLIC SMALL LETTER ROUND OMEGA +047C;N # CYRILLIC CAPITAL LETTER OMEGA WITH TITLO +047D;N # CYRILLIC SMALL LETTER OMEGA WITH TITLO +047E;N # CYRILLIC CAPITAL LETTER OT +047F;N # CYRILLIC SMALL LETTER OT +0480;N # CYRILLIC CAPITAL LETTER KOPPA +0481;N # CYRILLIC SMALL LETTER KOPPA +0482;N # CYRILLIC THOUSANDS SIGN +0483;N # COMBINING CYRILLIC TITLO +0484;N # COMBINING CYRILLIC PALATALIZATION +0485;N # COMBINING CYRILLIC DASIA PNEUMATA +0486;N # COMBINING CYRILLIC PSILI PNEUMATA +0488;N # COMBINING CYRILLIC HUNDRED THOUSANDS SIGN +0489;N # COMBINING CYRILLIC MILLIONS SIGN +048A;N # CYRILLIC CAPITAL LETTER SHORT I WITH TAIL +048B;N # CYRILLIC SMALL LETTER SHORT I WITH TAIL +048C;N # CYRILLIC CAPITAL LETTER SEMISOFT SIGN +048D;N # CYRILLIC SMALL LETTER SEMISOFT SIGN +048E;N # CYRILLIC CAPITAL LETTER ER WITH TICK +048F;N # CYRILLIC SMALL LETTER ER WITH TICK +0490;N # CYRILLIC CAPITAL LETTER GHE WITH UPTURN +0491;N # CYRILLIC SMALL LETTER GHE WITH UPTURN +0492;N # CYRILLIC CAPITAL LETTER GHE WITH STROKE +0493;N # CYRILLIC SMALL LETTER GHE WITH STROKE +0494;N # CYRILLIC CAPITAL LETTER GHE WITH MIDDLE HOOK +0495;N # CYRILLIC SMALL LETTER GHE WITH MIDDLE HOOK +0496;N # CYRILLIC CAPITAL LETTER ZHE WITH DESCENDER +0497;N # CYRILLIC SMALL LETTER ZHE WITH DESCENDER +0498;N # CYRILLIC CAPITAL LETTER ZE WITH DESCENDER +0499;N # CYRILLIC SMALL LETTER ZE WITH DESCENDER +049A;N # CYRILLIC CAPITAL LETTER KA WITH DESCENDER +049B;N # CYRILLIC SMALL LETTER KA WITH DESCENDER +049C;N # CYRILLIC CAPITAL LETTER KA WITH VERTICAL STROKE +049D;N # CYRILLIC SMALL LETTER KA WITH VERTICAL STROKE +049E;N # CYRILLIC CAPITAL LETTER KA WITH STROKE +049F;N # CYRILLIC SMALL LETTER KA WITH STROKE +04A0;N # CYRILLIC CAPITAL LETTER BASHKIR KA +04A1;N # CYRILLIC SMALL LETTER BASHKIR KA +04A2;N # CYRILLIC CAPITAL LETTER EN WITH DESCENDER +04A3;N # CYRILLIC SMALL LETTER EN WITH DESCENDER +04A4;N # CYRILLIC CAPITAL LIGATURE EN GHE +04A5;N # CYRILLIC SMALL LIGATURE EN GHE +04A6;N # CYRILLIC CAPITAL LETTER PE WITH MIDDLE HOOK +04A7;N # CYRILLIC SMALL LETTER PE WITH MIDDLE HOOK +04A8;N # CYRILLIC CAPITAL LETTER ABKHASIAN HA +04A9;N # CYRILLIC SMALL LETTER ABKHASIAN HA +04AA;N # CYRILLIC CAPITAL LETTER ES WITH DESCENDER +04AB;N # CYRILLIC SMALL LETTER ES WITH DESCENDER +04AC;N # CYRILLIC CAPITAL LETTER TE WITH DESCENDER +04AD;N # CYRILLIC SMALL LETTER TE WITH DESCENDER +04AE;N # CYRILLIC CAPITAL LETTER STRAIGHT U +04AF;N # CYRILLIC SMALL LETTER STRAIGHT U +04B0;N # CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE +04B1;N # CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE +04B2;N # CYRILLIC CAPITAL LETTER HA WITH DESCENDER +04B3;N # CYRILLIC SMALL LETTER HA WITH DESCENDER +04B4;N # CYRILLIC CAPITAL LIGATURE TE TSE +04B5;N # CYRILLIC SMALL LIGATURE TE TSE +04B6;N # CYRILLIC CAPITAL LETTER CHE WITH DESCENDER +04B7;N # CYRILLIC SMALL LETTER CHE WITH DESCENDER +04B8;N # CYRILLIC CAPITAL LETTER CHE WITH VERTICAL STROKE +04B9;N # CYRILLIC SMALL LETTER CHE WITH VERTICAL STROKE +04BA;N # CYRILLIC CAPITAL LETTER SHHA +04BB;N # CYRILLIC SMALL LETTER SHHA +04BC;N # CYRILLIC CAPITAL LETTER ABKHASIAN CHE +04BD;N # CYRILLIC SMALL LETTER ABKHASIAN CHE +04BE;N # CYRILLIC CAPITAL LETTER ABKHASIAN CHE WITH DESCENDER +04BF;N # CYRILLIC SMALL LETTER ABKHASIAN CHE WITH DESCENDER +04C0;N # CYRILLIC LETTER PALOCHKA +04C1;N # CYRILLIC CAPITAL LETTER ZHE WITH BREVE +04C2;N # CYRILLIC SMALL LETTER ZHE WITH BREVE +04C3;N # CYRILLIC CAPITAL LETTER KA WITH HOOK +04C4;N # CYRILLIC SMALL LETTER KA WITH HOOK +04C5;N # CYRILLIC CAPITAL LETTER EL WITH TAIL +04C6;N # CYRILLIC SMALL LETTER EL WITH TAIL +04C7;N # CYRILLIC CAPITAL LETTER EN WITH HOOK +04C8;N # CYRILLIC SMALL LETTER EN WITH HOOK +04C9;N # CYRILLIC CAPITAL LETTER EN WITH TAIL +04CA;N # CYRILLIC SMALL LETTER EN WITH TAIL +04CB;N # CYRILLIC CAPITAL LETTER KHAKASSIAN CHE +04CC;N # CYRILLIC SMALL LETTER KHAKASSIAN CHE +04CD;N # CYRILLIC CAPITAL LETTER EM WITH TAIL +04CE;N # CYRILLIC SMALL LETTER EM WITH TAIL +04D0;N # CYRILLIC CAPITAL LETTER A WITH BREVE +04D1;N # CYRILLIC SMALL LETTER A WITH BREVE +04D2;N # CYRILLIC CAPITAL LETTER A WITH DIAERESIS +04D3;N # CYRILLIC SMALL LETTER A WITH DIAERESIS +04D4;N # CYRILLIC CAPITAL LIGATURE A IE +04D5;N # CYRILLIC SMALL LIGATURE A IE +04D6;N # CYRILLIC CAPITAL LETTER IE WITH BREVE +04D7;N # CYRILLIC SMALL LETTER IE WITH BREVE +04D8;N # CYRILLIC CAPITAL LETTER SCHWA +04D9;N # CYRILLIC SMALL LETTER SCHWA +04DA;N # CYRILLIC CAPITAL LETTER SCHWA WITH DIAERESIS +04DB;N # CYRILLIC SMALL LETTER SCHWA WITH DIAERESIS +04DC;N # CYRILLIC CAPITAL LETTER ZHE WITH DIAERESIS +04DD;N # CYRILLIC SMALL LETTER ZHE WITH DIAERESIS +04DE;N # CYRILLIC CAPITAL LETTER ZE WITH DIAERESIS +04DF;N # CYRILLIC SMALL LETTER ZE WITH DIAERESIS +04E0;N # CYRILLIC CAPITAL LETTER ABKHASIAN DZE +04E1;N # CYRILLIC SMALL LETTER ABKHASIAN DZE +04E2;N # CYRILLIC CAPITAL LETTER I WITH MACRON +04E3;N # CYRILLIC SMALL LETTER I WITH MACRON +04E4;N # CYRILLIC CAPITAL LETTER I WITH DIAERESIS +04E5;N # CYRILLIC SMALL LETTER I WITH DIAERESIS +04E6;N # CYRILLIC CAPITAL LETTER O WITH DIAERESIS +04E7;N # CYRILLIC SMALL LETTER O WITH DIAERESIS +04E8;N # CYRILLIC CAPITAL LETTER BARRED O +04E9;N # CYRILLIC SMALL LETTER BARRED O +04EA;N # CYRILLIC CAPITAL LETTER BARRED O WITH DIAERESIS +04EB;N # CYRILLIC SMALL LETTER BARRED O WITH DIAERESIS +04EC;N # CYRILLIC CAPITAL LETTER E WITH DIAERESIS +04ED;N # CYRILLIC SMALL LETTER E WITH DIAERESIS +04EE;N # CYRILLIC CAPITAL LETTER U WITH MACRON +04EF;N # CYRILLIC SMALL LETTER U WITH MACRON +04F0;N # CYRILLIC CAPITAL LETTER U WITH DIAERESIS +04F1;N # CYRILLIC SMALL LETTER U WITH DIAERESIS +04F2;N # CYRILLIC CAPITAL LETTER U WITH DOUBLE ACUTE +04F3;N # CYRILLIC SMALL LETTER U WITH DOUBLE ACUTE +04F4;N # CYRILLIC CAPITAL LETTER CHE WITH DIAERESIS +04F5;N # CYRILLIC SMALL LETTER CHE WITH DIAERESIS +04F6;N # CYRILLIC CAPITAL LETTER GHE WITH DESCENDER +04F7;N # CYRILLIC SMALL LETTER GHE WITH DESCENDER +04F8;N # CYRILLIC CAPITAL LETTER YERU WITH DIAERESIS +04F9;N # CYRILLIC SMALL LETTER YERU WITH DIAERESIS +0500;N # CYRILLIC CAPITAL LETTER KOMI DE +0501;N # CYRILLIC SMALL LETTER KOMI DE +0502;N # CYRILLIC CAPITAL LETTER KOMI DJE +0503;N # CYRILLIC SMALL LETTER KOMI DJE +0504;N # CYRILLIC CAPITAL LETTER KOMI ZJE +0505;N # CYRILLIC SMALL LETTER KOMI ZJE +0506;N # CYRILLIC CAPITAL LETTER KOMI DZJE +0507;N # CYRILLIC SMALL LETTER KOMI DZJE +0508;N # CYRILLIC CAPITAL LETTER KOMI LJE +0509;N # CYRILLIC SMALL LETTER KOMI LJE +050A;N # CYRILLIC CAPITAL LETTER KOMI NJE +050B;N # CYRILLIC SMALL LETTER KOMI NJE +050C;N # CYRILLIC CAPITAL LETTER KOMI SJE +050D;N # CYRILLIC SMALL LETTER KOMI SJE +050E;N # CYRILLIC CAPITAL LETTER KOMI TJE +050F;N # CYRILLIC SMALL LETTER KOMI TJE +0531;N # ARMENIAN CAPITAL LETTER AYB +0532;N # ARMENIAN CAPITAL LETTER BEN +0533;N # ARMENIAN CAPITAL LETTER GIM +0534;N # ARMENIAN CAPITAL LETTER DA +0535;N # ARMENIAN CAPITAL LETTER ECH +0536;N # ARMENIAN CAPITAL LETTER ZA +0537;N # ARMENIAN CAPITAL LETTER EH +0538;N # ARMENIAN CAPITAL LETTER ET +0539;N # ARMENIAN CAPITAL LETTER TO +053A;N # ARMENIAN CAPITAL LETTER ZHE +053B;N # ARMENIAN CAPITAL LETTER INI +053C;N # ARMENIAN CAPITAL LETTER LIWN +053D;N # ARMENIAN CAPITAL LETTER XEH +053E;N # ARMENIAN CAPITAL LETTER CA +053F;N # ARMENIAN CAPITAL LETTER KEN +0540;N # ARMENIAN CAPITAL LETTER HO +0541;N # ARMENIAN CAPITAL LETTER JA +0542;N # ARMENIAN CAPITAL LETTER GHAD +0543;N # ARMENIAN CAPITAL LETTER CHEH +0544;N # ARMENIAN CAPITAL LETTER MEN +0545;N # ARMENIAN CAPITAL LETTER YI +0546;N # ARMENIAN CAPITAL LETTER NOW +0547;N # ARMENIAN CAPITAL LETTER SHA +0548;N # ARMENIAN CAPITAL LETTER VO +0549;N # ARMENIAN CAPITAL LETTER CHA +054A;N # ARMENIAN CAPITAL LETTER PEH +054B;N # ARMENIAN CAPITAL LETTER JHEH +054C;N # ARMENIAN CAPITAL LETTER RA +054D;N # ARMENIAN CAPITAL LETTER SEH +054E;N # ARMENIAN CAPITAL LETTER VEW +054F;N # ARMENIAN CAPITAL LETTER TIWN +0550;N # ARMENIAN CAPITAL LETTER REH +0551;N # ARMENIAN CAPITAL LETTER CO +0552;N # ARMENIAN CAPITAL LETTER YIWN +0553;N # ARMENIAN CAPITAL LETTER PIWR +0554;N # ARMENIAN CAPITAL LETTER KEH +0555;N # ARMENIAN CAPITAL LETTER OH +0556;N # ARMENIAN CAPITAL LETTER FEH +0559;N # ARMENIAN MODIFIER LETTER LEFT HALF RING +055A;N # ARMENIAN APOSTROPHE +055B;N # ARMENIAN EMPHASIS MARK +055C;N # ARMENIAN EXCLAMATION MARK +055D;N # ARMENIAN COMMA +055E;N # ARMENIAN QUESTION MARK +055F;N # ARMENIAN ABBREVIATION MARK +0561;N # ARMENIAN SMALL LETTER AYB +0562;N # ARMENIAN SMALL LETTER BEN +0563;N # ARMENIAN SMALL LETTER GIM +0564;N # ARMENIAN SMALL LETTER DA +0565;N # ARMENIAN SMALL LETTER ECH +0566;N # ARMENIAN SMALL LETTER ZA +0567;N # ARMENIAN SMALL LETTER EH +0568;N # ARMENIAN SMALL LETTER ET +0569;N # ARMENIAN SMALL LETTER TO +056A;N # ARMENIAN SMALL LETTER ZHE +056B;N # ARMENIAN SMALL LETTER INI +056C;N # ARMENIAN SMALL LETTER LIWN +056D;N # ARMENIAN SMALL LETTER XEH +056E;N # ARMENIAN SMALL LETTER CA +056F;N # ARMENIAN SMALL LETTER KEN +0570;N # ARMENIAN SMALL LETTER HO +0571;N # ARMENIAN SMALL LETTER JA +0572;N # ARMENIAN SMALL LETTER GHAD +0573;N # ARMENIAN SMALL LETTER CHEH +0574;N # ARMENIAN SMALL LETTER MEN +0575;N # ARMENIAN SMALL LETTER YI +0576;N # ARMENIAN SMALL LETTER NOW +0577;N # ARMENIAN SMALL LETTER SHA +0578;N # ARMENIAN SMALL LETTER VO +0579;N # ARMENIAN SMALL LETTER CHA +057A;N # ARMENIAN SMALL LETTER PEH +057B;N # ARMENIAN SMALL LETTER JHEH +057C;N # ARMENIAN SMALL LETTER RA +057D;N # ARMENIAN SMALL LETTER SEH +057E;N # ARMENIAN SMALL LETTER VEW +057F;N # ARMENIAN SMALL LETTER TIWN +0580;N # ARMENIAN SMALL LETTER REH +0581;N # ARMENIAN SMALL LETTER CO +0582;N # ARMENIAN SMALL LETTER YIWN +0583;N # ARMENIAN SMALL LETTER PIWR +0584;N # ARMENIAN SMALL LETTER KEH +0585;N # ARMENIAN SMALL LETTER OH +0586;N # ARMENIAN SMALL LETTER FEH +0587;N # ARMENIAN SMALL LIGATURE ECH YIWN +0589;N # ARMENIAN FULL STOP +058A;N # ARMENIAN HYPHEN +0591;N # HEBREW ACCENT ETNAHTA +0592;N # HEBREW ACCENT SEGOL +0593;N # HEBREW ACCENT SHALSHELET +0594;N # HEBREW ACCENT ZAQEF QATAN +0595;N # HEBREW ACCENT ZAQEF GADOL +0596;N # HEBREW ACCENT TIPEHA +0597;N # HEBREW ACCENT REVIA +0598;N # HEBREW ACCENT ZARQA +0599;N # HEBREW ACCENT PASHTA +059A;N # HEBREW ACCENT YETIV +059B;N # HEBREW ACCENT TEVIR +059C;N # HEBREW ACCENT GERESH +059D;N # HEBREW ACCENT GERESH MUQDAM +059E;N # HEBREW ACCENT GERSHAYIM +059F;N # HEBREW ACCENT QARNEY PARA +05A0;N # HEBREW ACCENT TELISHA GEDOLA +05A1;N # HEBREW ACCENT PAZER +05A2;N # HEBREW ACCENT ATNAH HAFUKH +05A3;N # HEBREW ACCENT MUNAH +05A4;N # HEBREW ACCENT MAHAPAKH +05A5;N # HEBREW ACCENT MERKHA +05A6;N # HEBREW ACCENT MERKHA KEFULA +05A7;N # HEBREW ACCENT DARGA +05A8;N # HEBREW ACCENT QADMA +05A9;N # HEBREW ACCENT TELISHA QETANA +05AA;N # HEBREW ACCENT YERAH BEN YOMO +05AB;N # HEBREW ACCENT OLE +05AC;N # HEBREW ACCENT ILUY +05AD;N # HEBREW ACCENT DEHI +05AE;N # HEBREW ACCENT ZINOR +05AF;N # HEBREW MARK MASORA CIRCLE +05B0;N # HEBREW POINT SHEVA +05B1;N # HEBREW POINT HATAF SEGOL +05B2;N # HEBREW POINT HATAF PATAH +05B3;N # HEBREW POINT HATAF QAMATS +05B4;N # HEBREW POINT HIRIQ +05B5;N # HEBREW POINT TSERE +05B6;N # HEBREW POINT SEGOL +05B7;N # HEBREW POINT PATAH +05B8;N # HEBREW POINT QAMATS +05B9;N # HEBREW POINT HOLAM +05BB;N # HEBREW POINT QUBUTS +05BC;N # HEBREW POINT DAGESH OR MAPIQ +05BD;N # HEBREW POINT METEG +05BE;N # HEBREW PUNCTUATION MAQAF +05BF;N # HEBREW POINT RAFE +05C0;N # HEBREW PUNCTUATION PASEQ +05C1;N # HEBREW POINT SHIN DOT +05C2;N # HEBREW POINT SIN DOT +05C3;N # HEBREW PUNCTUATION SOF PASUQ +05C4;N # HEBREW MARK UPPER DOT +05C5;N # HEBREW MARK LOWER DOT +05C6;N # HEBREW PUNCTUATION NUN HAFUKHA +05C7;N # HEBREW POINT QAMATS QATAN +05D0;N # HEBREW LETTER ALEF +05D1;N # HEBREW LETTER BET +05D2;N # HEBREW LETTER GIMEL +05D3;N # HEBREW LETTER DALET +05D4;N # HEBREW LETTER HE +05D5;N # HEBREW LETTER VAV +05D6;N # HEBREW LETTER ZAYIN +05D7;N # HEBREW LETTER HET +05D8;N # HEBREW LETTER TET +05D9;N # HEBREW LETTER YOD +05DA;N # HEBREW LETTER FINAL KAF +05DB;N # HEBREW LETTER KAF +05DC;N # HEBREW LETTER LAMED +05DD;N # HEBREW LETTER FINAL MEM +05DE;N # HEBREW LETTER MEM +05DF;N # HEBREW LETTER FINAL NUN +05E0;N # HEBREW LETTER NUN +05E1;N # HEBREW LETTER SAMEKH +05E2;N # HEBREW LETTER AYIN +05E3;N # HEBREW LETTER FINAL PE +05E4;N # HEBREW LETTER PE +05E5;N # HEBREW LETTER FINAL TSADI +05E6;N # HEBREW LETTER TSADI +05E7;N # HEBREW LETTER QOF +05E8;N # HEBREW LETTER RESH +05E9;N # HEBREW LETTER SHIN +05EA;N # HEBREW LETTER TAV +05F0;N # HEBREW LIGATURE YIDDISH DOUBLE VAV +05F1;N # HEBREW LIGATURE YIDDISH VAV YOD +05F2;N # HEBREW LIGATURE YIDDISH DOUBLE YOD +05F3;N # HEBREW PUNCTUATION GERESH +05F4;N # HEBREW PUNCTUATION GERSHAYIM +0600;N # ARABIC NUMBER SIGN +0601;N # ARABIC SIGN SANAH +0602;N # ARABIC FOOTNOTE MARKER +0603;N # ARABIC SIGN SAFHA +060B;N # AFGHANI SIGN +060C;N # ARABIC COMMA +060D;N # ARABIC DATE SEPARATOR +060E;N # ARABIC POETIC VERSE SIGN +060F;N # ARABIC SIGN MISRA +0610;N # ARABIC SIGN SALLALLAHOU ALAYHE WASSALLAM +0611;N # ARABIC SIGN ALAYHE ASSALLAM +0612;N # ARABIC SIGN RAHMATULLAH ALAYHE +0613;N # ARABIC SIGN RADI ALLAHOU ANHU +0614;N # ARABIC SIGN TAKHALLUS +0615;N # ARABIC SMALL HIGH TAH +061B;N # ARABIC SEMICOLON +061E;N # ARABIC TRIPLE DOT PUNCTUATION MARK +061F;N # ARABIC QUESTION MARK +0621;N # ARABIC LETTER HAMZA +0622;N # ARABIC LETTER ALEF WITH ... [truncated message content] |
From: <th...@us...> - 2008-08-29 23:46:00
|
Revision: 5273 http://jython.svn.sourceforge.net/jython/?rev=5273&view=rev Author: thobes Date: 2008-08-29 23:45:59 +0000 (Fri, 29 Aug 2008) Log Message: ----------- Initialized merge tracking via "svnmerge" with revisions "1-4899" from https://jython.svn.sourceforge.net/svnroot/jython/trunk/jython Hopefully this will make it possible to merge in changes from both asm and trunk to the advanced branch. Property Changed: ---------------- branches/advanced/ Property changes on: branches/advanced ___________________________________________________________________ Modified: svnmerge-integrated - /branches/asm:1-4928 + /branches/asm:1-4928 /trunk/jython:1-4899 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <th...@us...> - 2008-08-29 21:59:56
|
Revision: 5272 http://jython.svn.sourceforge.net/jython/?rev=5272&view=rev Author: thobes Date: 2008-08-29 21:59:51 +0000 (Fri, 29 Aug 2008) Log Message: ----------- Committing a large portion of code to the advanced compiler project. The advanced compiler is mostly outlined, there quite a few implementation details to complete, but I have a good idea and direction for implementing these. Further details on content, direction and status of the project can be found in BRANCH.txt Modified Paths: -------------- branches/advanced/.classpath branches/advanced/BRANCH.txt branches/advanced/Lib/_ast.py branches/advanced/build.xml branches/advanced/src/org/python/antlr/Visitor.java branches/advanced/src/org/python/compiler/Future.java branches/advanced/src/org/python/core/CompilerFacade.java branches/advanced/src/org/python/core/FutureFeature.java branches/advanced/src/org/python/core/Py.java branches/advanced/src/org/python/core/PyEllipsis.java branches/advanced/src/org/python/core/PyNone.java branches/advanced/src/org/python/core/PyNotImplemented.java branches/advanced/src/org/python/core/PythonCompiler.java Added Paths: ----------- branches/advanced/compiler/org/python/code/ArgumentParser.java branches/advanced/compiler/org/python/compiler/AdvancedCompiler.java branches/advanced/compiler/org/python/compiler/AdvancedPreferences.java branches/advanced/compiler/org/python/compiler/CodeGenerator.java branches/advanced/compiler/org/python/compiler/CompilerDirector.java branches/advanced/compiler/org/python/compiler/ConstantChecker.java branches/advanced/compiler/org/python/compiler/ConstraintsDefinition.java branches/advanced/compiler/org/python/compiler/FlowGraphBundle.java branches/advanced/compiler/org/python/compiler/FlowGraphGenerator.java branches/advanced/compiler/org/python/compiler/GeneratedCodeState.java branches/advanced/compiler/org/python/compiler/IntermediateCodeGenerator.java branches/advanced/compiler/org/python/compiler/IntermediateCodeGeneratorFactory.java branches/advanced/compiler/org/python/compiler/PragmaParser.java branches/advanced/compiler/org/python/compiler/ScopeBuilder.java branches/advanced/compiler/org/python/compiler/ScopeFactory.java branches/advanced/compiler/org/python/compiler/ScopeInformation.java branches/advanced/compiler/org/python/compiler/ScopesBuilder.java branches/advanced/compiler/org/python/compiler/SyntaxErrorPolicy.java branches/advanced/compiler/org/python/compiler/flowgraph/ branches/advanced/compiler/org/python/compiler/flowgraph/Block.java branches/advanced/compiler/org/python/compiler/flowgraph/CodeGraph.java branches/advanced/compiler/org/python/compiler/flowgraph/Constant.java branches/advanced/compiler/org/python/compiler/flowgraph/FilteredGraph.java branches/advanced/compiler/org/python/compiler/flowgraph/IfGroup.java branches/advanced/compiler/org/python/compiler/flowgraph/Link.java branches/advanced/compiler/org/python/compiler/flowgraph/LinkGroup.java branches/advanced/compiler/org/python/compiler/flowgraph/LoopGroup.java branches/advanced/compiler/org/python/compiler/flowgraph/SuperBlock.java branches/advanced/compiler/org/python/compiler/flowgraph/Transformer.java branches/advanced/compiler/org/python/compiler/flowgraph/TryFinallyGroup.java branches/advanced/compiler/org/python/compiler/flowgraph/ValueOperation.java branches/advanced/compiler/org/python/compiler/flowgraph/Variable.java branches/advanced/compiler/org/python/compiler/flowgraph/VoidOperation.java branches/advanced/src/org/python/compiler/LegacyCompiler.java branches/advanced/src/org/python/core/Pragma.java branches/advanced/src/org/python/core/PragmaReceiver.java branches/advanced/src/org/python/core/PythonCodeBundle.java Modified: branches/advanced/.classpath =================================================================== --- branches/advanced/.classpath 2008-08-29 21:08:52 UTC (rev 5271) +++ branches/advanced/.classpath 2008-08-29 21:59:51 UTC (rev 5272) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="lib" path="build/exposed"/> - <classpathentry excluding="com/ziclix/python/sql/handler/InformixDataHandler.java|com/ziclix/python/sql/handler/OracleDataHandler.java|org/python/compiler/TentativeCompiler.java" kind="src" output="build/classes" path="src"/> + <classpathentry excluding="com/ziclix/python/sql/handler/InformixDataHandler.java|com/ziclix/python/sql/handler/OracleDataHandler.java|org/python/compiler/TentativeCompiler.java|org/python/util/MultipleEnumSet.java" kind="src" output="build/classes" path="src"/> <classpathentry kind="src" output="build/classes" path="build/gensrc"/> <classpathentry kind="src" output="build/classes" path="tests/java"/> <classpathentry kind="src" path="bugtests/classes"/> Modified: branches/advanced/BRANCH.txt =================================================================== --- branches/advanced/BRANCH.txt 2008-08-29 21:08:52 UTC (rev 5271) +++ branches/advanced/BRANCH.txt 2008-08-29 21:59:51 UTC (rev 5272) @@ -2,4 +2,89 @@ ======================== The advanced compiler is a project that strives to add an optimizing, advanced -compiler to Jython. \ No newline at end of file +compiler to Jython. + +The content of this branch: + [Most of the code relevant for the advanced compiler package is in the + compiler source directory, only minor modifications has been made in the + src source directory] + * org.python.compiler.bytecode and org.python.bytecode + The first approach for implementing the Advanced compiler, an abstraction + utilizing Python Bytecode as an API and a model for generating and + transforming code before handing it over to the JVM. + This prooved to be too hard to work with in terms of modeling aspects + important for performance on the JVM. + This could still be useful for the ability to import pbc files to Jython, + as made possible during Summer of Code 2007. It might also be useful for + implementing dynamic evaluation of Python code in environments where + it is not possible to generate and load Java byte code, such as in + restricted environments (for example applets) or on other platforms, + such as Android. + * org.python.compiler.advanced + The second attempt at implementing the Advanced compiler, or at least the + API part of it. + This suffered from trying to be too general, extensible and decoupled. + It was a good experience though. + * org.python.compiler.flowgrah + The third and current implementation of the Advanced compiler. + Using a flow graph as an intermediate representation. + The code for generating the flow graph is in the org.python.compiler package. + The state of this implementation is: + * The guts of the flow graph representation has not been implemented yet, + it is at an API design stage. + * The code for generating the data flow of the flow graph has been + implemented. Although it might have to be refactored when the internals + of the flow graph is implemented, since that might imply some API changes. + * The code for generating the control flow of the flow graph is being + implemented. It started out as being a simple flow between arbitrary + blocks in the graph, but it turns out that there will be some gain in + having the flow graph be built from graph patterns. This lead to quite a + large refactoring of the control flow aspects of the flow graph API. + * The code for annotating the flow graph and for turning the flow graph into + Java bytecode is only at an "ideas on a piece of paper" stage at the + moment. + +The flow of the compiler will be: + Step 1. Parse the source text and build an abstract syntax tree. + This is already implemented, the advanced compiler uses the same AST as + the legacy compiler. + * Optionally any AST transformations that the user has added to the compiler + will be applied after step 1. + Step 2. Verify AST constraints and build up information about the scopes. + This has been mostly implemented, but some pieces of the representation + of the scope information data structure is still under development. + The AST verification adds constraints that are expensive to apply in the + parsing step. Such as scope rules, restricted values, illegal combinations + of nodes and such things. + Step 3. Transform the AST to a flow graph representation. + This is being implemented, see above. + * Optionally apply any flow graph transformations here. + These transformations will typically be type annotations and optimizations. + For this a transformation API for the flow graph is required, this will be + designed when the first transformations are implemented. It will need to + have good support for things such as inlining, loop unrolling and + code substitution. This is where it makes a large difference to have the + controll flow of the flow graph be built from a set of graph patterns + instead of an arbitrary flow structure. + Step 4. Generate target code (Java byte code) from the flow graph. + This has not been implemented yet, see above. + +Annother aspect that needs to be implemeted is serialization of the flow graph, +this is needed to enable reloading it at runtime and specialize it given the +runtime data types. This would be a Python aware pre-JIT optimizer (the JVM +JIT is good, but it can get a lot of help from a layer of language awareness). +Serializability has been in mind when designing the flow graph representation, +but it has not been the main focus. +These optimizations could be more agressive than the once in the transformation +step in between steps 3 and 4, but would use the same API. Perhaps triggers +could be added in the "static transformation" to alert the runtime system when +certain optimizations might be applicable in the "JIT transformation" step. + +A summary of the things left to do (in chronological order): + * Design the control flow aspect of the flow graph API. + * Finish the flow graph generation given the control flow API. + * Implement the internals of the flow graph. + * Implement byte code generation from the flow graph. + * Implement transformations of the flow graph. +Here the advanced compiler will be working. After this comes the just in time +re-compilation project. Modified: branches/advanced/Lib/_ast.py =================================================================== --- branches/advanced/Lib/_ast.py 2008-08-29 21:08:52 UTC (rev 5271) +++ branches/advanced/Lib/_ast.py 2008-08-29 21:59:51 UTC (rev 5272) @@ -2,7 +2,7 @@ from org.python.antlr.ast.operatorType import Add,Sub,Mult,Div,FloorDiv,Mod,LShift,RShift,BitOr,BitAnd,BitXor,Pow from org.python.antlr.ast.cmpopType import Eq,Gt,GtE,In,Is,IsNot,Lt,LtE,NotEq,NotIn from org.python.antlr.ast.unaryopType import Invert,Not,UAdd,USub -from org.python.core.PyTableCode import PyCF_ONLY_AST +from org.python.core.CompilerFlags import PyCF_ONLY_AST from org.python.antlr.ast.expr_contextType import Load, Store, Del, AugLoad, AugStore, Param from org.python.antlr import AST Modified: branches/advanced/build.xml =================================================================== --- branches/advanced/build.xml 2008-08-29 21:08:52 UTC (rev 5271) +++ branches/advanced/build.xml 2008-08-29 21:59:51 UTC (rev 5272) @@ -480,6 +480,7 @@ <src path="${interpreter.source.dir}"/> <exclude name="org/python/parser/python.java" /> + <exclude name="**/MultipleEnumSet.java" /> <exclude name="**/handler/InformixDataHandler.java" unless="informix.present" /> <exclude name="**/handler/OracleDataHandler.java" unless="oracle.present" /> <classpath refid="main.classpath" /> Added: branches/advanced/compiler/org/python/code/ArgumentParser.java =================================================================== --- branches/advanced/compiler/org/python/code/ArgumentParser.java (rev 0) +++ branches/advanced/compiler/org/python/code/ArgumentParser.java 2008-08-29 21:59:51 UTC (rev 5272) @@ -0,0 +1,48 @@ +package org.python.code; + +import java.util.LinkedList; +import java.util.List; + +import org.python.core.PyDictionary; +import org.python.core.PyObject; +import org.python.core.PyTuple; + +/** + * Work in progress: an outline for an argument parser based on a perfect hash. + * + * @author Tobias Ivarsson + */ +public class ArgumentParser { + + public static PyObject[] parse(ArgumentParser spec, PyObject[] arguments, + String[] keywords, PyObject star, PyDictionary starstar) { + PyObject[] result = new PyObject[totalArgSize(spec)]; + List<PyObject> stararg; + PyDictionary kwstararg; + if (spec.has_kwstararg) { + kwstararg = spec.has_kwstararg ? new PyDictionary() : null; + result[result.length - 1] = kwstararg; + } + + stararg = spec.has_stararg ? new LinkedList<PyObject>() : null; + + if (stararg != null) { + PyObject[] elements = new PyObject[stararg.size()]; + elements = stararg.toArray(elements); + result[result.length - (1 + (spec.has_kwstararg ? 1 : 0))] = new PyTuple( + elements); + } + return result; + } + + private int argcount; + private boolean has_stararg; + private boolean has_kwstararg; + private int positionalonlycount; + + private static int totalArgSize(ArgumentParser spec) { + return spec.argcount + (spec.has_stararg ? 1 : 0) + + spec.positionalonlycount + (spec.has_kwstararg ? 1 : 0); + } + +} Added: branches/advanced/compiler/org/python/compiler/AdvancedCompiler.java =================================================================== --- branches/advanced/compiler/org/python/compiler/AdvancedCompiler.java (rev 0) +++ branches/advanced/compiler/org/python/compiler/AdvancedCompiler.java 2008-08-29 21:59:51 UTC (rev 5272) @@ -0,0 +1,73 @@ +package org.python.compiler; + +import java.util.HashMap; +import java.util.Map; + +import org.python.antlr.PythonTree; +import org.python.antlr.ast.Module; +import org.python.antlr.ast.VisitorBase; +import org.python.antlr.ast.VisitorIF; +import org.python.antlr.ast.modType; +import org.python.compiler.flowgraph.Transformer; +import org.python.compiler.flowgraph.Variable; +import org.python.core.CompilerFlags; +import org.python.core.ParserFacade; +import org.python.core.PythonCodeBundle; +import org.python.core.PythonCompiler; + +public class AdvancedCompiler implements PythonCompiler { + + private VisitorIF<?> astTransformer; + private final Transformer flowgraphTransformations = null; // TODO + private final AdvancedPreferences preferences = null; + private final CodeGenerator codegen = new CodeGenerator() { + // This depends on the preferences + }; + + public PythonCodeBundle compile(modType node, String name, String filename, + boolean linenumbers, boolean printResults, boolean setFile, + CompilerFlags cflags) throws Exception { + if (astTransformer != null) { + node.accept(astTransformer); + } + FlowGraphBundle bundle = new FlowGraphBundle(name, filename); + CompilerDirector.compile(bundle, preferences, cflags, linenumbers, + printResults, setFile, node); + bundle.acceptTransformations(flowgraphTransformations); + return bundle.generateCode(codegen); + } + + public static Map<PythonTree, ScopeInformation> test(String source) throws Exception { + return testScopeAnalyzer(ParserFacade.parse(source, "exec")); + } + + private static Map<PythonTree, ScopeInformation> testScopeAnalyzer( + PythonTree parse) throws Exception { + return parse.accept(new VisitorBase<Map<PythonTree, ScopeInformation>>() { + + @Override + public void traverse(PythonTree node) throws Exception { + } + + @Override + protected Map<PythonTree, ScopeInformation> unhandled_node( + PythonTree node) throws Exception { + return null; + } + + @Override + public Map<PythonTree, ScopeInformation> visitModule(Module node) + throws Exception { + FlowGraphBundle bundle = new FlowGraphBundle("data", "data.fil"); + Map<PythonTree, ScopeInformation> scopes = new HashMap<PythonTree, ScopeInformation>(); + ScopeInformation scope = ScopesBuilder.scan( + new SyntaxErrorPolicy.ErrorCollectingPolicy(), null, + new HashMap<String, ConstantChecker<Variable>>(), + scopes, bundle, node.body); + scopes.put(node, scope); + return scopes; + } + }); + } + +} Added: branches/advanced/compiler/org/python/compiler/AdvancedPreferences.java =================================================================== --- branches/advanced/compiler/org/python/compiler/AdvancedPreferences.java (rev 0) +++ branches/advanced/compiler/org/python/compiler/AdvancedPreferences.java 2008-08-29 21:59:51 UTC (rev 5272) @@ -0,0 +1,121 @@ +package org.python.compiler; + +import java.util.Map; + +import org.python.antlr.ast.Name; +import org.python.antlr.ast.Num; +import org.python.antlr.ast.exprType; +import org.python.compiler.flowgraph.CodeGraph; +import org.python.compiler.flowgraph.Variable; +import org.python.core.CompilerFlags; +import org.python.core.Py; + +public class AdvancedPreferences implements ConstraintsDefinition<Variable> { + + private interface Setting<T> { + + } + + private enum Booleans implements Setting<Boolean> { + BOOLEAN_CONSTANTS, CORE_CONSTANTS + + } + + private enum Strings implements Setting<String> { + + } + + private enum Numbers implements Setting<Number> { + + } + + private enum Constant implements ConstantChecker<Variable> { + NONE { + + @Override + public boolean acceptValue(exprType value) { + return (value instanceof Name) + && ((Name) value).id.equals("None"); + } + + @Override + public Variable getConstantValue() { + return CodeGraph.None(); + } + }, + ELLIPSIS { + + @Override + public boolean acceptValue(exprType value) { + return (value instanceof Name) + && ((Name) value).id.equals("Ellipsis"); + } + + @Override + public Variable getConstantValue() { + return CodeGraph.Ellipsis(); + } + }, + TRUE { + + @Override + public boolean acceptValue(exprType value) { + if (value instanceof Num) { + Num num = (Num) value; + return num.equals(1) || num.equals(Py.newInteger(1)); + } else if (value instanceof Name) { + Name name = (Name) value; + return name.id.equals("True"); + } + return false; + } + + @Override + public Variable getConstantValue() { + return CodeGraph.True(); + } + }, + FALSE { + + @Override + public boolean acceptValue(exprType value) { + if (value instanceof Num) { + Num num = (Num) value; + return num.equals(0) || num.equals(Py.newInteger(0)); + } else if (value instanceof Name) { + Name name = (Name) value; + return name.id.equals("False"); + } + return false; + } + + @Override + public Variable getConstantValue() { + return CodeGraph.False(); + } + }; + + public abstract boolean acceptValue(exprType value); + + public abstract Variable getConstantValue(); + + } + + private <T> T getSetting(Setting<T> boolean_constants, CompilerFlags flags) { + // TODO Auto-generated method stub + return null; + } + + public void update(CompilerFlags flags, + Map<String, ConstantChecker<Variable>> constNames) { + // TODO + if (getSetting(Booleans.CORE_CONSTANTS, flags)) { + constNames.put("None", Constant.NONE); + } + if (getSetting(Booleans.BOOLEAN_CONSTANTS, flags)) { + constNames.put("True", Constant.TRUE); + constNames.put("False", Constant.FALSE); + } + } + +} Added: branches/advanced/compiler/org/python/compiler/CodeGenerator.java =================================================================== --- branches/advanced/compiler/org/python/compiler/CodeGenerator.java (rev 0) +++ branches/advanced/compiler/org/python/compiler/CodeGenerator.java 2008-08-29 21:59:51 UTC (rev 5272) @@ -0,0 +1,10 @@ +package org.python.compiler; + +/** + * Generates executable code from the Intermediate Representation. + * + * @author Tobias Ivarsson + */ +interface CodeGenerator { + +} Added: branches/advanced/compiler/org/python/compiler/CompilerDirector.java =================================================================== --- branches/advanced/compiler/org/python/compiler/CompilerDirector.java (rev 0) +++ branches/advanced/compiler/org/python/compiler/CompilerDirector.java 2008-08-29 21:59:51 UTC (rev 5272) @@ -0,0 +1,177 @@ +package org.python.compiler; + +import java.util.HashMap; +import java.util.Map; + +import org.python.antlr.PythonTree; +import org.python.antlr.ast.ClassDef; +import org.python.antlr.ast.Expression; +import org.python.antlr.ast.FunctionDef; +import org.python.antlr.ast.GeneratorExp; +import org.python.antlr.ast.Interactive; +import org.python.antlr.ast.Lambda; +import org.python.antlr.ast.Return; +import org.python.antlr.ast.VisitorBase; +import org.python.antlr.ast.modType; +import org.python.antlr.ast.stmtType; +import org.python.core.CompilerFlags; +import org.python.core.FutureFeature; + +class CompilerDirector<E, S, H> extends VisitorBase<E> { + + private static final PragmaParser interactivePragmas = new PragmaParser( + FutureFeature.PRAGMA_MODULE); + private static final PragmaParser modulePragmas = new PragmaParser( + FutureFeature.PRAGMA_MODULE); + private final CompilerFlags flags; + private final SyntaxErrorPolicy errorPolicy = null; + private final Map<PythonTree, S> scopes = new HashMap<PythonTree, S>(); + private IntermediateCodeGenerator<E, S, H> codegen; + private final boolean printResults; + private final boolean linenumbers; // TODO + private final boolean setFile; // TODO + private final IntermediateCodeGeneratorFactory<E, S, H> factory; + private final ConstraintsDefinition<E> constraints; + private final Map<String, ConstantChecker<E>> constNames = new HashMap<String, ConstantChecker<E>>(); + + public static <E, S, H> void compile( + IntermediateCodeGeneratorFactory<E, S, H> factory, + ConstraintsDefinition<E> constraints, CompilerFlags cflags, + boolean linenumbers, boolean printResults, boolean setFile, + modType base) throws Exception { + base.accept(new CompilerDirector<E, S, H>(factory, constraints, cflags, + linenumbers, printResults, setFile)); + } + + private CompilerDirector(IntermediateCodeGeneratorFactory<E, S, H> factory, + ConstraintsDefinition<E> constraints, CompilerFlags cflags, + boolean linenumbers, boolean printResults, boolean setFile) { + this.factory = factory; + this.constraints = constraints; + this.printResults = printResults; + this.linenumbers = linenumbers; + this.setFile = setFile; + // TODO copy the compiler flags + flags = new CompilerFlags(); + } + + @Override + public void traverse(PythonTree node) throws Exception { + // Don't do anything, the traversal is handled by the code generator + } + + @Override + protected E unhandled_node(PythonTree node) throws Exception { + // Not explicitly handled by this? then it has to be handled by the code generator + return node.accept(codegen); + } + + // Top level elements - initialize the compiler + + @Override + public E visitModule(org.python.antlr.ast.Module node) throws Exception { + compile(modulePragmas, false, node.body); + return null; + } + + @Override + public E visitInteractive(Interactive node) throws Exception { + compile(interactivePragmas, printResults, node.body); + return null; + } + + @Override + public E visitExpression(Expression node) throws Exception { + compile(null, false, new Return(node, node.body)); + return null; + } + + private void compile(PragmaParser pragmas, boolean printResults, + stmtType... body) throws Exception { + if (pragmas != null) { + pragmas.parse(body, flags); + } + constraints.update(flags, constNames); + S scope = ScopesBuilder.scan(errorPolicy, pragmas, constNames, scopes, + factory, body); + IntermediateCodeGenerator<E, S, H> old = codegen; + try { + // TODO: pass on the flags as well... + codegen = factory.createCodeGenerator(printResults, constNames, + this, scope); + for (stmtType stmt : body) { + stmt.accept(this); + } + } finally { + codegen = old; + } + } + + // Scope defining elements + + @Override + public E visitClassDef(ClassDef node) throws Exception { + S scope = scopes.get(node); + H state = codegen.beforeClassDef(node, scope); + IntermediateCodeGenerator<E, S, H> old = codegen; + E result; + try { + codegen = factory.createCodeGenerator(false, constNames, this, + scope); + result = codegen.visitClassDef(node); + } finally { + codegen = old; + } + codegen.afterClassDef(node, state, result); + return result; + } + + @Override + public E visitFunctionDef(FunctionDef node) throws Exception { + S scope = scopes.get(node); + H state = codegen.beforeFunctionDef(node, scope); + IntermediateCodeGenerator<E, S, H> old = codegen; + E result; + try { + codegen = factory.createCodeGenerator(false, constNames, this, + scope); + result = codegen.visitFunctionDef(node); + } finally { + codegen = old; + } + codegen.afterFunctionDef(node, state, result); + return result; + } + + @Override + public E visitLambda(Lambda node) throws Exception { + S scope = scopes.get(node); + H state = codegen.beforeLambda(node, scope); + IntermediateCodeGenerator<E, S, H> old = codegen; + E result; + try { + codegen = factory.createCodeGenerator(false, constNames, this, + scope); + result = codegen.visitLambda(node); + } finally { + codegen = old; + } + return codegen.afterLambda(node, state, result); + } + + @Override + public E visitGeneratorExp(GeneratorExp node) throws Exception { + S scope = scopes.get(node); + H state = codegen.beforeGeneratorExp(node, scope); + IntermediateCodeGenerator<E, S, H> old = codegen; + E result; + try { + codegen = factory.createCodeGenerator(false, constNames, this, + scope); + result = codegen.visitGeneratorExp(node); + } finally { + codegen = old; + } + return codegen.afterGeneratorExp(node, state, result); + } +} \ No newline at end of file Added: branches/advanced/compiler/org/python/compiler/ConstantChecker.java =================================================================== --- branches/advanced/compiler/org/python/compiler/ConstantChecker.java (rev 0) +++ branches/advanced/compiler/org/python/compiler/ConstantChecker.java 2008-08-29 21:59:51 UTC (rev 5272) @@ -0,0 +1,11 @@ +package org.python.compiler; + +import org.python.antlr.ast.exprType; + +public interface ConstantChecker<T> { + + boolean acceptValue(exprType value); + + T getConstantValue(); + +} Added: branches/advanced/compiler/org/python/compiler/ConstraintsDefinition.java =================================================================== --- branches/advanced/compiler/org/python/compiler/ConstraintsDefinition.java (rev 0) +++ branches/advanced/compiler/org/python/compiler/ConstraintsDefinition.java 2008-08-29 21:59:51 UTC (rev 5272) @@ -0,0 +1,11 @@ +package org.python.compiler; + +import java.util.Map; + +import org.python.core.CompilerFlags; + +interface ConstraintsDefinition<E> { + + void update(CompilerFlags flags, Map<String, ConstantChecker<E>> constNames); + +} Added: branches/advanced/compiler/org/python/compiler/FlowGraphBundle.java =================================================================== --- branches/advanced/compiler/org/python/compiler/FlowGraphBundle.java (rev 0) +++ branches/advanced/compiler/org/python/compiler/FlowGraphBundle.java 2008-08-29 21:59:51 UTC (rev 5272) @@ -0,0 +1,71 @@ +package org.python.compiler; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.python.antlr.ast.VisitorIF; +import org.python.compiler.flowgraph.CodeGraph; +import org.python.compiler.flowgraph.Transformer; +import org.python.compiler.flowgraph.Variable; +import org.python.core.PythonCodeBundle; + +/** + * Represents the super graph of a compilation unit. + * + * @author Tobias Ivarsson + */ +final class FlowGraphBundle + implements + IntermediateCodeGeneratorFactory<Variable, ScopeInformation, GeneratedCodeState> { + + private final String name; + private final String filename; + private final Map<Object, Variable> constantPool = new HashMap<Object, Variable>(); + + public FlowGraphBundle(String name, String filename) { + this.name = name; + this.filename = filename; + } + + void acceptTransformations(Transformer transformer) { + // TODO Auto-generated method stub + + } + + PythonCodeBundle generateCode(CodeGenerator codegen) { + return null; + } + + public IntermediateCodeGenerator<Variable, ScopeInformation, GeneratedCodeState> createCodeGenerator( + boolean printExpr, + Map<String, ConstantChecker<Variable>> constants, + VisitorIF<Variable> driver, ScopeInformation scope) { + CodeGraph graph = new CodeGraph(); + return new FlowGraphGenerator(printExpr, driver, constants, graph); + } + + public ScopeInformation createClass(String name, String[] locals, + String[] explicitlyGlobal, String[] explicitlyClosure, + String[] free, String[] scopeRequired, boolean hasStarImport, + List<ScopeInformation> children) { + return ScopeInformation.makeClassScope(name, locals, explicitlyGlobal, + explicitlyClosure, free, scopeRequired, hasStarImport, children); + } + + public ScopeInformation createFunction(String name, String[] parameters, + String[] locals, String[] explicitlyGlobal, + String[] explicitlyClosure, String[] free, String[] scopeRequired, + boolean isGenerator, boolean hasStarImport, + List<ScopeInformation> children) { + return ScopeInformation.makeFunctionScope(name, parameters, locals, + explicitlyGlobal, explicitlyClosure, free, scopeRequired, + isGenerator, hasStarImport, children); + } + + public ScopeInformation createGlobal(String[] locals, String[] cell, + boolean hasStarImport, List<ScopeInformation> children) { + return ScopeInformation.makeGlobalScope(locals, cell, hasStarImport, + children); + } +} Added: branches/advanced/compiler/org/python/compiler/FlowGraphGenerator.java =================================================================== --- branches/advanced/compiler/org/python/compiler/FlowGraphGenerator.java (rev 0) +++ branches/advanced/compiler/org/python/compiler/FlowGraphGenerator.java 2008-08-29 21:59:51 UTC (rev 5272) @@ -0,0 +1,1030 @@ +package org.python.compiler; + +import java.util.Collections; +import java.util.EnumMap; +import java.util.LinkedList; +import java.util.Map; +import java.util.Stack; +import java.util.Vector; + +import org.python.antlr.ParseException; +import org.python.antlr.PythonTree; +import org.python.antlr.ast.Assert; +import org.python.antlr.ast.Assign; +import org.python.antlr.ast.Attribute; +import org.python.antlr.ast.AugAssign; +import org.python.antlr.ast.BinOp; +import org.python.antlr.ast.BoolOp; +import org.python.antlr.ast.Break; +import org.python.antlr.ast.Call; +import org.python.antlr.ast.ClassDef; +import org.python.antlr.ast.Compare; +import org.python.antlr.ast.Continue; +import org.python.antlr.ast.Delete; +import org.python.antlr.ast.Dict; +import org.python.antlr.ast.Ellipsis; +import org.python.antlr.ast.Exec; +import org.python.antlr.ast.Expr; +import org.python.antlr.ast.ExtSlice; +import org.python.antlr.ast.For; +import org.python.antlr.ast.FunctionDef; +import org.python.antlr.ast.GeneratorExp; +import org.python.antlr.ast.Global; +import org.python.antlr.ast.If; +import org.python.antlr.ast.IfExp; +import org.python.antlr.ast.Import; +import org.python.antlr.ast.ImportFrom; +import org.python.antlr.ast.Index; +import org.python.antlr.ast.Lambda; +import org.python.antlr.ast.List; +import org.python.antlr.ast.ListComp; +import org.python.antlr.ast.Name; +import org.python.antlr.ast.Num; +import org.python.antlr.ast.Pass; +import org.python.antlr.ast.Print; +import org.python.antlr.ast.Raise; +import org.python.antlr.ast.Repr; +import org.python.antlr.ast.Return; +import org.python.antlr.ast.Slice; +import org.python.antlr.ast.Str; +import org.python.antlr.ast.Subscript; +import org.python.antlr.ast.Suite; +import org.python.antlr.ast.TryExcept; +import org.python.antlr.ast.TryFinally; +import org.python.antlr.ast.Tuple; +import org.python.antlr.ast.UnaryOp; +import org.python.antlr.ast.Unicode; +import org.python.antlr.ast.VisitorBase; +import org.python.antlr.ast.VisitorIF; +import org.python.antlr.ast.While; +import org.python.antlr.ast.With; +import org.python.antlr.ast.Yield; +import org.python.antlr.ast.aliasType; +import org.python.antlr.ast.cmpopType; +import org.python.antlr.ast.comprehensionType; +import org.python.antlr.ast.exprType; +import org.python.antlr.ast.operatorType; +import org.python.antlr.ast.sliceType; +import org.python.antlr.ast.stmtType; +import org.python.antlr.ast.unaryopType; +import org.python.compiler.flowgraph.Block; +import org.python.compiler.flowgraph.CodeGraph; +import org.python.compiler.flowgraph.Link; +import org.python.compiler.flowgraph.LinkGroup; +import org.python.compiler.flowgraph.ValueOperation; +import org.python.compiler.flowgraph.Variable; +import org.python.compiler.flowgraph.VoidOperation; + +/** + * @author Tobias Ivarsson + */ +public class FlowGraphGenerator extends VisitorBase<Variable> + implements + IntermediateCodeGenerator<Variable, ScopeInformation, GeneratedCodeState> { + + private static class BreakAction { + + private final Block onBreak; + private final Block onContinue; + private final LinkGroup loop; + + public BreakAction(LinkGroup loop, Block onBreak, Block onContinue) { + this.loop = loop; + this.onBreak = onBreak; + this.onContinue = onContinue; + } + + } + + //private final CompilerDirector<Variable, ScopeInformation, GeneratedCodeState> compiler; + private final VisitorIF<Variable> compiler; + private final CodeGraph graph; + private final boolean printResult; + private Block block; + private final Map<String, ConstantChecker<Variable>> constants; + private final Stack<BreakAction> breakStack = new Stack<BreakAction>(); + private static final Map<operatorType, ValueOperation> binaryOperators; + static { + Map<operatorType, ValueOperation> ops = new EnumMap<operatorType, ValueOperation>( + operatorType.class); + ops.put(operatorType.Add, ValueOperation.ADD); + ops.put(operatorType.Sub, ValueOperation.SUBTRACT); + ops.put(operatorType.Mult, ValueOperation.MULTIPLY); + ops.put(operatorType.Div, ValueOperation.TRUE_DIVIDE); + ops.put(operatorType.Mod, ValueOperation.MODULO); + ops.put(operatorType.Pow, ValueOperation.POWER); + ops.put(operatorType.LShift, ValueOperation.SHIFT_LEFT); + ops.put(operatorType.RShift, ValueOperation.SHIFT_RIGHT); + ops.put(operatorType.BitOr, ValueOperation.OR); + ops.put(operatorType.BitXor, ValueOperation.XOR); + ops.put(operatorType.BitAnd, ValueOperation.AND); + ops.put(operatorType.FloorDiv, ValueOperation.FLOOR_DIVIDE); + binaryOperators = Collections.unmodifiableMap(ops); + } + private static final Map<operatorType, ValueOperation> augOperators; + static { + Map<operatorType, ValueOperation> ops = new EnumMap<operatorType, ValueOperation>( + operatorType.class); + ops.put(operatorType.Add, ValueOperation.AUG_ADD); + ops.put(operatorType.Sub, ValueOperation.AUG_SUBTRACT); + ops.put(operatorType.Mult, ValueOperation.AUG_MULTIPLY); + ops.put(operatorType.Div, ValueOperation.AUG_TRUE_DIVIDE); + ops.put(operatorType.Mod, ValueOperation.AUG_MODULO); + ops.put(operatorType.Pow, ValueOperation.AUG_POWER); + ops.put(operatorType.LShift, ValueOperation.AUG_SHIFT_LEFT); + ops.put(operatorType.RShift, ValueOperation.AUG_SHIFT_RIGHT); + ops.put(operatorType.BitOr, ValueOperation.AUG_OR); + ops.put(operatorType.BitXor, ValueOperation.AUG_XOR); + ops.put(operatorType.BitAnd, ValueOperation.AUG_AND); + ops.put(operatorType.FloorDiv, ValueOperation.AUG_FLOOR_DIVIDE); + augOperators = Collections.unmodifiableMap(ops); + } + private static final Map<unaryopType, ValueOperation> unaryOperators; + static { + Map<unaryopType, ValueOperation> ops = new EnumMap<unaryopType, ValueOperation>( + unaryopType.class); + ops.put(unaryopType.Invert, ValueOperation.INVERT); + ops.put(unaryopType.Not, ValueOperation.NOT); + ops.put(unaryopType.UAdd, ValueOperation.POSITIVE); + ops.put(unaryopType.USub, ValueOperation.NEGATIVE); + unaryOperators = ops; + } + private static final Map<cmpopType, ValueOperation> comparators; + static { + Map<cmpopType, ValueOperation> ops = new EnumMap<cmpopType, ValueOperation>( + cmpopType.class); + ops.put(cmpopType.Eq, ValueOperation.EQUAL); + ops.put(cmpopType.NotEq, ValueOperation.NOT_EQUAL); + ops.put(cmpopType.Lt, ValueOperation.LESS_THAN); + ops.put(cmpopType.LtE, ValueOperation.LESS_THAN_OR_EQUAL_TO); + ops.put(cmpopType.Gt, ValueOperation.GREATER_THAN); + ops.put(cmpopType.GtE, ValueOperation.GREATER_THAN_OR_EQUAL_TO); + ops.put(cmpopType.Is, ValueOperation.IS); + ops.put(cmpopType.IsNot, ValueOperation.IS_NOT); + ops.put(cmpopType.In, ValueOperation.CONTAINED_IN); + ops.put(cmpopType.NotIn, ValueOperation.NOT_CONTAINED_IN); + comparators = Collections.unmodifiableMap(ops); + } + + /** + * @param compiler + * @param constants + * @param graph + */ + public FlowGraphGenerator(VisitorIF<Variable> compiler, + Map<String, ConstantChecker<Variable>> constants, CodeGraph graph) { + this(false, compiler, constants, graph); + } + + /** + * @param printResult + * @param compiler + * @param constants + * @param graph + */ + public FlowGraphGenerator(boolean printResult, + VisitorIF<Variable> compiler, + Map<String, ConstantChecker<Variable>> constants, CodeGraph graph) { + this.printResult = printResult; + this.compiler = compiler; + this.constants = constants; + this.graph = graph; + } + + // Handle undefined + + @Override + public void traverse(PythonTree node) throws Exception { + // Delegate to the director + node.traverse(compiler); + } + + @Override + protected Variable unhandled_node(PythonTree node) throws Exception { + throw new ParseException("Cannot generate code for " + + node.getClass().getName(), node); + } + + // Helper method + + private Variable loadClosure(ScopeInformation scope) { + java.util.List<Variable> freeVars = new LinkedList<Variable>(); + for (String free : scope.freeVariables()) { + freeVars.add(graph.getVariable(free)); + } + Variable[] closure = freeVars.toArray(new Variable[] {}); + return block.valueOperation(ValueOperation.MAKE_ARRAY, closure); + } + + private Variable loadDefaults(exprType[] defaults) throws Exception { + Variable[] vars = evalAll(defaults); + return block.valueOperation(ValueOperation.MAKE_ARRAY, vars); + } + + private Variable[] loadDecorators(exprType[] decorators) throws Exception { + Variable[] loaded = evalAll(decorators); + // reverse the result, decorators are declared and loaded top-down, + // but applied bottom-up + Variable[] result = new Variable[loaded.length]; + for (int i = 0; i < loaded.length; i--) { + result[result.length - i] = loaded[i]; + } + return result; + } + + private Variable applyDecorators(Variable target, Variable[] decorators) { + if (decorators == null || decorators.length == 0) { + return target; + } + for (Variable decorator : decorators) { + target = block.valueOperation(ValueOperation.CALL, decorator, + target); + } + return target; + } + + private Variable eval(exprType value, Variable... preserve) + throws Exception { + return value.accept(this); + } + + private Variable eval(sliceType slice, Variable... preserve) + throws Exception { + return slice.accept(this); + } + + private Variable[] evalAll(exprType... values) throws Exception { + Variable[] result = new Variable[values.length]; + for (int i = 0; i < values.length; i++) { + result[i] = eval(values[i], result); + } + return result; + } + + private void compile(stmtType... body) throws Exception { + for (stmtType stmt : body) { + stmt.accept(compiler); + } + } + + private class Assignment extends VisitorBase<Void> { + + private final Variable value; + + Assignment(Variable value) { + this.value = value; + } + + @Override + public void traverse(PythonTree node) throws Exception { + } + + @Override + protected Void unhandled_node(PythonTree node) throws Exception { + throw new IllegalArgumentException("Cannot assign to " + + node.getClass().getName()); + } + + @Override + public Void visitName(Name node) throws Exception { + block.voidOperation(VoidOperation.STORE, + graph.getVariable(node.id), value); + return null; + } + + private void tupleAssign(exprType[] elts) throws Exception { + int before = -1, after = 0; + for (exprType elt : elts) { + if (false /*elt instanceof Starred*/) { + // For 3.0 compatibility, where one can have starred targets + if (before == -1) { + before = after; + after = 0; + } else { + throw new ParseException( + "more than one starred expressions in assignment", + elt); + } + } else { + after++; + } + } + Variable unpacked; + if (before != -1) { + unpacked = block.valueOperation(ValueOperation.UNPACK, value, + graph.getConstant(before), graph.getConstant(after)); + } else { + unpacked = block.valueOperation(ValueOperation.UNPACK, value, + graph.getConstant(after)); + } + int i = 0; + if (before != -1) { + for (; i < before; i++) { + Variable value = block.valueOperation( + ValueOperation.ARRAY_GET, unpacked, + graph.getConstant(i)); + elts[i].accept(new Assignment(value)); + } + Variable value = block.valueOperation(ValueOperation.ARRAY_GET, + unpacked, graph.getConstant(i)); + elts[i++]/* TODO: cast elts[i++] to Starred */ + /* and pick out the value element */.accept(new Assignment( + value)); + } + before += 1; // either this was -1, or we consumed the extra starred + for (; i < before + after; i++) { + Variable value = block.valueOperation(ValueOperation.ARRAY_GET, + unpacked, graph.getConstant(i)); + elts[i].accept(new Assignment(value)); + } + } + + @Override + public Void visitTuple(Tuple node) throws Exception { + tupleAssign(node.elts); + return null; + } + + @Override + public Void visitList(List node) throws Exception { + tupleAssign(node.elts); + return null; + } + + @Override + public Void visitDict(Dict node) throws Exception { + // Dictionary assignment is easy enough, once the syntax supports it + for (int i = 0; i < node.keys.length; i++) { + Variable key = eval(node.keys[i]); + Variable value = block.valueOperation( + ValueOperation.LOAD_ATTRIBUTE, this.value, key); + node.values[i].accept(new Assignment(value)); + } + return null; + } + + @Override + public Void visitAttribute(Attribute node) throws Exception { + Variable target = eval(node.value); + block.voidOperation(VoidOperation.STORE_ATTRIBUTE, target, + graph.getConstant(node.attr), value); + return null; + } + + @Override + public Void visitSubscript(Subscript node) throws Exception { + Variable target = eval(node.value); + Variable slice = eval(node.slice); + block.voidOperation(VoidOperation.STORE_ITEM, target, slice, value); + return null; + } + } + + private final VisitorIF<Void> delete = new VisitorBase<Void>() { + + @Override + public void traverse(PythonTree node) throws Exception { + } + + @Override + protected Void unhandled_node(PythonTree node) throws Exception { + throw new IllegalArgumentException("Cannot delete " + + node.getClass().getName()); + } + + @Override + public Void visitName(Name node) throws Exception { + block.voidOperation(VoidOperation.DELETE, + graph.getConstant(node.id)); + return null; + } + + @Override + public Void visitAttribute(Attribute node) throws Exception { + Variable target = eval(node.value); + block.voidOperation(VoidOperation.DELETE_ATTRIBUTE, target, + graph.getConstant(node.attr)); + return null; + } + + @Override + public Void visitSubscript(Subscript node) throws Exception { + Variable target = eval(node.value); + Variable slice = eval(node.slice); + block.voidOperation(VoidOperation.DELETE_ITEM, target, slice); + return null; + } + }; + + // -- Entry points -- + + // Class + + public GeneratedCodeState beforeClassDef(ClassDef node, + ScopeInformation scope) throws Exception { + Variable name = graph.getConstant(node.name); + Variable[] baseVars; + if (node.bases != null) { + baseVars = new Variable[node.bases.length]; + int i = 0; + for (exprType base : node.bases) { + baseVars[i] = base.accept(this); + } + } else { + baseVars = new Variable[0]; + } + Variable bases = block.valueOperation(ValueOperation.MAKE_ARRAY, + baseVars); + return new GeneratedCodeState(name, bases, loadClosure(scope), + new Variable[] {}); + } + + @Override + public Variable visitClassDef(ClassDef node) throws Exception { + block = graph.entryBlock(); + for (stmtType stmt : node.body) { + stmt.accept(compiler); + } + return graph.handle(); + } + + public void afterClassDef(ClassDef node, GeneratedCodeState state, + Variable result) throws Exception { + Variable dict = block.valueOperation(ValueOperation.CALL_CODE, result, + state.classClosure()); + Variable klass = block.valueOperation(ValueOperation.DEFINE_CLASS, + state.name(), state.classBases(), dict); + klass = applyDecorators(klass, state.decorators()); + block.voidOperation(VoidOperation.STORE, state.name(), klass); + } + + // Function + + public GeneratedCodeState beforeFunctionDef(FunctionDef node, + ScopeInformation scope) throws Exception { + Variable name = graph.getConstant(node.name); + Variable[] decorators = loadDecorators(node.decorators); + return new GeneratedCodeState(name, loadClosure(scope), + loadDefaults(node.args.defaults), decorators); + } + + @Override + public Variable visitFunctionDef(FunctionDef node) throws Exception { + block = graph.entryBlock(); + for (stmtType stmt : node.body) { + stmt.accept(compiler); + } + return graph.handle(); + } + + public void afterFunctionDef(FunctionDef node, GeneratedCodeState state, + Variable result) throws Exception { + Variable function = block.valueOperation(ValueOperation.MAKE_FUNCTION, + result, state.funcClosure(), state.funcDefaults()); + function = applyDecorators(function, state.decorators()); + block.voidOperation(VoidOperation.STORE, state.name(), function); + } + + // Lambda + + public GeneratedCodeState beforeLambda(Lambda node, ScopeInformation scope) + throws Exception { + return new GeneratedCodeState(null, loadClosure(scope), + loadDefaults(node.args.defaults)); + } + + @Override + public Variable visitLambda(Lambda node) throws Exception { + block = graph.entryBlock(); + block.returnOperation(node.body.accept(compiler)); + return graph.handle(); + } + + public Variable afterLambda(Lambda node, GeneratedCodeState state, + Variable result) throws Exception { + return block.valueOperation(ValueOperation.MAKE_FUNCTION, result, + state.funcClosure(), state.funcDefaults()); + } + + // Generator + + public GeneratedCodeState beforeGeneratorExp(GeneratorExp node, + ScopeInformation scope) throws Exception { + Variable startArg = eval(node.generators[0].iter); + startArg = block.valueOperation(ValueOperation.GET_ITERATOR, startArg); + return new GeneratedCodeState(null, loadClosure(scope), startArg); + } + + @Override + public Variable visitGeneratorExp(GeneratorExp node) throws Exception { + block = graph.entryBlock(); + Variable iter = block.valueOperation(ValueOperation.LOAD, + graph.getArgument(0)); + unrollComprehension(node.elt, node.generators, block, iter, + graph.exitBlock(), new ComprehensionAction() { + @Override + Link perform(Variable var, Block current, Block next, + Variable... variables) { + return current.yieldOperation(var, next, variables); + } + }); + return graph.handle(); + } + + public Variable afterGeneratorExp(GeneratorExp node, + GeneratedCodeState state, Variable result) throws Exception { + return block.valueOperation(ValueOperation.CALL_CODE, result, + state.funcClosure(), state.generatorStartArg()); + } + + // Suite + + @Override + public Variable visitSuite(Suite node) throws Exception { + throw new ParseException("Cannot compile Suite without context.", node); + } + + // Loops + + private static abstract class ComprehensionAction { + /** + * @param var The variable that was the result of the comprehension + * expression. + * @param current The block where we enter. + * @param next The block we are supposed to continue to. + * @param variables The variables that should be carried onto the next + * block. + * @return the link from the current block to the next. + */ + abstract Link perform(Variable var, Block current, Block next, + Variable... variables); + } + + // FIXME: this is not completed... take inspiration from visitFor + private void unrollComprehension(exprType elt, + comprehensionType[] generators, Block start, Variable iter, + Block end, ComprehensionAction action) throws Exception { + Link fail = start.nextBlock(graph.exitBlock(), graph.None()); + Variable[] iterators = null; + for (comprehensionType comprehension : generators) { + if (iterators == null) { + iterators = new Variable[] { iter }; + } else { + Variable[] newIterators = new Variable[iterators.length + 1]; + System.arraycopy(iterators, 0, iterators, 0, iterators.length); + iterators = newIterators; + Variable iterVar = eval(comprehension.iter); + iter = block.valueOperation(ValueOperation.GET_ITERATOR, + iterVar); + iterators[iterators.length - 1] = iter; + } + block.iterNext(iter, fail, block = graph.newBlock(), iterators); + if (comprehension.ifs != null && comprehension.ifs.length != 0) { + for (exprType condition : comprehension.ifs) { + + } + } + } + } + + public Variable visitFor(For node) throws Exception { + LinkGroup loop = graph.newLoop(); + Variable iterator = eval(node.iter); + Variable iter = block.valueOperation(ValueOperation.GET_ITERATOR, + iterator); + Block head = newBlock(block, iter); + Block orelse; + Block done = newBlock(block); + if (node.orelse != null) { + orelse = newBlock(block); + } else { + orelse = done; + } + Block body = newBlock(block, iter); + Link entry = block.nextBlock(head, iter); + Link on_exhausted = head.nextBlock(orelse); + Link on_hasnext = head.iterNext(iter, on_exhausted, body, + new Variable[] {}); + // TODO: this should be the other way around, by utilizing SuperBlocks + loop.add(entry); + loop.add(on_exhausted); + loop.add(on_hasnext); + block = body; + breakStack.push(new BreakAction(loop, done, head)); + compile(node.body); + if (node.orelse != null) { + block = orelse; + compile(node.orelse); + } + block = done; + return null; + } + + private Block newBlock(Block template, Variable... variables) { + // TODO Auto-generated method stub + return null; + } + + public Variable visitWhile(While node) throws Exception { + // TODO Auto-generated method stub + return null; + } + + public Variable visitBreak(Break node) throws Exception { + // TODO Auto-generated method stub + return null; + } + + public Variable visitContinue(Continue node) throws Exception { + // TODO Auto-generated method stub + return null; + } + + @Override + public Variable visitListComp(ListComp node) throws Exception { + final Variable list = block.valueOperation(ValueOperation.MAKE_LIST); + Variable iterVal = eval(node.generators[0].iter); + Variable iter = block.valueOperation(ValueOperation.GET_ITERATOR, + iterVal); + Block after = graph.newBlock(); + unrollComprehension(node.elt, node.generators, block, iter, after, + new ComprehensionAction() { + @Override + Link perform(Variable var, Block location, Block next, + Variable... variables) { + location.voidOperation(VoidOperation.LIST_APPEND, list, + var); + return location.nextBlock(next, variables); + } + }); + block = after; + return list; + } + + // Selection + + public Variable visitIf(If node) throws Exception { + // TODO Auto-generated method stub + return null; + } + + public Variable visitIfExp(IfExp node) throws Exception { + // TODO Auto-generated method stub + return null; + } + + public Variable visitBoolOp(BoolOp node) throws Exception { + switch (node.op) { + case And: + // TODO + break; + case Or: + // TODO + break; + default: + throw new ParseException("Unknown boolean operation " + + node.op.name(), node); + } + return null; + } + + public Variable visitCompare(Compare node) throws Exception { + if (node.comparators.length == 1) { + Variable left = eval(node.left); + Variable comparator = eval(node.comparators[0]); + return block.valueOperation(comparators.get(node.ops[0]), left, + comparator); + } + // TODO Auto-generated method stub + return null; + } + + // Assignment + + @Override + public Variable visitAssign(Assign node) throws Exception { + Variable value = eval(node.value); + for (exprType target : node.targets) { + target.accept(new Assignment(value)); + } + return null; + } + + @Override + public Variable visitAugAssign(AugAssign node) throws Exception { + Variable target = eval(node.target); + Variable rhs = eval(node.value); + Variable value = block.valueOperation(augOperators.get(node.op), + target, rhs); + node.target.accept(new Assignment(value)); + return null; + } + + // Deletion + + @Override + public Variable visitDelete(Delete node) throws Exception { + node.traverse(delete); + return null; + } + + // Call + + @Override + public Variable visitCall(Call node) throws Exception { + Variable func = eval(node.func); + ... [truncated message content] |