User Tools

Site Tools


tanszek:oktatas:techcomm:syntax_graphs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tanszek:oktatas:techcomm:syntax_graphs [2024/10/07 16:45] kneheztanszek:oktatas:techcomm:syntax_graphs [2024/11/18 20:19] (current) knehez
Line 13: Line 13:
 Even if someone is unfamiliar with the PASCAL language, they would be able to declare syntactically correct variables using the graph: Even if someone is unfamiliar with the PASCAL language, they would be able to declare syntactically correct variables using the graph:
  
-\[ +<code> 
-\text{var age, weekdays : integer;} +var age, weekdays : integer; 
-\] +var taxrate, netIncome : real; 
-\[ +var choice, isready : boolean; 
-\text{var taxrate, netIncome : real;} +  initials, grade : char; 
-\] +  name, surname : string; 
-\[ +</code>
-\text{var choice, isready : boolean;} +
-\] +
-\[ +
-\text{initials, grade : char;+
-\] +
-\[ +
-\text{name, surname : string;} +
-\]+
  
-This shows how graphical representations can help in understanding and constructing syntactically correct structures in programming languages.+This shows how graphical representations can help understand and construct syntactically correct structures in programming languages. 
 + 
 +=== 2. Example: Syntax Graph of the JSON (JavaScript Object Notation) Data Exchange Format with Examples === 
 + 
 +The JSON format is very important in modern information technology. By looking at examples and the syntax graph, we can understand its structure. 
 + 
 +=== Simple JSON Data === 
 + 
 +<sxh json> 
 +
 +   {"title": "Poetry Collection", "author": "Name of the Poet"
 +
 +</sxh> 
 + 
 +This is an object that contains **name-value pairs** or **arrays**, combined in various ways. For example: 
 + 
 +<sxh json> 
 +
 +  "menu":
 +    "id": "file", 
 +    "value": "File", 
 +    "popup":
 +      "menuitem":
 +        {"value": "New", "onclick": "CreateNewDoc()"}, 
 +        {"value": "Open", "onclick": "OpenDoc()"}, 
 +        {"value": "Close", "onclick": "CloseDoc()"
 +      ] 
 +    } 
 +  } 
 +
 +</sxh> 
 + 
 +This example shows how JSON can be used to structure objects, where properties have values and methods. The syntax graph helps visualize the relationships between objects, arrays, and values. 
 + 
 +JSON object: 
 + 
 +{{:tanszek:oktatas:techcomm:pasted:20241007-164934.png}} 
 + 
 +JSON array: 
 + 
 +{{:tanszek:oktatas:techcomm:pasted:20241007-164944.png}} 
 + 
 +JSON types: 
 + 
 +{{:tanszek:oktatas:techcomm:pasted:20241007-165011.png}} 
 + 
 +JSON string: 
 + 
 +{{:tanszek:oktatas:techcomm:pasted:20241007-165025.png}} 
 + 
 +JSON number: 
 + 
 +For example: ''-0.123E+10'' or ''12.324'' 
 + 
 +{{:tanszek:oktatas:techcomm:pasted:20241007-165120.png}}
tanszek/oktatas/techcomm/syntax_graphs.1728319517.txt.gz · Last modified: 2024/10/07 16:45 by knehez