From sethladd at gmail.com Wed May 17 09:58:09 2006 From: sethladd at gmail.com (Seth Ladd) Date: Wed, 17 May 2006 09:58:09 -1000 Subject: facade for Maps and Lists? Message-ID: <64f07e2c0605171258k724779h25dc65f51e53bc7c@mail.gmail.com> Hello, Just began my SDL journey as I couldn't find a good YAML parser for Java. :) One thing I like about the YAML parser is that it builds Maps and Lists. Has anyone created a facade for the SDL's Tag classes that exposes simply Maps and Lists? I'm looking for something like: Map config = (Map) CollectionsFacade.parseSDL("foo.sdl"); Before I go create this, I was hoping that this was already done in some fashion. Thanks! Seth From dan at ikayzo.com Wed May 17 15:12:06 2006 From: dan at ikayzo.com (Daniel Leuck) Date: Wed, 17 May 2006 15:12:06 -1000 Subject: facade for Maps and Lists? In-Reply-To: <64f07e2c0605171258k724779h25dc65f51e53bc7c@mail.gmail.com> Message-ID: Hi Seth, Yes. Its in the SDL standard download. List stuff = SDL.list("23 true 05:23:24 `hello` 34.12bd"); Map map = SDL.map("name=`Jose` height=1.8 smoker=false"); Dan > -----Original Message----- > From: Seth Ladd [mailto:sethladd at gmail.com] > Sent: Wednesday, May 17, 2006 9:58 AM > To: sdl-developers at ikayzo.org > Subject: facade for Maps and Lists? > > Hello, > > Just began my SDL journey as I couldn't find a good YAML parser for > Java. :) > > One thing I like about the YAML parser is that it builds Maps and > Lists. Has anyone created a facade for the SDL's Tag classes that > exposes simply Maps and Lists? > > I'm looking for something like: > > Map config = (Map) CollectionsFacade.parseSDL("foo.sdl"); > > Before I go create this, I was hoping that this was already done in > some fashion. > > Thanks! > Seth From sethladd at gmail.com Wed May 17 16:30:55 2006 From: sethladd at gmail.com (Seth Ladd) Date: Wed, 17 May 2006 16:30:55 -1000 Subject: facade for Maps and Lists? In-Reply-To: <446bc9e9.53819bb8.1dfa.ffff972aSMTPIN_ADDED@mx.gmail.com> References: <64f07e2c0605171258k724779h25dc65f51e53bc7c@mail.gmail.com> <446bc9e9.53819bb8.1dfa.ffff972aSMTPIN_ADDED@mx.gmail.com> Message-ID: <64f07e2c0605171930s63b4c32boec07074c0a287f65@mail.gmail.com> On 5/17/06, Daniel Leuck wrote: > Hi Seth, > > Yes. Its in the SDL standard download. > > List stuff = SDL.list("23 true 05:23:24 `hello` 34.12bd"); > Map map = SDL.map("name=`Jose` height=1.8 smoker=false"); Great! Will that work with something like: stuff { other_stuff { one 1 two 2 } } foo { bar "hello" } That is, if my SDL is a string with many maps in it? Thanks, Seth From dan at ikayzo.com Wed May 17 17:20:33 2006 From: dan at ikayzo.com (Daniel Leuck) Date: Wed, 17 May 2006 17:20:33 -1000 Subject: facade for Maps and Lists? In-Reply-To: <64f07e2c0605171930s63b4c32boec07074c0a287f65@mail.gmail.com> Message-ID: Hi Seth, In SDL, those structures are trees, so you would use the Tag API: // note - you can also use a reader or a String Tag root = new Tag("root").readFile(new File("/seths_file.sdl")); List children = root.getChildren(); for(Tag child:children) { System.out.println(child.getName()); } Would produce: stuff foo Dan > -----Original Message----- > From: Seth Ladd [mailto:sethladd at gmail.com] > Sent: Wednesday, May 17, 2006 4:31 PM > To: sdl-developers at ikayzo.org > Subject: Re: facade for Maps and Lists? > > On 5/17/06, Daniel Leuck wrote: > > Hi Seth, > > > > Yes. Its in the SDL standard download. > > > > List stuff = SDL.list("23 true 05:23:24 `hello` 34.12bd"); > > Map map = SDL.map("name=`Jose` height=1.8 smoker=false"); > > Great! Will that work with something like: > > stuff { > other_stuff { > one 1 > two 2 > } > } > foo { > bar "hello" > } > > That is, if my SDL is a string with many maps in it? > > Thanks, > Seth