GithubHelp home page GithubHelp logo

json-3's Introduction

QAQMiao's json parser.

This is a json parser.As we all know that json is a quite common data structure in developing. So this is my first project's focusing point.

what can my parser do?

This project can simply do such things :

  • load json files
  • load json strings
  • judge whether the parsing is successful or not

supported data types of json

  • json strings
  • json numbers
  • json booleans(true/false)
  • json objects
  • json arrays

Let's take a glance at some sample:

{
     "name" : "GaoBoyuan",
     "age" : 19,
     "sex" : "male",
     "handsome" : true,
     "girlfirend" : {
              "name" : "miaomiao",
              "sex" : "female",
              "age" : 20,
              "beautiful" : true,
              "hobby" : ["tv operas",1,"pc games","computer science","Roller skating","cou re nao"]
      },
      "hobby" : ["pc games","computer science","music"]
}

And the output is :

<node name="name" type="jsonString">GaoBoyuan</node>
<node name="age" type="jsonNumber">19</node>
<node name="sex" type="jsonString">male</node>
<node name="handsome" type="jsonBoolean">true</node>
<node name="girlfirend" type="jsonObject">
	<node name="name" type="jsonString">miaomiao</node>
	<node name="sex" type="jsonString">female</node>
	<node name="age" type="jsonNumber">20</node>
	<node name="beautiful" type="jsonBoolean">true</node>
	<node name="hobby" type="jsonArray">
		<elem index="0">
			<node name="" type="jsonString">tv operas</node>
		</elem>
		<elem index="1">
			<node name="" type="jsonNumber">1</node>
		</elem>
		<elem index="2">
			<node name="" type="jsonString">pc games</node>
		</elem>
		<elem index="3">
			<node name="" type="jsonString">computer science</node>
		</elem>
		<elem index="4">
			<node name="" type="jsonString">Roller skating</node>
		</elem>
		<elem index="5">
			<node name="" type="jsonString">cou re nao</node>
		</elem>
	</node>
</node>
<node name="hobby" type="jsonArray">
	<elem index="0">
		<node name="" type="jsonString">pc games</node>
	</elem>
	<elem index="1">
		<node name="" type="jsonString">computer science</node>
	</elem>
	<elem index="2">
		<node name="" type="jsonString">music</node>
	</elem>
</node>

####此版本暂时仅支持正确格式的json文件的解析 That's all.TKS.

json-3's People

Contributors

antimoron avatar qaqmiao avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.