Check-in [1a2220c9d7]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Base for class processing.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:1a2220c9d797f1f111fdef7085bd7d5280365b55
User & Date: stephanie.gawroriski 2019-01-12 01:18:22
Context
2019-01-12
08:02
Backup developer notes. check-in: 070ce424ca user: squirreljme tags: trunk
01:18
Base for class processing. check-in: 1a2220c9d7 user: stephanie.gawroriski tags: trunk
01:09
Load the class binary data; Base for exceptions. check-in: 1fab29f14a user: stephanie.gawroriski tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to runt/libs/summercoat-vm/cc/squirreljme/vm/summercoat/ClassLoader.java.

18
19
20
21
22
23
24


25
26
27
28
29
30
31
...
155
156
157
158
159
160
161













162
163
164
165
166
167
import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
import java.util.HashMap;
import java.util.Map;
import net.multiphasicapps.classfile.InvalidClassFormatException;
import net.multiphasicapps.classfile.ClassFile;
import net.multiphasicapps.classfile.ClassName;


import net.multiphasicapps.scrf.RegisterClass;

/**
 * This is a class loader which manages and can cache multiple classes.
 *
 * @since 2019/01/05
 */
................................................................................
					}
				
				// {@squirreljme.error AE03 Could not find the specified class.
				// (The name of the class)}
				if (cf == null || inlib == null)
					throw new VMClassNotFoundException("AE03 " + __n);
			}













			
			throw new todo.TODO();
		}
	}
}








>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>






18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
...
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
import java.util.HashMap;
import java.util.Map;
import net.multiphasicapps.classfile.InvalidClassFormatException;
import net.multiphasicapps.classfile.ClassFile;
import net.multiphasicapps.classfile.ClassName;
import net.multiphasicapps.scrf.compiler.ClassProcessException;
import net.multiphasicapps.scrf.compiler.ClassProcessor;
import net.multiphasicapps.scrf.RegisterClass;

/**
 * This is a class loader which manages and can cache multiple classes.
 *
 * @since 2019/01/05
 */
................................................................................
					}
				
				// {@squirreljme.error AE03 Could not find the specified class.
				// (The name of the class)}
				if (cf == null || inlib == null)
					throw new VMClassNotFoundException("AE03 " + __n);
			}
			
			// Process the class and compile it to the register format
			RegisterClass rc;
			try
			{
				rc = ClassProcessor.process(cf);
			}
			catch (ClassProcessException e)
			{
				// {@squirreljme.error AE06 The register compiler could not
				// process the input class. (The class)}
				throw new VMException("AE06 " + __n, e);
			}
			
			throw new todo.TODO();
		}
	}
}

Added runt/libs/tool-classfile-scrf-compiler/net/multiphasicapps/scrf/compiler/ClassProcessException.java.







































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf.compiler;

import net.multiphasicapps.classfile.InvalidClassFormatException;

/**
 * This is thrown when the class could not be processed due to an invalid
 * format or otherwise.
 *
 * @since 2019/01/11
 */
public class ClassProcessException
	extends InvalidClassFormatException
{
	/**
	 * Initialize the exception with no message or cause.
	 *
	 * @since 2019/01/11
	 */
	public ClassProcessException()
	{
	}
	
	/**
	 * Initialize the exception with a message and no cause.
	 *
	 * @param __m The message.
	 * @since 2019/01/11
	 */
	public ClassProcessException(String __m)
	{
		super(__m);
	}
	
	/**
	 * Initialize the exception with a message and cause.
	 *
	 * @param __m The message.
	 * @param __c The cause.
	 * @since 2019/01/11
	 */
	public ClassProcessException(String __m, Throwable __c)
	{
		super(__m, __c);
	}
	
	/**
	 * Initialize the exception with no message and with a cause.
	 *
	 * @param __c The cause.
	 * @since 2019/01/11
	 */
	public ClassProcessException(Throwable __c)
	{
		super(__c);
	}
}

Changes to runt/libs/tool-classfile-scrf-compiler/net/multiphasicapps/scrf/compiler/ClassProcessor.java.

7
8
9
10
11
12
13

14
15
16
17
18
19
20
21
22



23
24
25
26
27
28
29
30
31
32
33
34
35













36
37
38



39
















// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf.compiler;

import net.multiphasicapps.classfile.ClassFile;


/**
 * This is a processor which translates standard Java class files with their
 * structure and byte code to the SummerCoat Register Format.
 *
 * @since 2019/01/05
 */
public final class ClassProcessor
{



	/**
	 * Initializes the class processor.
	 *
	 * @param __cf The class file to process.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/01/05
	 */
	public ClassProcessor(ClassFile __cf)
		throws NullPointerException
	{
		if (__cf == null)
			throw new NullPointerException("NARG");
		













		throw new todo.TODO();
	}
}



























>









>
>
>







|





>
>
>
>
>
>
>
>
>
>
>
>
>


|
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf.compiler;

import net.multiphasicapps.classfile.ClassFile;
import net.multiphasicapps.scrf.RegisterClass;

/**
 * This is a processor which translates standard Java class files with their
 * structure and byte code to the SummerCoat Register Format.
 *
 * @since 2019/01/05
 */
public final class ClassProcessor
{
	/** The input class to process. */
	protected final ClassFile input;
	
	/**
	 * Initializes the class processor.
	 *
	 * @param __cf The class file to process.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/01/05
	 */
	private ClassProcessor(ClassFile __cf)
		throws NullPointerException
	{
		if (__cf == null)
			throw new NullPointerException("NARG");
		
		this.input = __cf;
	}
	
	/**
	 * Processes the input class.
	 *
	 * @return The resulting register class.
	 * @throws ClassProcessException If the class could not be processed.
	 * @since 2019/01/11
	 */
	public final RegisterClass process()
		throws ClassProcessException
	{
		throw new todo.TODO();
	}
	
	/**
	 * Processes the specified class file and compiles it to the register class
	 * format.
	 *
	 * @param __cf The class file to convert.
	 * @return The register class.
	 * @throws ClassProcessException If the class could not be processed.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/01/11
	 */
	public static final RegisterClass process(ClassFile __cf)
		throws ClassProcessException, NullPointerException
	{
		if (__cf == null)
			throw new NullPointerException("NARG");
		
		return new ClassProcessor(__cf).process();
	}
}