1656390069
đź’ˇ this grammar is still in development, the structure of the generated AST is not stable
This repository contains a grammar for tree-sitter.
The goal of this project is to provide an parser efficient low-dependency parser for solidity which targets most solidity versions in use and is designed for enabling metaprogramming.
The primary file in this repository is grammar.js
which describes the tree-sitter grammar.
# Primary file:
grammar.js
# Tests:
/test/**/*
# Auto generated:
/src/**/*
index.js
binding.gyp
-> Ethereum solidity grammar:
-> Tree-sitter javascript grammar: https://github.com/tree-sitter/tree-sitter-javascript/blob/master/grammar.js
-> Solidity antlr grammar: https://github.com/ConsenSys/solidity-parser-antlr
Major inspriration & some structures have been taken from tree-sitter-javascript, a big thanks to the contributors to this repo!
Download Details:
Author: JoranHonig
Source Code: https://github.com/JoranHonig/tree-sitter-solidity
License: MIT license
#solidity #smartcontract #ethereum
1656390069
đź’ˇ this grammar is still in development, the structure of the generated AST is not stable
This repository contains a grammar for tree-sitter.
The goal of this project is to provide an parser efficient low-dependency parser for solidity which targets most solidity versions in use and is designed for enabling metaprogramming.
The primary file in this repository is grammar.js
which describes the tree-sitter grammar.
# Primary file:
grammar.js
# Tests:
/test/**/*
# Auto generated:
/src/**/*
index.js
binding.gyp
-> Ethereum solidity grammar:
-> Tree-sitter javascript grammar: https://github.com/tree-sitter/tree-sitter-javascript/blob/master/grammar.js
-> Solidity antlr grammar: https://github.com/ConsenSys/solidity-parser-antlr
Major inspriration & some structures have been taken from tree-sitter-javascript, a big thanks to the contributors to this repo!
Download Details:
Author: JoranHonig
Source Code: https://github.com/JoranHonig/tree-sitter-solidity
License: MIT license
#solidity #smartcontract #ethereum
1598227320
Given a Generic tree, the task is to delete the leaf nodes from the tree.
** Examples:**
Input:
5
/ / \ \
1 2 3 8
/ / \ \
15 4 5 6
Output:
5 : 1 2 3
1 :
2 :
3 :
Explanation:
Deleted leafs are:
8, 15, 4, 5, 6
Input:
8
/ | \
9 7 2
/ | \ | / / | \ \
4 5 6 10 11 1 2 2 3
Output:
8: 9 7 2
9:
7:
2:
**Approach: **Follow the steps given below to solve the problem
Below is the implementation of the above approach:
#data structures #recursion #tree #n-ary-tree #tree-traversal #data analysis
1598832720
Ethereum is known for its wide use in blockchain programming. Especially Solidity is used to write most of the blockchain applications known for today. Here, I’ll help you to learn solidity effortlessly.
Because you interact with the internet and the ethereum nodes at the same time, learning JavaScript becomes necessary to understand the data structures of solidity. Even more, ethereum nodes interact with nodeJS. Furthermore, solidity is written in JavaScript and it requires a basic understanding of JavaScript to work with the ethereum environment.
When I started learning solidity, my first course was face to face offered free because of my club’s connections. But I never stopped and decided to go further by purchasing a udemy course and looking for high-quality YouTube courses, you can level up your solidity skills by practicing. About offline courses, they can be really expensive for you to afford and online courses can allow you to look at the videos and ask questions lifetime.
Mentioned in my previous posts, taking notes by hand allows you not to forget easily when not practicing for a very long time. Even more, remembering the data structures can help you analyzing the codes even with the hugest projects imaginable. I managed to find most of the mistakes in my acceleration project in ethereum despite I was a beginner.
You don’t have to if you prefer using remix IDE for projects. But you might need to consider certain text editors for the best results in programming on ethereum. But, they require you to download certain packages before starting to write your code on these text editors to compile solidity code on your computer.
#solidity-programming #solidity-tutorial #ethereum #solidity #javascript
1599043260
Given a Binary Tree and an integer D, the task is to check if the distance between all pairs of same node values in the Tree is ? D or not. If found to be true, then print Yes. Otherwise, print No.
Examples:
Input:_ D = 7 _
1
/ \
2 3
/ \ / \
4 3 4 4
Output:_ Yes _
Explanation:
_The repeated value of nodes are 3 and 4. _
_The distance between the two nodes valued 3, is 3. _
_The maximum distance between any pair of nodes valued 4 is 4. _
Therefore, none of the distances exceed 7
Input:_ D = 1 _
3
/ \
3 3
\
3
Output:_ No _
Recommended: Please try your approach on {IDE} first, before moving on to the solution.
**Approach: **
The idea is to observe that the problem is similar to finding the distance between two nodes of a tree. But there can be multiple pairs of nodes for which we have to find the distance. Follow the steps below:
#greedy #recursion #searching #tree #binary tree #frequency-counting #postorder traversal #tree-traversal
1593251880
JSON uses two types of brackets that are as follows:
JSON has the following types of structures that are:
1. JSON Objects
The elements inside the curly brackets are known as Objects.
2. JSON Array
A list of values, known as Arrays.
3. JSON Key-Value
This data is stored as a pair of keys and values. Here the keys can be a name, a number for which the values can be Seema, 98767586 etc.
Let us see some reasons for why to choose JSON over XML:
Let us see the code difference of JSON and XML files:
XML Example:
<?xml version= “1.0” encoding= “” ?>
<student>
<student>
<name> Sia Sharma</name>
<city> Chandigarh</city>
</student>
<student>
<name>Dimple D’souza</name>
<city> Nagpur</city>
</student>
<student>
<name>Anna Jones</name>
<city> Mumbai</city>
</student>
</student>
JSON Example:
{ “students”: [
{ “name”: “Sia Sharma”, “city”: “Chandigarh”},
{ “name”: “Prachi D’Souza”, “city”: “Nagpur”},
{ “name”: “Annas Jones”, “city”: “Mumbai”}
]}
I hope the difference is all clear in front of you. This is how simple JSON is and how easily it could be understood.
#android tutorials #json parsing in android #json parsing in android example #json parsing in android step by step #json parsing with android #read json file android