[Swift-user] NullPointerException

Andriy Fedorov fedorov at cs.wm.edu
Tue Aug 26 15:52:43 CDT 2008


Just to update the list on the resolution of this problem (thanks, Ben
Clifford!).

I was not supposed to have ";" at the end of the "foreach" construct:

foreach i in [0:numPoints-1] {
 ...
}    // <=== NO ";" HERE!!!

--
Andrey Fedorov


On Tue, Aug 26, 2008 at 4:10 PM, Ben Clifford <benc at hawaga.org.uk> wrote:
>
> something not right in the compiler - it should be either working or
> giving a more meaningful error message. can you send the source file that
> causes this?
>
> On Tue, 26 Aug 2008, Andriy Fedorov wrote:
>
>> On Tue, Aug 26, 2008 at 3:45 PM, Mihael Hategan <hategan at mcs.anl.gov> wrote:
>> > On Tue, 2008-08-26 at 15:29 -0400, Andriy Fedorov wrote:
>> >> Hi,
>> >>
>> >> Is there any advice on how I can debug the following error while
>> >> trying to run a Swift script:
>> >>
>> >> Could not compile SwiftScript source: java.lang.NullPointerException
>> >>
>> >> (this is the only error message I get)
>> >
>> > The -d flag to swift should provide more details (perhaps a stack
>> > trace).
>> >
>>
>> Yes, thanks. Still, no idea how to connect this error with my Swift source:
>>
>> Could not compile SwiftScript source: java.lang.NullPointerException
>> Full parser exception
>> java.lang.NullPointerException
>>         at org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:515)
>>         at org.antlr.stringtemplate.language.ASTExpr.writeAttribute(ASTExpr.java:458)
>>         at org.antlr.stringtemplate.language.ActionEvaluator.action(ActionEvaluator.java:86)
>>         at org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:93)
>>         at org.antlr.stringtemplate.StringTemplate.write(StringTemplate.java:693)
>>         at org.antlr.stringtemplate.StringTemplate.toString(StringTemplate.java:1412)
>>         at org.griphyn.vdl.toolkit.VDLt2VDLx.compile(VDLt2VDLx.java:64)
>>         at org.griphyn.vdl.toolkit.VDLt2VDLx.compile(VDLt2VDLx.java:46)
>>         at org.griphyn.vdl.karajan.Loader.compile(Loader.java:207)
>>         at org.griphyn.vdl.karajan.Loader.main(Loader.java:123)
>> Exception when compiling ../pe_script_500-1.swift
>> org.griphyn.vdl.toolkit.VDLt2VDLx$ParsingException: Could not compile
>> SwiftScript source: null
>>         at org.griphyn.vdl.toolkit.VDLt2VDLx.compile(VDLt2VDLx.java:68)
>>         at org.griphyn.vdl.toolkit.VDLt2VDLx.compile(VDLt2VDLx.java:46)
>>         at org.griphyn.vdl.karajan.Loader.compile(Loader.java:207)
>>         at org.griphyn.vdl.karajan.Loader.main(Loader.java:123)
>> Caused by:
>> java.lang.NullPointerException
>>         at org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:515)
>>         at org.antlr.stringtemplate.language.ASTExpr.writeAttribute(ASTExpr.java:458)
>>         at org.antlr.stringtemplate.language.ActionEvaluator.action(ActionEvaluator.java:86)
>>         at org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:93)
>>         at org.antlr.stringtemplate.StringTemplate.write(StringTemplate.java:693)
>>         at org.antlr.stringtemplate.StringTemplate.toString(StringTemplate.java:1412)
>>         at org.griphyn.vdl.toolkit.VDLt2VDLx.compile(VDLt2VDLx.java:64)
>>         ... 3 more
>>
>>
>> >
>> >
>> _______________________________________________
>> Swift-user mailing list
>> Swift-user at ci.uchicago.edu
>> http://mail.ci.uchicago.edu/mailman/listinfo/swift-user
>>
>>
>



More information about the Swift-user mailing list